/* ===============================
   RESET & BASE
================================ */
*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui;
}

body{
background:radial-gradient(circle at top,#111827,#020617);
color:#f9fafb;
}

.container{
max-width:1200px;
margin:auto;
padding:0 20px;
}

/* ===============================
   HEADER
================================ */
.header{
position:sticky;
top:0;
background:rgba(2,6,23,.95);
backdrop-filter:blur(10px);
border-bottom:1px solid rgba(255,255,255,.05);
z-index:100;
}

.nav{
display:flex;
justify-content:space-between;
align-items:center;
padding:15px 0;
}

.logo{
font-weight:600;
font-size:18px;
letter-spacing:.5px;
}

nav a{
margin-left:25px;
text-decoration:none;
color:#9ca3af;
transition:.3s;
}

nav a:hover,
nav a.active{
color:#facc6b;
}

/* ===============================
   HERO
================================ */
.hero{
text-align:center;
padding:60px 20px;
}

.hero h1{
font-size:38px;
background:linear-gradient(90deg,#facc6b,#fff,#facc6b);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
margin-bottom:20px;
}

.hero input{
padding:12px 20px;
border-radius:50px;
border:1px solid rgba(255,255,255,.1);
background:#0f172a;
color:white;
width:300px;
outline:none;
}

/* ===============================
   CATEGORIES
================================ */
.categories{
margin:40px auto;
display:flex;
gap:15px;
flex-wrap:wrap;
}

.cat-btn{
padding:8px 18px;
border-radius:40px;
border:1px solid rgba(250,204,107,.3);
color:#facc6b;
text-decoration:none;
transition:.3s;
}

.cat-btn:hover,
.cat-btn.active{
background:linear-gradient(135deg,#facc6b,#d29a63);
color:black;
}

/* ===============================
   PRODUCTS GRID
================================ */
.products{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
gap:25px;
margin-bottom:100px;
margin-top:40px;
}

@media(max-width:768px){
.products{
grid-template-columns:repeat(2,1fr);
gap:15px;
}
.hero h1{font-size:26px;}
.hero input{width:100%;}
}

/* ===============================
   PRODUCT CARD
================================ */
.product-card{
background:linear-gradient(145deg,#0f172a,#020617);
border-radius:18px;
padding:18px;
border:1px solid rgba(255,255,255,.05);
cursor:pointer;
transition:.3s;
position:relative;
display:flex;
flex-direction:column;
}

.product-card:hover{
transform:translateY(-8px);
box-shadow:0 25px 50px rgba(0,0,0,.7);
}

.product-card img{
width:100%;
border-radius:14px;
aspect-ratio:1/1;
object-fit:cover;
margin-bottom:12px;
}

.product-card h3{
font-size:16px;
margin-bottom:10px;
flex-grow:1;
}

.price .old{
text-decoration:line-through;
color:#9ca3af;
font-size:14px;
display:block;
}

.price .new{
font-size:20px;
font-weight:700;
color:#facc6b;
}

.add-btn{
width:100%;
padding:10px;
border:none;
border-radius:50px;
background:linear-gradient(135deg,#facc6b,#d29a63);
color:black;
cursor:pointer;
transition:.3s;
margin-top:15px;
}

.add-btn:hover{
transform:scale(1.05);
}

.promo-badge{
position:absolute;
top:10px;
left:10px;
background:linear-gradient(135deg,#ef4444,#b91c1c);
color:#fff;
padding:5px 10px;
font-size:12px;
border-radius:20px;
font-weight:600;
}

/* ===============================
   CART BUTTON
================================ */
.cart-button{
position:fixed;
bottom:30px;
right:30px;
background:#0f172a;
padding:15px 25px;
border-radius:50px;
border:1px solid rgba(250,204,107,.3);
cursor:pointer;
box-shadow:0 15px 40px rgba(0,0,0,.7);
z-index:1000;
}

.cart-button span{
background:#facc6b;
color:black;
padding:3px 8px;
border-radius:20px;
margin-left:6px;
}

/* ===============================
   CART PANEL
================================ */
.cart-panel{
position:fixed;
top:0;
right:-400px;
width:350px;
height:100%;
background:#020617;
padding:25px;
transition:.4s;
border-left:1px solid rgba(255,255,255,.05);
z-index:1100;
overflow-y:auto;
}

.cart-panel.open{
right:0;
}

.cart-total{
margin-top:20px;
font-weight:600;
}

.checkout-btn{
width:100%;
padding:12px;
margin-top:15px;
border:none;
border-radius:40px;
background:linear-gradient(135deg,#facc6b,#d29a63);
color:#000;
font-weight:600;
cursor:pointer;
transition:.3s;
}

.overlay{
position:fixed;
inset:0;
background:rgba(0,0,0,.7);
opacity:0;
pointer-events:none;
transition:.3s;
z-index:1050;
}

.overlay.active{
opacity:1;
pointer-events:auto;
}
if(e.target.classList.contains("qty-plus")){
let cart = getCart();
cart[e.target.dataset.index].qty++;
saveCart(cart);
renderCart();
}

if(e.target.classList.contains("qty-minus")){
let cart = getCart();
let i = e.target.dataset.index;
if(cart[i].qty > 1){
cart[i].qty--;
}else{
cart.splice(i,1);
}
saveCart(cart);
renderCart();
}