/* ============================================================
   CST variationAttribute
   File: cartridge/static/default/css/product/cst-variationAttribute.css
   ============================================================ */

/* ── Hide ALL selects inside cst-attribute ── */
.cst-attribute select {
    display: none !important;
}

/* ── Label styles ── */
.cst-attribute .non-input-label,
.cst-attribute label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f1111 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 8px !important;
}

.cst-label-selected {
    font-weight: 400 !important;
    color: #c45500 !important;
}

/* ================================================================
   SWATCH GRID — paginated, 3 rows max
   ================================================================ */

/* Outer wrapper — holds viewport + nav buttons */
.cst-swatch-wrapper {
    position: relative !important;
    margin: 0 0 16px 0 !important;
}

/* Scrollable viewport — clips to 3 rows */
.cst-swatch-viewport {
    overflow: hidden !important;
    width: 100% !important;
}

/* The actual grid — JS sets width for pagination */
.cst-swatch-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: transform 0.28s ease !important;
    /* row height = 70px swatch + 16px name + 6px gap + 3px padding = ~103px per row
       3 rows + 2 gaps = 103*3 + 8*2 = 325px */
    max-height: 325px !important;
    overflow: hidden !important;
    align-content: flex-start !important;
}

/* When paginating JS removes max-height on the full strip */
.cst-swatch-grid--paginating {
    max-height: none !important;
    flex-wrap: wrap !important;
}

/* ── Nav buttons (prev / next) ── */
.cst-swatch-nav {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

.cst-swatch-nav-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border: 1px solid #d5d9d9 !important;
    border-radius: 6px !important;
    background: #fff !important;
    cursor: pointer !important;
    color: #0f1111 !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.cst-swatch-nav-btn:hover:not(:disabled) {
    border-color: #c45500 !important;
    box-shadow: 0 0 0 2px rgba(196, 85, 0, 0.2) !important;
}

.cst-swatch-nav-btn:disabled {
    opacity: 0.35 !important;
    cursor: default !important;
}

.cst-swatch-nav-dots {
    display: flex !important;
    gap: 5px !important;
    align-items: center !important;
}

.cst-swatch-nav-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: #d5d9d9 !important;
    transition: background 0.15s !important;
    flex-shrink: 0 !important;
}

.cst-swatch-nav-dot.is-active {
    background: #c45500 !important;
    width: 8px !important;
    height: 8px !important;
}

.cst-swatch-nav-label {
    font-size: 12px !important;
    color: #767676 !important;
    margin-left: 4px !important;
}

/* ── Colour swatch button ── */
.cst-swatch-grid .color-attribute {
    border: 2px solid #d5d9d9 !important;
    padding: 3px !important;
    background: #fff !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    position: relative !important;
    width: auto !important;
    height: auto !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    flex-shrink: 0 !important;
}

.cst-swatch-grid .color-attribute:hover {
    border-color: #c45500 !important;
    box-shadow: 0 0 0 2px rgba(196, 85, 0, 0.2) !important;
}

.cst-swatch-grid .color-attribute:has(.swatch-circle.selected) {
    border-color: #c45500 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(196, 85, 0, 0.35) !important;
}

.cst-swatch-grid .color-attribute:has(.swatch-circle.unselectable) {
    cursor: not-allowed !important;
    border-style: dashed !important;
    opacity: 0.5 !important;
}

.cst-swatch-grid .color-attribute .swatch-circle {
    width: 70px !important;
    height: 70px !important;
    border-radius: 4px !important;
    background-size: cover !important;
    background-position: center !important;
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin-right: 0 !important;
}

.cst-swatch-grid .color-attribute .swatch-circle.selected::after,
.cst-swatch-grid .color-attribute .swatch-circle.color-value.selected::after {
    display: none !important;
}

.cst-swatch-name {
    display: block !important;
    font-size: 10px !important;
    color: #0f1111 !important;
    text-align: center !important;
    width: 70px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
    padding: 0 2px 2px !important;
    box-sizing: border-box !important;
}

.cst-swatch-grid .color-attribute:has(.swatch-circle.selected) .cst-swatch-name {
    font-weight: 700 !important;
    color: #c45500 !important;
}

/* ================================================================
   SELECT GRID (size/style boxes)
   ================================================================ */
.cst-select-wrapper {
    position: relative !important;
    margin: 0 0 16px 0 !important;
}

.cst-select-viewport {
    overflow: hidden !important;
    width: 100% !important;
}

.cst-select-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    /* 3 rows: each box is 36px tall + 8px gap */
    max-height: 116px !important;
    overflow: hidden !important;
    align-content: flex-start !important;
    transition: transform 0.28s ease !important;
}

.cst-select-grid--paginating {
    max-height: none !important;
}

/* ── Text box buttons ── */
.product-detail .cst-select-grid .cst-size-btn,
.product-detail .cst-select-grid button.cst-size-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 52px !important;
    height: 36px !important;
    padding: 0 14px !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: #888c8c !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #0f1111 !important;
    background-color: #fff !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s !important;
    flex-shrink: 0 !important;
}

.product-detail .cst-select-grid .cst-size-btn:hover,
.product-detail .cst-select-grid button.cst-size-btn:hover {
    border-color: #c45500 !important;
    box-shadow: 0 0 0 2px rgba(196, 85, 0, 0.2) !important;
}

/* SELECTED */
.product-detail .cst-select-grid .cst-size-btn.is-selected,
.product-detail .cst-select-grid button.cst-size-btn.is-selected {
    border-width: 2px !important;
    border-style: solid !important;
    border-color: #c45500 !important;
    box-shadow: 0 0 0 2px rgba(196, 85, 0, 0.35) !important;
    font-weight: 700 !important;
    color: #c45500 !important;
    background-color: #fff9f5 !important;
}

/* DISABLED */
.product-detail .cst-select-grid .cst-size-btn.is-disabled,
.product-detail .cst-select-grid button.cst-size-btn.is-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    border-style: dashed !important;
    text-decoration: line-through !important;
    color: #888 !important;
}

/* ── Shared nav for select grid ── */
.cst-select-nav {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

/* ── Mobile — horizontal swipe ── */
@media (max-width: 767px) {

    /* Swatch grid: single scrollable row strip */
    .cst-swatch-viewport {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .cst-swatch-viewport::-webkit-scrollbar {
        display: none !important;
    }

    .cst-swatch-grid {
        flex-wrap: nowrap !important;
        max-height: none !important;
        width: max-content !important;
        transition: none !important;
    }

    /* Hide pagination nav on mobile */
    .cst-swatch-nav,
    .cst-select-nav {
        display: none !important;
    }

    /* Select grid: horizontal swipe */
    .cst-select-viewport {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .cst-select-viewport::-webkit-scrollbar {
        display: none !important;
    }

    .cst-select-grid {
        flex-wrap: nowrap !important;
        max-height: none !important;
        width: max-content !important;
        transition: none !important;
    }
}