/* ============================================================
   ShopWoo - Premium Shop Page CSS (v2.8 - High Contrast Edition)
   Mobile-first, Apple-grade design, Bold Typography & Contrast
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables (overridden by PHP dynamic CSS) ── */
:root {
    --sw-pill-bg:           #ffffff;
    --sw-pill-text:         #111111;
    --sw-pill-hover-bg:     #f0f0f5;
    --sw-pill-hover-text:   #000000;
    --sw-pill-active-bg:    #000000;
    --sw-pill-active-text:  #ffffff;
    --sw-title-color:       #111111;
    --sw-price-color:       #111111;
    --sw-buynow-bg:         #000000;
    --sw-buynow-text:       #ffffff;
    --sw-slider-color:      #6c47ff;
    --sw-badge-bg:          #e53e3e;
    --sw-badge-text:        #ffffff;
    --sw-border:            #e2e8f0;
    --sw-bg:                #f8fafc;
    --sw-white:             #ffffff;
    --sw-radius:            14px;
    --sw-shadow:            0 4px 16px rgba(0,0,0,0.05);
    --sw-transition:        0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --sw-pc-cols:           4;
    --sw-mobile-cols:       2;
    /* Gallery */
    --sw-gallery-arrow-bg:  rgba(255,255,255,0.95);
    --sw-gallery-arrow-ico: #111111;
    --sw-gallery-dot-active:#111111;
    /* Quick View */
    --sw-qv-accent:         #6c47ff;
}

/* ── Base ── */
#shopwoo-app * { box-sizing: border-box; font-family: 'Inter', sans-serif !important; }
#shopwoo-app a { text-decoration: none; }
#shopwoo-app { background: var(--sw-bg); min-height: 100vh; padding-bottom: 80px; }

/* ══ CATEGORY BARS ══ */
.shopwoo-pill-bar-wrap {
    background: #ffffff;
    border-bottom: 1.5px solid var(--sw-border);
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.shopwoo-pill-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 24px 24px 20px;
    max-width: 1400px; margin: 0 auto;
}

.sw-pill {
    padding: 11px 26px;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: var(--sw-pill-bg);
    color: var(--sw-pill-text);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: all var(--sw-transition);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sw-pill:hover {
    background: var(--sw-pill-hover-bg) !important;
    color: var(--sw-pill-hover-text) !important;
    border-color: #000000;
}
.sw-pill.active {
    background: var(--sw-pill-active-bg) !important;
    color: var(--sw-pill-active-text) !important;
    border-color: var(--sw-pill-active-bg) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* Subcategories Container */
#sw-subcat-container {
    display: none;
    background: #f1f5f9;
    border-top: 1px solid var(--sw-border);
}
.shopwoo-subcat-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    max-width: 1400px; margin: 0 auto;
}
.sw-sub-pill {
    padding: 9px 20px;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all var(--sw-transition);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.sw-sub-pill:hover {
    background: var(--sw-pill-hover-bg);
    color: var(--sw-pill-hover-text);
    border-color: #000000;
}
.sw-sub-pill.active {
    background: var(--sw-pill-active-bg);
    color: var(--sw-pill-active-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ══ MAIN LAYOUT ══ */
.shopwoo-main-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 32px;
    max-width: 1400px; margin: 0 auto;
    padding: 32px 24px 0;
    align-items: start;
}

/* ══ SIDEBAR ══ */
.shopwoo-sidebar {
    position: sticky; top: 32px;
    background: var(--sw-white);
    border-radius: var(--sw-radius);
    border: 1.5px solid var(--sw-border);
    box-shadow: var(--sw-shadow);
    overflow: hidden;
}
.sw-sidebar-inner { padding: 26px; }

.sw-filter-group {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1.5px solid var(--sw-border);
}
.sw-filter-group:last-of-type { border-bottom: none; margin-bottom: 0; }

.sw-filter-title {
    font-size: 14px; font-weight: 800;
    color: #0f172a; margin: 0 0 16px;
    text-transform: uppercase; letter-spacing: 0.8px;
}

/* Price Display */
.sw-price-display {
    display: flex; justify-content: space-between;
    font-size: 15px; font-weight: 700; color: #0f172a;
    margin-bottom: 16px;
}

/* Minimalist Range Slider */
.sw-range-wrap { position: relative; height: 32px; margin-bottom: 4px; }
.sw-range-track {
    position: absolute; top: 50%; left: 0; right: 0;
    transform: translateY(-50%); height: 3px;
    background: #cbd5e1; pointer-events: none;
    border-radius: 2px;
}
.sw-range-fill {
    position: absolute; height: 100%;
    background: var(--sw-slider-color);
    border-radius: 2px;
}
.sw-range {
    position: absolute; width: 100%; height: 3px;
    -webkit-appearance: none; appearance: none;
    background: transparent; pointer-events: none; top: 50%;
    transform: translateY(-50%); outline: none;
}
.sw-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: #000000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: all; cursor: pointer; transition: transform 0.15s;
}
.sw-range::-webkit-slider-thumb:hover { transform: scale(1.25); }
.sw-range::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #000000; border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: all; cursor: pointer;
}

