/* =============================================================================
   Surplus Sale Section
   Mobile-first. No CSS variables. Static values only.
   Selectors are prefixed with #wrapper to win specificity over Flatsome's own
   product/grid styles without resorting to !important.
   ============================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

#wrapper .surplus-sale {
    width: 100%;
    padding: 32px 0 48px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(200, 184, 154, 0.15);
    margin-bottom: 28px;
}

#wrapper .surplus-sale__heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#wrapper .surplus-sale__title {
    font-weight: 500;
    font-size: 54px;
    letter-spacing: 4px;
    color: #fff;
    margin-bottom: 0;
}

#wrapper .surplus-sale__subtitle {
    font-size: 10px;
    letter-spacing: 3px;
    color: #C8B89A;
    text-transform: uppercase;
    opacity: 0.55;
    margin-top: 4px;
}

/* Filter bar sits beside the heading on desktop, full width below it on mobile */
@media (min-width: 768px) {
    #wrapper .surplus-sale__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

/* ── Filters ─────────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#wrapper .surplus-sale__filter {
    background: none;
    border: 1px solid rgba(200, 184, 154, 0.18);
    color: rgba(240, 238, 232, 0.45);
    padding: 6px 18px;
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    margin: 0;
}

#wrapper .surplus-sale__filter:hover {
    color: #C8B89A;
    border-color: #C8B89A;
}

#wrapper .surplus-sale__filter.is-active {
    color: #C8B89A;
    border-color: #C8B89A;
}

/* Toggled by the filter bar JS — items stay in the DOM (just hidden) so
   switching filters never re-renders or re-fetches the grid. */
#wrapper .surplus-sale__item.is-hidden {
    display: none;
}

/* "Fade up" entrance — replayed by the filter bar JS on every tab switch so
   the matching cards visibly lift into place instead of just snapping in. */
#wrapper .surplus-sale__item.is-revealing {
    animation: surplus-sale-reveal 0.5s ease both;
}

@keyframes surplus-sale-reveal {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #wrapper .surplus-sale__item.is-revealing {
        animation: none;
    }
}

/* ── Grid ────────────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

/* 4-column layout on desktop */
@media (min-width: 768px) {
    #wrapper .surplus-sale__grid--cols-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    #wrapper .surplus-sale__grid--cols-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    #wrapper .surplus-sale__grid--cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
}

/* ── Card ────────────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item {
    position: relative;
    display: flex;
    flex-direction: column;
}

#wrapper .surplus-sale__item-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
}

/* ── Product Image ───────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item-image {
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    /* Maintain consistent aspect ratio across all cards */
    aspect-ratio: 4 / 5;
}

#wrapper .surplus-sale__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Front image — visible by default */
#wrapper .surplus-sale__img-front {
    position: relative;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Back image — absolutely stacked on top, hidden by default */
#wrapper .surplus-sale__img-back {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}



/* ── Corner Tags (ACF: tag_left / tag_right) ─────────────────────────────── */

#wrapper .surplus-sale__item-tag {
    position: absolute;
    top: 14px;
    z-index: 3;
    padding: 5px 10px;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

#wrapper .surplus-sale__item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
}

#wrapper .surplus-sale__item-tag--left {
    left: 14px;
    background-color: #1C2B4A;
    color: #C8B89A;
    border: 1px solid rgba(200, 184, 154, 0.2);
}

#wrapper .surplus-sale__item-tag--right {
    right: 14px;
    background-color: #C8B89A;
    color: #111827;
}

/* ── Product Info ────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item-info {
    background-color: #111827;
    padding: 18px 18px 22px;
    border-top: 1px solid rgba(200, 184, 154, 0.07);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
    flex-grow: 1;
}

#wrapper .surplus-sale__item-info .price {
    display: block;
    margin: 0;
    line-height: 1.5;
    text-align: right;
    flex-shrink: 0;
}

#wrapper .surplus-sale__item-info .price .amount,
#wrapper .surplus-sale__item-info .price .woocommerce-Price-currencySymbol {
    color: #C8B89A;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ── Product Name ────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item-name {
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #F0EEE8;
    margin: 0;
    line-height: 1.2;
    text-align: left;
    margin-bottom: -4px;

}

/* ── Color Swatches ──────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item-color-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 2px;
    color: #6B7280;
    text-transform: uppercase;
    text-align: left;
}

#wrapper .surplus-sale__item-colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
}

#wrapper .surplus-sale__item-color {
    display: inline-block;
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(200, 184, 154, 0.25);
    flex-shrink: 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

#wrapper .surplus-sale__item-color:hover {
    transform: scale(1.15);
    border-color: rgba(200, 184, 154, 0.5);
}

#wrapper .surplus-sale__item-color.is-active {
    box-shadow: 0 0 0 3px rgba(200, 184, 154, 0.6);
    border-color: #C8B89A;
}



/* ── Size Swatches ───────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item-sizes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 9;
    background: rgba(8, 12, 26, 0.96);
    padding: 14px;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

#wrapper .surplus-sale__item:hover .surplus-sale__item-sizes {
    opacity: 1;
    transform: translateY(0);
}

#wrapper .surplus-sale__item-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 8px 0px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    color: rgba(240, 238, 232, 0.55);
    background: none;
    border: 1px solid rgba(200, 184, 154, 0.25);
    line-height: 1;
    text-transform: uppercase;
    flex: 1;
}

#wrapper .surplus-sale__item-size:hover {
    border: 1px solid #C8B89A;
    color: #C8B89A;
}

/* ── Price ───────────────────────────────────────────────────────────────── */

