﻿/* ============================================================
   CLASS HOODIES – CLEANED & OPTIMIZED STYLES
   ============================================================ */

/* --- Layout structure --- */
.hoodies-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.filters {
    border: 1px solid #e5e5e5;
    padding: 16px;
    border-radius: 8px;
    background: #fafafa;
}

.filter-block {
    margin-bottom: 20px;
}

    .filter-block h4 {
        font-size: 14px;
        text-transform: uppercase;
        margin-bottom: 10px;
    }

#sizeList label {
    margin-right:.7rem;
}

/* --- Applied filters chips --- */
.applied-filters {
    margin-bottom: 16px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 16px;
    margin: 0 6px 6px 0;
    background: #fff;
    font-size: 12px;
}

    .chip button {
        border: 0;
        background: transparent;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
    }

/* --- Colour swatches --- */
.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px; /* extra space for label text */
}


.swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

    .swatch.active {
        box-shadow: 0 0 0 2px #333;
    }

/* label underneath the expanded swatch */
.swatch-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    font-size: 11px;
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.swatch:hover .swatch-label {
    opacity: 1;
}

/* --- Swatch active-view (mobile tap) --- */
.swatch.active-view {
    transform: scale(1.8);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
    z-index: 6;
}

    .swatch.active-view .swatch-label {
        opacity: 1;
    }

/* --- Toolbar --- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
}

    .toolbar .group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

/* --- Results meta --- */
.results-meta {
    margin: 8px 0;
    font-size: 13px;
    color: #666;
}

/* --- Product grid and list layout --- */
#productContainer.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

#productContainer.list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
}

    .card:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

/* --- Grid mode --- */
#productContainer.grid .card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    transition: opacity 0.2s;
}

    #productContainer.grid .card img:hover {
        opacity: 0.9;
    }

#productContainer.grid .card .body {
    flex: 1;
    padding: 14px 12px 16px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

    #productContainer.grid .card .body div:first-child {
        font-size: 15px;
        font-weight: 600;
        color: #111;
        margin-bottom: 6px;
        line-height: 1.3;
        min-height: 38px;
    }

#productContainer.grid .card .price {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-top: 4px;
}

#productContainer.grid .card .btn {
    margin-top: 8px;
    font-size: 13px;
    padding: 6px 10px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    transition: background 0.2s;
}

    #productContainer.grid .card .btn:hover {
        background: #333;
    }

/* --- List mode --- */
.card.list-mode {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    transition: background 0.2s;
}

    .card.list-mode:hover {
        background: #f9f9f9;
    }

    .card.list-mode img {
        width: 140px;
        height: 140px;
        flex-shrink: 0;
        border-radius: 8px;
        object-fit: cover;
        margin-right: 20px;
        background: #f4f4f4;
    }

    .card.list-mode .body {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }

        .card.list-mode .body div:first-child {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 4px;
        }

    .card.list-mode .price {
        font-size: 15px;
        font-weight: 700;
        color: #222;
    }

    .card.list-mode .btn {
        align-self: flex-start;
        margin-top: 6px;
        font-size: 13px;
        padding: 6px 10px;
    }

/* --- Pager --- */
.pager {
    display: flex;
    gap: 6px;
    margin-top: 16px;
}

    .pager .pbtn {
        padding: 6px 10px;
        border: 1px solid #ddd;
        background: #fff;
        border-radius: 6px;
        cursor: pointer;
    }

        .pager .pbtn.active {
            background: #111;
            color: #fff;
            border-color: #111;
        }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #111;
    color: #fff;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn.secondary {
        background: #fff;
        color: #111;
    }

    .btn.disabled {
        background: #eee !important;
        color: #666 !important;
        cursor: not-allowed;
        border-color: #eee !important;
    }

/* --- Misc product elements --- */
.img-wrap {
    position: relative;
    width: 100%;
}

