
/* ==========================================================================
   THE SLOW DRAW - GLOBAL SHOP & ARCHIVE STYLES (FINAL VERSION)
   ========================================================================== */

/* Filters */
.filter-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.filter-content.open { max-height: 500px; transition: max-height 0.5s ease-in; }
.filter-btn::after { content: '+'; float: right; transition: transform 0.3s; }
.filter-btn.active::after { content: '-'; transform: rotate(180deg); }
#sidebar-filter.active { transform: translateX(0); }
#filter-overlay.active { display: block; opacity: 1; }

@media (max-width: 1024px) {
    #sidebar-filter {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: min(80%, 320px);
        background: white;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 2rem;
        overflow-y: auto;
    }

    #filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 45;
    }
}

/* Shop Header Cards */
.shop-header-card {
    position: relative;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
    background: #fff;
    border-radius: clamp(16px, 2vw, 24px);
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.shop-header-card h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    line-height: 1.1;
}

.shop-header-card p {
    color: #666;
    max-width: 600px;
    position: relative;
    z-index: 2;
    font-size: clamp(13px, 1.2vw, 14px);
    line-height: 1.6;
    margin-top: clamp(0.5rem, 1vw, 0.75rem);
}

/* Product Grid & Cards */
.archive-products-grid { align-items: stretch; }
.archive-products-grid > * { min-width: 0; }

.archive-product-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
    border: 1px solid #e8eaed;
    border-radius: clamp(20px, 2vw, 26px);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(17, 24, 39, 0.04);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    backface-visibility: hidden;
}

.archive-product-card:hover {
    transform: translateY(-7px);
    border-color: #d8dde3;
    box-shadow: 0 20px 45px rgba(17, 24, 39, 0.08);
}

/* Badges */
.archive-card-top-left {
    position: absolute;
    top: clamp(8px, 1vw, 12px);
    left: clamp(8px, 1vw, 12px);
    z-index: 12;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.archive-mini-badge,
.archive-top-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: clamp(8px, 0.72vw, 9px);
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
}

