/* =========================
   SHOP PAGE
   Uses the SHARED design tokens from styles.css (--bg, --surface,
   --text, --text-light, --primary, --border, --radius, etc.) —
   this file used to declare its own :root with --text, --bg,
   --primary, --radius that OVERWROTE the shared ones (shop.css
   loads after styles.css, so its `:root` wins for this whole
   page). That's why dark mode never worked here: --text was
   pinned to #1a1a1a no matter what theme was active. Don't
   redeclare shared tokens here again — add new ones only if a
   name doesn't already exist in styles.css.
========================= */

body{
    background: var(--bg);
}

/* =========================
   HERO (SHOPIFY STYLE)
========================= */

#page-header{
    background:
        linear-gradient(120deg, rgba(0,0,0,.65), rgba(0,0,0,.25)),
        url("../images/banner/bn1.jfif");
    background-size: cover;
    background-position: center;
    height: 50vh;
    border-radius: 0 0 40px 40px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
}

#page-header h2{
    font-size: 44px;
    color: white;
    font-weight: 700;
    letter-spacing: -1px;
}

#page-header p{
    color: rgba(255,255,255,.85);
}

/* =========================
   PRODUCT GRID (SHOPIFY LAYOUT)
========================= */

#product1 .pro-container{
    display:grid;
    /* Keep empty tracks when search/filter results contain few items so
       a single product card stays the same width as the normal grid. */
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 28px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
}

/* =========================
   PRODUCT CARD (SHOPIFY STYLE)
========================= */

#product1 .pro{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow:hidden;
    position:relative;
    cursor:pointer;
    transition: transform .35s ease, box-shadow .35s ease;
    box-shadow: 0 18px 45px rgba(0,0,0,.08);
}

/* Same lift + teal glow ring used on the home page product cards */
#product1 .pro:hover{
    transform: translateY(-8px);
    box-shadow:
        0 28px 60px rgba(0,0,0,.14),
        0 0 0 1px rgba(8,129,120,.18);
}

.dark-mode #product1 .pro:hover{
    box-shadow:
        0 28px 60px rgba(0,0,0,.5),
        0 0 0 1px rgba(94,234,212,.18);
}

/* image */
#product1 .pro img{
    width:100%;
    height:260px;
    object-fit:cover;
    transition: .5s ease;
}

#product1 .pro:hover img{
    transform: scale(1.08);
}

/* text area */
#product1 .des{
    padding: 18px 18px 60px;
}

#product1 .des span{
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight:700;
    color: var(--text-light);
}

/* Product name — clamped to 2 lines with a fixed height so cards with
   short vs. long names still line up in the same grid row instead of
   the whole row shifting around. */
#product1 .des h5{
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0 6px;
    line-height: 1.4;
    min-height: calc(1.4em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#product1 .des h4{
    font-family: 'Space Mono', monospace;
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 8px;
}

/* stars */
#product1 .des i{
    color: #fbbf24;
    font-size: 12px;
}

/* =========================
   ADD TO CART BUTTON (SHOPIFY STYLE)
========================= */

#product1 .cart{
    position:absolute;
    bottom:16px;
    right:16px;
    width:54px;
    height:54px;
    border-radius:50%;
    background:#0e1414;
    display:flex;
    align-items:center;
    justify-content:center;
    border:none;
    box-shadow:0 12px 28px rgba(17,24,39,.28);
    transition: transform .3s ease, background .3s ease, box-shadow .3s ease;
}

#product1 .cart i{
    color:#fff;
    font-size:16px;
    transition:.3s;
}

/* hover effect — same teal pop used on the home page cards */
#product1 .cart:hover{
    background: var(--primary);
    transform: scale(1.08);
}

/* Fixed dark-ink background regardless of theme (same fix as the home
   page cards): don't tie this to --text, which flips to white in dark
   mode and would make a white icon disappear on a white circle. */
.dark-mode #product1 .cart{
    background:#1f2937;
    box-shadow:0 12px 28px rgba(0,0,0,.5);
}

.dark-mode #product1 .cart:hover{
    background: var(--primary);
}

/* =========================
   PAGINATION (SHOPIFY CLEAN)
========================= */

#pagination{
    text-align:center;
    margin: 50px 0;
}

#pagination a{
    display:inline-block;
    padding:10px 16px;
    margin:0 5px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:12px;
    color:var(--text);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition:.3s;
    cursor:pointer;
}

#pagination a:hover,
#pagination a.active{
    background: var(--primary);
    border-color: var(--primary);
    color:#fff;
}

.badge{
    position:absolute;
    top:15px;
    left:15px;
    background:#088178;
    color:white;
    padding:5px 10px;
    border-radius:20px;
    font-size:12px;
}

/* =========================
   MOBILE OPTIMIZATION
========================= */

@media (max-width:768px){

    #page-header h2{
        font-size: 32px;
    }

    #product1 .pro-container{
        gap: 18px;
        padding: 25px 12px;
    }

    #product1 .pro img{
        height: 220px;
    }
}

/* Toast notifications now use the shared #toast-stack / .toast system
   defined in styles.css (same one every other page uses) instead of a
   page-local #toast element. See shop.js — the local showToast() that
   used to shadow the shared one has been removed. */

