/*
 * Swiftech Store — homepage Best Deals + vertical product columns.
 *
 * All markup in this section uses fresh sw-fsx classes, so there are no
 * cascade battles with the compiled theme (its old section selectors no
 * longer match anything). Loaded from the section blade via the styles
 * stack, which renders AFTER the compiled CSS.
 */

.sw-fsx {
    margin-top: 44px;
}

.sw-fsx__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

@media (min-width: 768px) {
    .sw-fsx__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sw-fsx__grid--deal .sw-fsx__deal {
        grid-column: 1 / -1;
    }
}

/* Tablet band only: a column left alone on the last 2-up row stretches
   across it instead of sitting beside an empty half-width gap. (With the
   deal card as child 1, columns are even/odd-shifted between the two grid
   variants.) */
@media (min-width: 768px) and (max-width: 1199px) {
    .sw-fsx__grid--deal > .sw-fsx__col:last-child:nth-child(even),
    .sw-fsx__grid--nodeal > .sw-fsx__col:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1200px) {
    .sw-fsx__grid--deal {
        grid-template-columns: minmax(0, 0.92fr) repeat(var(--sw-fsx-cols, 3), minmax(0, 0.69fr));
    }

    .sw-fsx__grid--deal .sw-fsx__deal {
        grid-column: auto;
    }

    .sw-fsx__grid--nodeal {
        grid-template-columns: repeat(var(--sw-fsx-cols, 3), minmax(0, 1fr));
    }
}

/*======================= Shared card + pager =======================*/

.sw-fsx__deal,
.sw-fsx__col {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eceef1;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(15, 20, 25, 0.04);
    padding: 20px;
    min-width: 0;
}

.sw-fsx__viewport {
    overflow: hidden;
    flex: 1 1 auto;
}

.sw-fsx__track {
    display: flex;
    align-items: stretch;
    transition: transform 0.35s ease;
}

.sw-fsx__page {
    flex: 0 0 100%;
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .sw-fsx__track {
        transition: none;
    }
}

/* Explicit, so single-page pagers stay arrow-less even if a stylesheet
   without the !important [hidden] reset ever wins the cascade. */
.sw-fsx__arrow[hidden] {
    display: none;
}

.sw-fsx__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 14px;
    color: #4a5462;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.sw-fsx__arrow:hover,
.sw-fsx__arrow:focus-visible {
    color: #fff;
    background: var(--color-primary, #f51e46);
    border-color: var(--color-primary, #f51e46);
}

.sw-fsx__arrow:focus-visible {
    outline: 2px solid var(--color-primary, #f51e46);
    outline-offset: 2px;
}

/*======================= Stars =======================*/

.sw-fsx__stars {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sw-fsx__stars-back {
    position: relative;
    display: inline-flex;
    font-size: 14px;
    line-height: 1;
    color: #d8dce1;
    white-space: nowrap;
}

.sw-fsx__stars-front {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    overflow: hidden;
    color: #f5a623;
    white-space: nowrap;
}

.sw-fsx__stars-count {
    font-size: 12px;
    color: #7b8794;
    white-space: nowrap;
}

/*======================= Best Deals card =======================*/

.sw-fsx__deal {
    background: linear-gradient(160deg, #fff7f6 0%, #fffefe 55%, #fff5f4 100%);
    border-color: #f6e2e0;
}

.sw-fsx__deal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.sw-fsx__deal-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #10151b;
}

.sw-fsx__deal-title b {
    color: var(--color-primary, #f51e46);
    font-weight: 700;
}

.sw-fsx__deal-flame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 18px;
    color: #fff;
    background: var(--color-primary, #f51e46);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(245, 30, 70, 0.3);
}

.sw-fsx__deal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary, #f51e46);
    background: rgba(245, 30, 70, 0.08);
    border-radius: 999px;
    white-space: nowrap;
}

.sw-fsx__deal-arrows {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}

.sw-fsx__deal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 4px;
}

.sw-fsx__deal-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px 10px 22px;
}

.sw-fsx__deal-image img {
    max-width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
}

.sw-fsx__deal-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    color: #10151b;
    transition: color 0.15s ease;
}

.sw-fsx__deal-name:hover {
    color: var(--color-primary, #f51e46);
}

.sw-fsx__deal-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.sw-fsx__deal-price .special-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary, #f51e46);
}

.sw-fsx__deal-price .previous-price {
    font-size: 15px;
    color: #9aa3ad;
    text-decoration: line-through;
}

.sw-fsx__countdown {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
}

.sw-fsx__count-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 52px;
    padding: 8px 6px;
    background: #fff;
    border: 1px solid #eee1e0;
    border-radius: 10px;
}

