/*
 * Swiftech Store — Offers & Sales collection pages
 * (/deals, /new-arrivals, /special-offers, /gift-cards).
 *
 * The product grid, cards, pagination and empty state are styled by the
 * compiled products-index bundle (grid-view-products / empty-message /
 * pagination classes); this overlay only styles the page chrome around them.
 * Loaded before the compiled Vite CSS, so anything contested must win on
 * specificity, not order.
 */

.sw-collection {
    padding: 26px 0 56px;
}

.sw-collection .sw-page-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: #0f1419;
}

.sw-collection__head {
    margin-bottom: 22px;
}

.sw-collection__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px 16px;
    background: #f6f7f9;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
}

.sw-collection__count {
    font-size: 13px;
    color: #4a5462;
}

.sw-collection__sort {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sw-collection__sort label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #4a5462;
}

.sw-collection__sort select {
    min-height: 36px;
    padding: 6px 30px 6px 12px;
    font-size: 13px;
    color: #0f1419;
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234a5462' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

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

.sw-collection__grid {
    margin-top: 4px;
}

.sw-collection__pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

/* Empty state: the compiled .empty-message styles are page-scoped in some
   bundles, so restate the essentials here at overlay specificity. */
.sw-collection .sw-collection__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 64px 20px;
    text-align: center;
}

.sw-collection .sw-collection__empty h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #4a5462;
}

.sw-collection .sw-collection__empty-cta {
    margin-top: 4px;
}

@media (max-width: 767px) {
    .sw-collection {
        padding: 18px 0 40px;
    }

    .sw-collection .sw-page-title {
        font-size: 22px;
    }

    .sw-collection__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sw-collection__sort {
        justify-content: space-between;
    }
}

/*======================================================================
  DARK THEME (appended) — every rule below is gated behind
  [data-theme="dark"]; light mode is untouched by construction. Each
  selector repeats the light rule's chain plus the gate so it outranks
  both this file's light rules and the compiled bundles.
======================================================================*/

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

[data-theme="dark"] .sw-collection__toolbar {
    background: #1a1e24;
    border-color: #262b31;
}

[data-theme="dark"] .sw-collection__count,
[data-theme="dark"] .sw-collection__sort label {
    color: #9aa3ad;
}

[data-theme="dark"] .sw-collection__sort select {
    color: #e8ebef;
    /* Same chevron data URI as the light rule, stroke lightened
       %234a5462 -> %23aeb4ba for the dark surface. */
    background: #181c23 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23aeb4ba' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border-color: #2a303a;
}

[data-theme="dark"] .sw-collection .sw-collection__empty h2 {
    color: #a6adb8;
}