/* Radio filters */
.sw-radio-list { display: flex; flex-direction: column; gap: 10px; }
.sw-radio-item {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 600; color: #334155; cursor: pointer;
    padding: 8px 10px; border-radius: 8px; transition: all 0.2s;
}
.sw-radio-item:hover { background: #f1f5f9; color: #000000; }
.sw-radio-item input[type="radio"] { accent-color: var(--sw-slider-color); width: 16px; height: 16px; }

/* Sort Select */
.sw-select {
    width: 100%; padding: 13px 16px;
    border: 1.5px solid var(--sw-border); border-radius: 10px;
    font-size: 14px; font-weight: 600; color: #0f172a; background: #ffffff;
    appearance: none; -webkit-appearance: none;
    cursor: pointer; outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23111' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 38px;
    transition: border-color 0.2s;
}
.sw-select:focus { border-color: #000000; }

/* Apply Button */
.sw-apply-btn {
    width: 100%; padding: 15px;
    background: #000000;
    color: #ffffff; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 800; cursor: pointer;
    transition: all var(--sw-transition);
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.sw-apply-btn:hover { background: #1e293b; box-shadow: 0 6px 16px rgba(0,0,0,0.2); }

/* ══ PRODUCT AREA ══ */
.shopwoo-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.sw-result-count { font-size: 14px; color: #475569; font-weight: 600; }
.sw-mobile-filter-toggle { display: none; }

/* ══ PRODUCT GRID ══ */
.shopwoo-grid {
    display: grid;
    grid-template-columns: repeat(var(--sw-pc-cols, 4), 1fr);
    gap: 24px;
}

/* ══ PRODUCT CARD (HIGH CONTRAST & BOLD TYPOGRAPHY) ══ */
.shopwoo-product-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius);
    border: 1.5px solid var(--sw-border);
    box-shadow: var(--sw-shadow);
    overflow: hidden;
    transition: transform var(--sw-transition), box-shadow var(--sw-transition), border-color var(--sw-transition);
    position: relative;
}
.shopwoo-product-card:hover {
    transform: translateY(-5px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 32px rgba(0,0,0,0.08);
}

/* Card Image Wrapper */
.shopwoo-card-img-wrap {
    display: block; position: relative; overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border-bottom: 1.5px solid var(--sw-border);
}

/* ══ GALLERY SLIDER ══ */
.sw-gallery-track {
    display: flex;
    width: 100%; height: 100%;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
.sw-gallery-slide {
    min-width: 100%; height: 100%;
    flex-shrink: 0;
}
.sw-gallery-slide img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Gallery Arrows */
.sw-gallery-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px;
    background: var(--sw-gallery-arrow-bg);
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 5;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
}
.sw-gallery-arrow svg { width: 16px; height: 16px; stroke: var(--sw-gallery-arrow-ico); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sw-gallery-arrow-prev { left: 10px; }
.sw-gallery-arrow-next { right: 10px; }
.sw-gallery-arrow:hover { transform: translateY(-50%) scale(1.12); }

.shopwoo-product-card:hover .sw-gallery-arrow,
.bz-product-card-wrap:hover .sw-gallery-arrow {
    opacity: 1;
    pointer-events: auto;
}

/* Gallery Dots */
.sw-gallery-dots {
    position: absolute; bottom: 10px;
    left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; z-index: 5;
}
.sw-gallery-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.sw-gallery-dot.active {
    background: var(--sw-gallery-dot-active);
    transform: scale(1.4);
    border-color: transparent;
}

/* Hover Actions (Buy Now / View) */
.shopwoo-hover-actions {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 6;
}
.shopwoo-product-card:hover .shopwoo-hover-actions {
    opacity: 1; pointer-events: auto;
}

/* Quick View Button */
.sw-quick-view-btn {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 12px 0;
    background: var(--sw-qv-accent);
    color: #ffffff;
    font-size: 13px; font-weight: 800;
    text-align: center; letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer; border: none;
    transform: translateY(101%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 8;
    width: 100%;
}
.shopwoo-product-card:hover .sw-quick-view-btn,
.bz-product-card-wrap:hover .sw-quick-view-btn {
    transform: translateY(0);
}

/* Badge */
.shopwoo-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--sw-badge-bg); color: var(--sw-badge-text);
    font-size: 11px; font-weight: 800;
    padding: 5px 12px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.5px;
    z-index: 8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.shopwoo-buynow-btn,
.shopwoo-view-btn {
    display: flex; align-items: center; justify-content: center;
    width: 85%; max-width: 170px; height: 44px;
    border-radius: 999px; font-size: 14px; font-weight: 800;
    text-align: center; cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid transparent;
}
.shopwoo-buynow-btn {
    background: var(--sw-buynow-bg);
    color: var(--sw-buynow-text);
}
.shopwoo-buynow-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.shopwoo-view-btn {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
}
.shopwoo-view-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Card Body — High Contrast & Bold Typography */
.shopwoo-card-body { padding: 18px 20px 22px; text-align: center; }
.shopwoo-product-title {
    margin: 0 0 10px; font-size: 16px; font-weight: 700;
    line-height: 1.35; letter-spacing: -0.2px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.shopwoo-product-title a { color: var(--sw-title-color); text-decoration: none; transition: color 0.2s; }
.shopwoo-product-title a:hover { color: #6c47ff; }

.shopwoo-product-price { font-size: 17px; font-weight: 800; color: var(--sw-price-color); }
.shopwoo-product-price del { font-size: 13px; color: #94a3b8; font-weight: 500; margin-right: 8px; }
.shopwoo-product-price ins { text-decoration: none; color: #e53e3e; }

/* ══ SKELETON LOADER ══ */
@keyframes sw-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.shopwoo-skeleton-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius);
    border: 1.5px solid var(--sw-border);
    overflow: hidden;
}
.sw-skel-img, .sw-skel-line {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 800px 100%;
    animation: sw-shimmer 1.4s infinite linear;
}
.sw-skel-img  { width: 100%; aspect-ratio: 1/1; }
.sw-skel-line { height: 16px; border-radius: 6px; margin: 14px auto; }
.sw-skel-title { width: 75%; }
.sw-skel-price { width: 45%; margin-top: 6px; }

/* ══ PAGINATION ══ */
.shopwoo-pagination {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 44px; flex-wrap: wrap;
}
.sw-page-btn {
    padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--sw-border);
    background: #ffffff; font-size: 14px; font-weight: 700; color: #0f172a;
    transition: all var(--sw-transition); cursor: pointer; text-decoration: none;
}
.sw-page-btn:hover { border-color: #000000; background: #f8fafc; }
.sw-page-btn.active {
    background: #000000; color: #ffffff; border-color: #000000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ══ QUICK VIEW MODAL ══ */
.sw-qv-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sw-qv-overlay.active { opacity: 1; pointer-events: auto; }

.sw-qv-modal {
    background: #ffffff; border-radius: 20px;
    width: 100%; max-width: 840px; max-height: 90vh;
    overflow-y: auto; position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 32px;
}
.sw-qv-overlay.active .sw-qv-modal { transform: scale(1); }

.sw-qv-close {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px; border-radius: 50%;
    background: #f1f5f9; border: none;
    font-size: 18px; font-weight: 700; color: #475569;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 10;
}
.sw-qv-close:hover { background: #000000; color: #ffffff; }

.sw-qv-modal-content { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.sw-qv-media img { width: 100%; border-radius: 14px; object-fit: cover; aspect-ratio: 1/1; border: 1px solid var(--sw-border); }
.sw-qv-details h2 { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0 0 12px; }
.sw-qv-price { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 16px; }
.sw-qv-desc { font-size: 14px; color: #475569; line-height: 1.6; margin-bottom: 20px; }

/* ══ RESPONSIVE ══ */
@media (max-width: 1024px) {
    .shopwoo-main-layout { grid-template-columns: 240px 1fr; gap: 20px; }
}
@media (max-width: 768px) {
    .shopwoo-main-layout { grid-template-columns: 1fr; }
    .shopwoo-sidebar { display: none; }
    .shopwoo-grid { grid-template-columns: repeat(var(--sw-mobile-cols, 2), 1fr); gap: 14px; }
    .shopwoo-product-title { font-size: 14px; }
    .shopwoo-product-price { font-size: 15px; }
    .sw-qv-modal-content { grid-template-columns: 1fr; }
}
