.featured-products-section {
    padding-top: var(--fp-padding-v, 60px);
    padding-bottom: var(--fp-padding-v, 60px);
    width: 100%;
}

.featured-products-section.has-category-filter {
    padding-top: 0;
}

::selection {
    background-color: var(--opsim-brand);
    color: #fff;
}

.section-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

/* Category Filter */
.opsim-category-filter-wrapper {
    margin-bottom: 25px;
    padding: 10px 0;
    border-bottom: 2px solid var(--opsim-border, rgba(0, 0, 0, 0.1));
    background: #fff;
    position: sticky;
    top: 65px; /* Tightened offset to touch header */
    z-index: 100;
}




@media (max-width: 1023px) {
    .opsim-category-filter-wrapper {
        top: 50px; /* Smaller header on mobile */
    }
}


.opsim-category-filter {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 15px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    justify-content: center;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.opsim-category-filter::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

@media (max-width: 767px) {
    .opsim-category-filter {
        justify-content: flex-start;
    }
    
    .filter-item {
        scroll-snap-align: center;
    }
}


.filter-item {
    padding: 6px 16px;
    border: 1px solid var(--opsim-border, rgba(0, 0, 0, 0.1));
    border-radius: 20px;
    background: transparent;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-item:hover {
    border-color: var(--opsim-brand);
    color: var(--opsim-brand);
}

.filter-item.active {
    background: var(--opsim-brand);
    border-color: var(--opsim-brand);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Simplified Products Container */
#opsim-products-container {
    position: relative;
}



.section-header .section-title {
    font-family: var(--opsim-font-secondary);
    font-size: 22px; /* Smaller as requested */
    font-weight: 500; /* Elegant, not bold */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px;
    display: inline-block;
    position: relative;
    padding: 0 80px; /* More padding for longer lines */
}

.section-header .section-title::before,
.section-header .section-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px; /* Longer lines as requested */
    height: 1px;
    background: var(--fp-accent, var(--opsim-brand));
}

.section-header .section-title::before { left: 0; }
.section-header .section-title::after { right: 0; }

.section-header .section-subtitle {
    display: block;
    font-size: 13px;
    color: var(--fp-accent, var(--opsim-brand));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

@media (max-width: 767px) {
    .section-header .section-title {
        font-size: 16px; /* Very small on mobile */
        padding: 0 50px;
    }
    .section-header .section-title::before,
    .section-header .section-title::after {
        width: 40px;
    }
    .featured-products-section {
        padding-top: 30px;
        padding-bottom: 30px;
    }
}

.products-grid-wrapper {
    width: 100%;
    padding: 0 10px; /* Small side margins */
}

@media (max-width: 767px) {
    .products-grid-wrapper {
        padding: 0 5px; /* Full width feel on mobile */
    }
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

@media (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
}

/* Product Card */
.fp-product-card {
    border: 1px solid var(--opsim-border, rgba(0, 0, 0, 0.08));
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    transition: transform 0.2s ease;
    height: 100%;
}

.fp-product-image-link {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.fp-product-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Removed hover zoom as requested */

.fp-discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--fp-accent, var(--opsim-brand));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px 0 8px 0;
    z-index: 2;
}

.fp-product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
}

.fp-product-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    text-transform: uppercase;
    color: #000;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 32px;
}

.fp-product-title a {
    color: inherit;
    text-decoration: none;
}

.fp-product-price {
    margin-bottom: 8px; /* Reduced space between price and button */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.fp-price-old {
    color: #999;
    text-decoration: line-through;
    font-size: 12px;
}

.fp-price-new {
    color: var(--fp-accent, var(--opsim-brand));
    font-weight: 700;
    font-size: 15px;
}

.fp-price-currency {
    font-size: 11px;
    font-weight: 400;
    margin-left: 1px;
}

/* Button */
.fp-atc-btn {
    width: calc(100% - 10px); /* Increased distance from border */
    margin: 0 5px 5px; /* Increased bottom/side distance from border */
    background: var(--fp-accent, var(--opsim-brand));
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-transform: uppercase;
    position: relative;
    min-height: 40px; /* Force consistent height */
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}

.fp-atc-btn:active {
    transform: none !important; /* Prevent shrinking */
}

@media (max-width: 767px) {
    .fp-atc-btn {
        font-size: 9px;
        padding: 8px 5px;
        gap: 4px;
    }
}

.fp-atc-btn svg {
    width: 16px;
    height: 16px;
}

.fp-atc-btn.out-of-stock {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.fp-atc-btn.out-of-stock:hover {
    background: #ccc;
}

/* Loading State for Button */
.fp-atc-btn.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.fp-atc-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: calc(50% - 9px);
    left: calc(50% - 9px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: button-spin 0.6s linear infinite;
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

/* Section Footer */
.section-footer {
    text-align: center;
    margin-top: 30px;
}

.btn-voir-tout {
    display: inline-block;
    background: var(--fp-accent, var(--opsim-brand));
    color: #fff;
    text-decoration: none;
    padding: 6px 20px; /* Much smaller as requested */
    border-radius: 4px;
    font-size: 11px; /* Much smaller as requested */
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    transition: all 0.2s ease;
    min-height: 28px;
    min-width: 100px;
}

.btn-voir-tout.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-voir-tout.is-loading::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    top: calc(50% - 7px);
    left: calc(50% - 7px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: button-spin 0.6s linear infinite;
}

/* Pagination */
.opsim-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.opsim-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
}

.opsim-pagination li a, 
.opsim-pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--opsim-border, #e5e7eb);
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    font-weight: 600;
}

.opsim-pagination li span.current {
    background: var(--opsim-brand);
    color: #fff;
    border-color: var(--opsim-brand);
}

.opsim-pagination li a:hover {
    /* No zoom or color change as requested, maybe just a very subtle border? */
    /* Keeping it "non hover" as requested */
    border-color: var(--opsim-brand);
}