.badge-out {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(200, 0, 0, 0.9);
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* --- Stock toggle --- */
.stock-toggle {
    margin-top: 12px;
    font-size: 13px;
}

    .stock-toggle input[type="checkbox"] {
        margin-right: 6px;
        transform: scale(1.1);
    }

    .stock-toggle.active label {
        font-weight: 600;
        color: #111;
    }

/* ============================================================
   PRICE SLIDER (with labels + tooltips)
   ============================================================ */
/* Keep the range inside the track and avoid bleed at the ends */
#price-slider {
    overflow: hidden;
}

    /* Center the handle without affecting left:% math */
    #price-slider .ui-slider-handle {
        top: 50%;
        transform: none; /* ← remove translateX */
        width: 1.2em;
        height: 1.2em;
        margin-left: -0.6em; /* half width to center on left:% */
        margin-top: -0.6em; /* half height to vertically center */
        background: #111;
        border-radius: 50%;
        border: 2px solid #fff;
        cursor: pointer;
        z-index: 2;
        box-sizing: border-box;
    }

        /* Hover/active (unchanged) */
        #price-slider .ui-slider-handle:hover,
        #price-slider .ui-slider-handle.ui-state-active {
            background: #333;
        }

    /* Range stays fully inside the bar */
    #price-slider .ui-slider-range {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: #999;
        border: 0;
        border-radius: 3px; /* match track corners */
    }

/* Tooltip styling */
.price-tooltip {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.ui-slider .ui-slider-handle.ui-state-active .price-tooltip {
    opacity: 1;
}

.price-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0 4px;
    border-style: solid;
    border-color: #111 transparent transparent transparent;
}

/* Labels under slider */
.price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 6px;
    color: #333;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Prevent horizontal overflow */
body, html {
    overflow-x: hidden;
}

/* Grid adjustments */
@media (max-width: 1100px) {
    #productContainer.grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 900px) {
    .hoodies-wrap {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filters,
    section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

        .toolbar .group {
            flex-wrap: wrap;
            justify-content: flex-start;
        }

    select, button, label {
        max-width: 100%;
    }

    #productContainer.grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    #price-slider .ui-slider-handle {
        width: 1.4em;
        height: 1.4em;
    }
}

@media (max-width: 600px) {
    .swatches {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .swatch {
        width: 24px;
        height: 24px;
        margin: 2px;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure no element sets a forced min-width */
.hoodies-wrap, .filters, section, .toolbar, .grid, .list {
    min-width: 0;
}

/* --- Animation polish --- */
@keyframes fadeInCards {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#productContainer.grid .card,
#productContainer.list .card {
    animation: fadeInCards 0.35s ease both;
}

    #productContainer.grid .card:nth-child(1) {
        animation-delay: 0.02s;
    }

    #productContainer.grid .card:nth-child(2) {
        animation-delay: 0.04s;
    }

    #productContainer.grid .card:nth-child(3) {
        animation-delay: 0.06s;
    }

    #productContainer.grid .card:nth-child(4) {
        animation-delay: 0.08s;
    }

    #productContainer.grid .card:nth-child(5) {
        animation-delay: 0.10s;
    }

    #productContainer.grid .card:nth-child(6) {
        animation-delay: 0.12s;
    }

    #productContainer.grid .card:nth-child(7) {
        animation-delay: 0.14s;
    }

    #productContainer.grid .card:nth-child(8) {
        animation-delay: 0.16s;
    }

#productContainer.list .card {
    animation-duration: 0.45s;
}


/* --- Toast Notification --- */
.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(30, 30, 30, 0.9);
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

    .toast-message.show {
        opacity: 1;
        transform: translateY(0);
    }


/* --- Low stock warning --- */

.badge-low {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255, 165, 0, 0.9);
    color: #111;
    font-size: 11px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}


/* --- Swatch hover expansion with label --- */
.swatch {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .swatch:hover {
        transform: scale(1.8);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
        z-index: 5;
    }