.sw-fsx__count-num {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    color: #10151b;
    font-variant-numeric: tabular-nums;
}

.sw-fsx__count-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a939e;
}

.sw-fsx__count-sep {
    align-self: center;
    font-weight: 700;
    color: #c9ced4;
}

.sw-fsx__stock {
    width: 100%;
    margin-top: 18px;
}

.sw-fsx__stock-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4a5462;
    margin-bottom: 7px;
}

.sw-fsx__stock-row b {
    color: #10151b;
}

.sw-fsx__progress {
    height: 8px;
    background: #eef0f3;
    border-radius: 999px;
    overflow: hidden;
}

.sw-fsx__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary, #f51e46), #ff5d7c);
    border-radius: 999px;
}

/*======================= Vertical columns =======================*/

.sw-fsx__col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

.sw-fsx__col-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #10151b;
    min-width: 0;
}

.sw-fsx__col-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 6px;
    flex: none;
}

.sw-fsx__col-arrows {
    display: inline-flex;
    gap: 6px;
    flex: none;
}

.sw-fsx__row {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid #f2f4f6;
    text-decoration: none;
}

.sw-fsx__page > .sw-fsx__row:last-child {
    border-bottom: 0;
}

.sw-fsx__row-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 64px;
    height: 78px;
    background: #f7f8fa;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    overflow: hidden;
}

.sw-fsx__row-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sw-fsx__row-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.sw-fsx__row-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-transform: uppercase;
    color: #1a212a;
    transition: color 0.15s ease;
}