/* =========================
   CART BUTTON CLICK ANIMATION
========================= */

#product1 .cart.clicked{
    background: var(--primary);
    transform: scale(0.9);
}

#product1 .cart.clicked i{
    color:white;
}

@keyframes popProduct{
    0%{
        transform:scale(1);
    }

    50%{
        transform:scale(1.03);
    }

    100%{
        transform:scale(1);
    }
}

#product1 .pro.added{
    animation:popProduct .35s ease;
}

@keyframes badgeBounce{
    0%{
        transform:scale(1);
    }

    50%{
        transform:scale(1.4);
    }

    100%{
        transform:scale(1);
    }
}

#cart-count.bounce{
    animation:badgeBounce .35s ease;
}

/* =========================
   SHOPIFY CART DRAWER
========================= */

#drawer-overlay{

    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);

    opacity:0;
    visibility:hidden;

    transition:.3s;

    z-index:999;

}

#drawer-overlay.active{

    opacity:1;
    visibility:visible;

}

#cart-drawer{
    position:fixed;
    top:0;
    right:-420px;
    width:400px;
    max-width:100%;
    height:100vh;
    background:var(--surface);
    color:var(--text);
    box-shadow:-8px 0 25px rgba(0,0,0,.15);
    transition:.35s ease;
    z-index:1000;
    display:flex;
    flex-direction:column;
}

#cart-drawer.active{
    right:0;
}

.drawer-header{
    padding:20px;
    border-bottom:1px solid var(--border);
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.drawer-header h3{
    margin:0;
    color:var(--text);
}

#close-drawer{
    background:none;
    border:none;
    color:var(--text);
    font-size:22px;
    cursor:pointer;
}

#drawer-items{
    flex:1;
    overflow:auto;
    padding:20px;
}

.drawer-item{
    display:flex;
    gap:15px;
    margin-bottom:20px;
}

.drawer-item img{
    width:70px;
    height:70px;
    object-fit:cover;
    border-radius:10px;
}

.drawer-footer{
    border-top:1px solid var(--border);
    padding:20px;
}

#view-cart-btn{
    width:100%;
    padding:14px;
    border:none;
    background:#088178;
    color:white;

    border-radius:10px;

    cursor:pointer;

    font-weight:bold;

}

.drawer-info{

    flex:1;

}

.drawer-info h4{

    margin:0 0 5px;

    font-size:15px;

}

.drawer-info p{

    color:#088178;

    font-weight:bold;

    margin-bottom:10px;

}

.drawer-controls{

    display:flex;

    align-items:center;

    gap:10px;

}

.drawer-controls button{

    border:none;

    cursor:pointer;

    border-radius:8px;

    padding:6px 10px;

    background:var(--surface-2);
    color:var(--text);

    transition:.25s;

}

.drawer-controls button:hover{

    background:#088178;

    color:white;

}

.drawer-controls span{

    min-width:20px;

    text-align:center;

    font-weight:bold;

}

.drawer-controls .remove{

    margin-left:auto;

    background:#ffeaea;

    color:#e53935;

}

.drawer-controls .remove:hover{

    background:#e53935;

    color:white;

}

/* =========================
   SHOP TOOLS
========================= */

#shop-tools{

    max-width:1200px;

    margin:40px auto 0;

    padding:0 20px;

}

.search-box{
    background:var(--surface);
    display:flex;
    align-items:center;
    gap:12px;
    padding:15px 20px;
    border-radius:14px;
    border:1px solid var(--border);
    box-shadow:0 6px 20px rgba(0,0,0,.06);
    transition:.25s;
}

.search-box:focus-within{
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(8,129,120,.14);
}

.search-box input{
    width:100%;
    border:none;
    outline:none;
    font-size:16px;
    background:transparent;
    color:var(--text);
}

.search-box i{
    color:var(--primary);
}

.stock{
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-top:8px;
    padding:4px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.stock::before{
    content:"";
    width:6px;
    height:6px;
    border-radius:50%;
    background:currentColor;
}

.in-stock{
    color:#0f8a3f;
    background:#e5f7ec;
}

.out-stock{
    color:#d1372f;
    background:#fdeceb;
}

.dark-mode .in-stock{
    color:#4ade80;
    background:rgba(74,222,128,.12);
}

.dark-mode .out-stock{
    color:#f87171;
    background:rgba(248,113,113,.12);
}

/* Was previously declared twice with conflicting values (the second
   copy silently won) — merged into one rule. */
.cart.disabled{
    background:#d1d5db;
    cursor:not-allowed;
    pointer-events:none;
}

.cart.disabled i{
    color:#6b7280;
}

.cart.disabled:hover{
    transform:none;
    background:#d1d5db;
}

.cart.disabled:hover i{
    color:#6b7280;
}

/* =========================
   FILTER BAR
========================= */

.filter-bar{
    display:flex;
    gap:16px;
    margin-top:20px;
    flex-wrap:wrap;
}

.filter-bar select{
    padding:12px 16px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--surface);
    font-size:14px;
    font-weight:600;
    color:var(--text);
    cursor:pointer;
    min-width:180px;
    box-shadow:0 4px 12px rgba(0,0,0,.04);
    transition:.2s;
}

.filter-bar select:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(8,129,120,.14);
}