#wrapper .surplus-sale__item-price {
    font-size: 12px;
    color: #111111;
    line-height: 1.4;
}

/* WooCommerce renders sale price inside <ins> and original inside <del> */
#wrapper .surplus-sale__item-price ins {
    text-decoration: none;
    font-weight: 400;
    color: #111111;
}

#wrapper .surplus-sale__item-price del {
    color: #999999;
    font-weight: 400;
    margin-left: 6px;
    font-size: 11px;
}

#wrapper .surplus-sale__item-price .woocommerce-Price-amount {
    font-size: inherit;
}

/* ── Footer / View All button ────────────────────────────────────────────── */

#wrapper .surplus-sale__footer {
    margin-top: 36px;
    text-align: center;
}

#wrapper .surplus-sale__view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 13px 40px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    background-color: #111111;
    border: 1px solid #111111;
    transition: background-color 0.25s ease, color 0.25s ease;
}

#wrapper .surplus-sale__view-all:hover {
    background-color: #ffffff;
    color: #111111;
}

/* ── Variations Header Alignment (Left: Attribute Label, Right: Selected Value) ─ */
.product-lightbox form.variations_form table.variations tr,
form.variations_form table.variations tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

.product-lightbox form.variations_form table.variations th.label,
form.variations_form table.variations th.label {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 0 10px 0 !important;
    border: none !important;
    background: none !important;
}

.product-lightbox form.variations_form table.variations th.label label,
form.variations_form table.variations th.label label {
    font-size: 9px !important;
    letter-spacing: 3px !important;
    color: rgba(200, 184, 154, 0.5) !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    font-weight: 500 !important;
}

.product-lightbox form.variations_form .woo-selected-variation-item-name,
form.variations_form .woo-selected-variation-item-name {
    font-size: 11px !important;
    letter-spacing: 2px !important;
    color: #C8B89A !important;
    text-transform: uppercase !important;
    font-weight: 500 !important;
    margin-left: auto !important;
}

.product-lightbox form.variations_form table.variations td.value,
form.variations_form table.variations td.value {
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

/* ── Hide Clear / Reset Variations Button ─────────────────────────────────── */
.reset_variations,
.product-lightbox .reset_variations,
form.variations_form .reset_variations {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

@media (max-width: 782px) {
    #wrapper .surplus-sale__title {
        font-size: 38px;
        letter-spacing: 3px;
    }

    #wrapper .surplus-sale {
        padding: 10px 0 10px;
    }

    #wrapper .surplus-sale__header {
        gap: 5px;
    }

    #wrapper .surplus-sale__heading {
        gap: 0;
    }

    #wrapper .surplus-sale__filter {
        padding: 2px 10px;
    }

    #wrapper .surplus-sale__item-name {
        font-size: 13px;
    }

    #wrapper .surplus-sale__item-size {
        min-width: 20px;
        height: 20px;
        padding: 0px 10px;
        font-size: 8px;
    }
}

/* ── Swiper Slider — Layout \u0026 Nav On Hover ────────────────────────────────
   Custom Swiper navigation for the surplus sale slider.
   Arrows hidden by default, appear with slide-in + fade on hover.
   ─────────────────────────────────────────────────────────────────────── */

/* Wrapper positions arrows relative to slider area */
#wrapper .surplus-sale__slider-wrap {
    position: relative;
    overflow: hidden;
}

/* ── Nav Arrow Base ─────────────────────────────────────────────────────── */

#wrapper .surplus-sale__swiper-prev,
#wrapper .surplus-sale__swiper-next {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    padding: 0;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(200, 184, 154, 0.25);
    border-radius: 50%;
    color: #C8B89A;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

#wrapper .surplus-sale__swiper-prev.swiper-button-disabled,
#wrapper .surplus-sale__swiper-next.swiper-button-disabled {
    display: none !important;
}

#wrapper .surplus-sale__swiper-prev svg,
#wrapper .surplus-sale__swiper-next svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Previous arrow — starts offset to the right */
#wrapper .surplus-sale__swiper-prev {
    left: 12px;
    transform: translateX(30%);
}

/* Next arrow — starts offset to the left */
#wrapper .surplus-sale__swiper-next {
    right: 12px;
    transform: translateX(-30%);
}

/* ── Hover State — Show Arrows ──────────────────────────────────────────── */

#wrapper .surplus-sale-slider:hover .surplus-sale__swiper-prev,
#wrapper .surplus-sale-slider:hover .surplus-sale__swiper-next {
    opacity: 0.8;
    transform: translateX(0);
}

/* Arrow direct hover — full opacity + accent border */
#wrapper .surplus-sale__swiper-prev:hover,
#wrapper .surplus-sale__swiper-next:hover {
    opacity: 1;
    background: rgba(17, 24, 39, 0.95);
    border-color: #C8B89A;
}

/* Disabled state when slider reaches the edge */
#wrapper .surplus-sale__swiper-prev.swiper-button-disabled,
#wrapper .surplus-sale__swiper-next.swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}

/* ── Hide Arrows On Mobile — Touch Devices Use Swipe ────────────────────── */

@media (max-width: 782px) {
    #wrapper .surplus-sale__swiper-prev,
    #wrapper .surplus-sale__swiper-next {
        display: none;
    }
}

/* ── Override Swiper Default Nav Styles ──────────────────────────────────── */

#wrapper .surplus-sale__swiper .swiper-button-prev,
#wrapper .surplus-sale__swiper .swiper-button-next {
    display: none;
}