.sw-fsx__row:hover .sw-fsx__row-name {
    color: var(--color-primary, #f51e46);
}

.sw-fsx__row .sw-fsx__stars-back {
    font-size: 12px;
}

.sw-fsx__row-price .special-price,
.sw-fsx__row-price {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-primary, #f51e46);
}

.sw-fsx__row-price .previous-price {
    margin-left: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: #9aa3ad;
    text-decoration: line-through;
}

.sw-fsx__view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-primary, #f51e46);
    background: #fff;
    border: 1px solid #f1d9dc;
    border-radius: 10px;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.sw-fsx__view-all:hover,
.sw-fsx__view-all:focus-visible {
    color: #fff;
    background: var(--color-primary, #f51e46);
    border-color: var(--color-primary, #f51e46);
}

.sw-fsx__view-all i {
    transition: transform 0.15s ease;
}

.sw-fsx__view-all:hover i {
    transform: translateX(3px);
}

/*======================= Small screens =======================*/

@media (max-width: 479px) {
    .sw-fsx {
        margin-top: 30px;
    }

    .sw-fsx__deal,
    .sw-fsx__col {
        padding: 16px;
    }

    .sw-fsx__deal-image img {
        max-height: 220px;
    }

    .sw-fsx__count-block {
        min-width: 46px;
    }
}

/*======================= DARK THEME (appended) =======================*/
/*
 * Everything below is gated behind [data-theme="dark"]; light mode is
 * untouched by construction. Each rule repeats the light rule's exact
 * selector chain with the gate prefixed, so it outranks both the light
 * rule in this file and the compiled bundles. Catalog photos have baked
 * white backgrounds: the row image wells keep a LIGHT plate, and the
 * deal hero image (.sw-fsx__deal-image) deliberately gets NO plate —
 * it stays transparent so the photo sits on the card's airy gradient.
 */

[data-theme="dark"] .sw-fsx__deal,
[data-theme="dark"] .sw-fsx__col {
    background: #1a1e24;
    border: 1px solid #262b31;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .sw-fsx__arrow {
    color: #9aa3ad;
    background: #1a1e24;
    border: 1px solid #2a2f36;
}

/* The dark base rule above ties the light :hover rule on specificity
   and, appended later, would win by source order — re-assert the red
   fill under the gate (values identical to the light rules). */
[data-theme="dark"] .sw-fsx__arrow:hover,
[data-theme="dark"] .sw-fsx__arrow:focus-visible {
    color: #fff;
    background: var(--color-primary, #f51e46);
    border-color: var(--color-primary, #f51e46);
}

[data-theme="dark"] .sw-fsx__stars-back {
    color: #3a414a;
}

[data-theme="dark"] .sw-fsx__stars-count {
    color: #8a95a1;
}

/* Deal card: warm dark gradient in place of the warm white one. */
[data-theme="dark"] .sw-fsx__deal {
    background: linear-gradient(160deg, #221a1c 0%, #1a1e24 55%, #211719 100%);
    border-color: rgba(245, 30, 70, 0.18);
}

[data-theme="dark"] .sw-fsx__deal-title {
    color: #e8ebef;
}

[data-theme="dark"] .sw-fsx__deal-badge {
    background: rgba(245, 30, 70, 0.16);
}

[data-theme="dark"] .sw-fsx__deal-name {
    color: #e8ebef;
}

/* Same source-order tie-break as the arrows: keep the red name hover. */
[data-theme="dark"] .sw-fsx__deal-name:hover {
    color: var(--color-primary, #f51e46);
}

[data-theme="dark"] .sw-fsx__deal-price .previous-price {
    color: #8a95a1;
}

[data-theme="dark"] .sw-fsx__count-block {
    background: #20242b;
    border-color: rgba(245, 30, 70, 0.15);
}

[data-theme="dark"] .sw-fsx__count-num {
    color: #e8ebef;
}

[data-theme="dark"] .sw-fsx__count-sep {
    color: #4a5058;
}

[data-theme="dark"] .sw-fsx__stock-row {
    color: #9aa3ad;
}

[data-theme="dark"] .sw-fsx__stock-row b {
    color: #e8ebef;
}

[data-theme="dark"] .sw-fsx__progress {
    background: #262b31;
}

[data-theme="dark"] .sw-fsx__col-head {
    border-bottom-color: #242930;
}

[data-theme="dark"] .sw-fsx__col-title {
    color: #e8ebef;
}

/* The .sw-fsx__page > .sw-fsx__row:last-child border-bottom:0 rule is
   0-3-0 and still outranks this 0-2-0 color-only override. */
[data-theme="dark"] .sw-fsx__row {
    border-bottom-color: #22272e;
}

/* Catalog photos have baked white backgrounds — keep a light plate. */
[data-theme="dark"] .sw-fsx__row-image {
    background: #f0f2f5;
    border-color: #e2e6ea;
}

[data-theme="dark"] .sw-fsx__row-name {
    color: #dfe4ea;
}

[data-theme="dark"] .sw-fsx__row-price .previous-price {
    color: #8a95a1;
}

[data-theme="dark"] .sw-fsx__view-all {
    background: transparent;
    border-color: rgba(245, 30, 70, 0.3);
}

/* Same source-order tie-break: keep the red hover/focus fill. */
[data-theme="dark"] .sw-fsx__view-all:hover,
[data-theme="dark"] .sw-fsx__view-all:focus-visible {
    color: #fff;
    background: var(--color-primary, #f51e46);
    border-color: var(--color-primary, #f51e46);
}