.archive-mini-badge--muted {
    background: rgba(243, 244, 246, 0.96);
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.archive-mini-badge--sale {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
}

.archive-top-badge {
    position: absolute;
    top: clamp(8px, 1vw, 12px);
    right: clamp(8px, 1vw, 12px);
    z-index: 12;
    border: 1px solid transparent;
}

.archive-top-badge--premium { background: #9b6b28; color: #fff; }
.archive-top-badge--bestseller { background: #111827; color: #fff; }
.archive-top-badge--toprated { background: #14532d; color: #fff; }

.archive-collection-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(100%, 220px);
    min-height: 28px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: clamp(8px, 0.72vw, 9px);
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(176, 141, 87, 0.1);
    border: 1px solid rgba(176, 141, 87, 0.28);
    color: #6f4e37;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Media & Imagery */
.archive-card-media {
    position: relative;
    min-height: clamp(220px, 24vw, 290px);
    padding: clamp(1.1rem, 2vw, 1.35rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-bottom: 1px solid #f1f2f4;
    text-decoration: none;
    overflow: hidden;
    cursor: crosshair;
}

.archive-card-image-wrap {
    width: 100%;
    height: clamp(180px, 20vw, 235px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

.archive-product-image {
    max-height: 100%;
    max-width: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.05));
    transition: transform 0.18s ease-out;
    will-change: transform;
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center center;
}

/* Card Body Typography & Actions */
.archive-card-body {
    padding: clamp(0.95rem, 1.8vw, 1.15rem);
    display: flex;
    flex-direction: column;
    gap: clamp(0.65rem, 1.2vw, 0.85rem);
    flex: 1 1 auto;
}

.archive-card-badge-stack {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 32px;
}

.archive-product-title {
    margin: 0;
    min-height: calc(1.34em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.34;
    font-size: clamp(11px, 0.95vw, 13px);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #121826;
    text-align: center;
}

.archive-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.archive-product-card:hover .archive-product-title a { color: #6f4e37; }

.archive-rating-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: -2px;
}

.archive-rating-value {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.archive-rating-count {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    line-height: 1;
}

.archive-product-price {
    text-align: center;
    font-size: clamp(1.02rem, 1.35vw, 1.28rem);
    font-weight: 800;
    line-height: 1.2;
    color: #111827;
    letter-spacing: -0.02em;
    margin-top: 2px;
}

.archive-product-price del {
    opacity: 0.45;
    margin-right: 6px;
    font-weight: 700;
}

.archive-product-price ins {
    text-decoration: none;
    color: #111827;
}

/* Buttons & Cart States */
.archive-card-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vw, 10px);
    padding-top: 6px;
}

.archive-card-btn,
.archive-card-actions a.archive-card-btn,
.archive-card-actions button.archive-card-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: clamp(40px, 3.5vw, 44px);
    padding: clamp(8px, 1vw, 12px) clamp(14px, 1.5vw, 18px);
    margin: 0;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: clamp(9px, 0.72vw, 10px);
    font-weight: 900;
    font-family: "Poppins", sans-serif;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: all 0.25s ease;
    cursor: pointer;
    box-sizing: border-box;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: none !important;
    box-shadow: none;
    overflow: hidden;
    isolation: isolate;
}

.archive-card-actions button.archive-card-btn:focus,
.archive-card-actions a.archive-card-btn:focus {
    outline: none;
    box-shadow: none;
}

.archive-card-btn--cart,
.archive-card-actions button.archive-card-btn--cart,
.archive-card-actions a.archive-card-btn--cart {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #111827 !important;
    border: 1.5px solid #d1d5db !important;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06) !important;
}

.archive-card-btn--cart:hover,
.archive-card-actions button.archive-card-btn--cart:hover,
.archive-card-actions a.archive-card-btn--cart:hover {
    border-color: #111827 !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.archive-card-btn--buy,
.archive-card-actions button.archive-card-btn--buy,
.archive-card-actions a.archive-card-btn--buy {
    background: #111111 !important;
    color: #ffffff !important;
    border: 1.5px solid #111111 !important;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12) !important;
}

.archive-card-btn--buy:hover,
.archive-card-actions button.archive-card-btn--buy:hover,
.archive-card-actions a.archive-card-btn--buy:hover {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #111111 !important;
}

.archive-card-btn--disabled,
.archive-card-actions button.archive-card-btn--disabled,
.archive-card-actions a.archive-card-btn--disabled {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border: 1.5px solid #e5e7eb !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

/* Modern Loading State */
.archive-card-btn--cart.loading,
.archive-card-actions button.archive-card-btn--cart.loading,
.archive-card-actions a.archive-card-btn--cart.loading,
.ajax_add_to_cart.loading,
.js-sd-drawer-add-to-cart.loading {
    color: transparent !important;
    text-shadow: none !important;
    border-color: #111827 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08) !important;
    pointer-events: none;
}

.archive-card-btn--cart.loading::before,
.archive-card-actions button.archive-card-btn--cart.loading::before,
.archive-card-actions a.archive-card-btn--cart.loading::before,
.ajax_add_to_cart.loading::before,
.js-sd-drawer-add-to-cart.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(17, 24, 39, 0.07) 0%, rgba(17, 24, 39, 0.03) 58%, rgba(17, 24, 39, 0) 72%);
    animation: archiveLoaderPulse 1.4s ease-in-out infinite;
    z-index: 1;
}

.archive-card-btn--cart.loading::after,
.archive-card-actions button.archive-card-btn--cart.loading::after,
.archive-card-actions a.archive-card-btn--cart.loading::after,
.ajax_add_to_cart.loading::after,
.js-sd-drawer-add-to-cart.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 2px solid rgba(17, 24, 39, 0.14);
    border-top-color: #111827;
    border-right-color: #111827;
    animation: archiveCartSpin 0.72s linear infinite;
    z-index: 2;
}

@keyframes archiveCartSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes archiveLoaderPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0.75;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 1;
    }
}

/* Modern Pagination */
.modern-pagination { margin-top: clamp(2rem, 4vw, 4rem); }

.modern-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 0.8vw, 10px);
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.modern-pagination li a,
.modern-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(36px, 3vw, 42px);
    height: clamp(36px, 3vw, 42px);
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #000;
    font-weight: 700;
    transition: all 0.3s ease;
}

.modern-pagination li a:hover,
.modern-pagination li span.current {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Taxonomy Hero & Grids */
.sd-category-hero {
    position: relative;
    background: radial-gradient(circle at top right, rgba(155, 107, 40, 0.05), transparent 30%), #fff;
    overflow: hidden;
}

.sd-category-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: clamp(24px, 4vw, 60px);
    align-items: center;
}

.sd-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(155, 107, 40, 0.30);
    color: #9b6b28;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.sd-hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 0.95;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.sd-hero-title span { color: #9b6b28; }

.sd-hero-copy {
    font-size: clamp(13px, 1.1vw, 15px);
    line-height: 1.8;
    color: #575757;
    max-width: 600px;
}

.sd-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.5rem;
}

.sd-hero-meta span {
    background: #fcfbf9;
    border: 1px solid #ece7df;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Visual Box */
.sd-hero-visual {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sd-hero-visual img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Watermark */
.sd-watermark {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    width: 100%;
    font-size: clamp(3rem, 12vw, 12rem);
    font-weight: 900;
    line-height: 0.7;
    opacity: 0.03;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    text-align: center;
    z-index: 0;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .sd-category-grid { grid-template-columns: 1fr; text-align: center; }
    .sd-hero-copy, .sd-hero-meta { margin-left: auto; margin-right: auto; justify-content: center; }
    .sd-watermark { font-size: clamp(3rem, 20vw, 8rem); top: 50%; }
}

/* Archive Product Meta Grid */
.archive-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.4rem, 0.8vw, 0.6rem);
    border-top: 1px solid #f2f4f7;
    padding-top: clamp(0.85rem, 1vw, 1rem);
    margin-top: 0.1rem;
}

.archive-meta-card {
    min-width: 0;
    min-height: clamp(74px, 8vw, 84px);
    border-radius: clamp(14px, 1.4vw, 16px);
    border: 1px solid #eef0f3;
    background: #fafafa;
    padding: clamp(0.5rem, 0.8vw, 0.68rem) clamp(0.3rem, 0.6vw, 0.45rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
}

.archive-meta-icon {
    font-size: clamp(11px, 0.9vw, 12px);
    line-height: 1;
    color: #6f4e37;
}

.archive-meta-label {
    font-size: clamp(7px, 0.65vw, 9px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
}

.archive-meta-value {
    min-height: 2.35em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: clamp(9px, 0.8vw, 10.5px);
    line-height: 1.2;
    font-weight: 700;
    color: #374151;
    text-align: center;
}

.archive-intensity-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 14px;
}

.archive-intensity-dots span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #d1d5db;
    display: inline-block;
}

.archive-intensity-dots span.is-on {
    background: #111827;
}

/* Compact Tablet / Mobile Meta Layout */
@media (max-width: 991px) {
    .archive-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        padding-top: 0.85rem;
    }

    .archive-meta-card {
        min-height: 72px;
        padding: 0.5rem 0.4rem;
        border-radius: 14px;
    }

    .archive-meta-card:nth-child(3) {
        grid-column: 1 / -1;
        min-height: 66px;
    }

    .archive-meta-icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        font-size: 0;
        line-height: 1;
    }

    .archive-meta-card:nth-child(1) .archive-meta-icon::before {
        content: '⏱';
        font-size: 13px;
        line-height: 1;
        color: #6f4e37;
    }

    .archive-meta-card:nth-child(2) .archive-meta-icon::before {
        content: '💨';
        font-size: 13px;
        line-height: 1;
    }

    .archive-meta-card:nth-child(3) .archive-meta-icon::before {
        content: '📏';
        font-size: 13px;
        line-height: 1;
    }

    .archive-meta-label {
        font-size: 7px;
        letter-spacing: 0.11em;
    }

    .archive-meta-value {
        font-size: 10px;
        line-height: 1.2;
        min-height: auto;
    }

    .archive-meta-card:nth-child(2) .archive-meta-value {
        min-height: 16px;
    }

    .archive-meta-card:nth-child(3) .archive-meta-value {
        max-width: 100%;
        text-align: center;
    }

    .archive-intensity-dots {
        gap: 3px;
        min-height: 14px;
        flex-wrap: nowrap;
    }

    .archive-intensity-dots span {
        width: 7px;
        height: 7px;
    }
}
