@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap');

*{margin:0;padding:0;box-sizing:border-box;font-family:Poppins;}

body{
background:linear-gradient(120deg,#74ebd5,#9face6);
min-height:100vh;
color:#0b1d2a;
transition:.4s;
animation:fadePage .6s ease;
}

body.dark{
background:linear-gradient(120deg,#0f2027,#203a43,#2c5364);
color:white;
}

@keyframes fadePage{from{opacity:0}to{opacity:1}}

nav{
display:flex;justify-content:space-between;align-items:center;
padding:15px 50px;
background:rgba(255,255,255,0.25);
backdrop-filter:blur(12px);
position:sticky;top:0;z-index:10;
}

.logo{
font-size:30px;
font-weight:800;
color:#0066ff;
letter-spacing:1px;
}

nav input{
padding:8px 15px;border-radius:20px;border:none;width:220px;
outline:none;
}

nav a{color:inherit;text-decoration:none;margin:0 8px;font-weight:500;}

.cart-count{
background:#0066ff;color:white;padding:3px 8px;border-radius:50%;
font-size:12px;
}

.container{padding:60px;}

.hero{
display:grid;grid-template-columns:1.2fr 1fr;gap:40px;align-items:center;
}

.hero h1{font-size:48px;}
.hero span{color:#0066ff;}

.hero img{
width:100%;border-radius:20px;box-shadow:0 15px 40px rgba(0,0,0,.4);
}

.btn{
background:#0066ff;color:white;border:none;
padding:12px 28px;border-radius:30px;
cursor:pointer;font-weight:600;
transition:.3s ease;
}

.btn:hover{
transform:translateY(-3px) scale(1.05);
box-shadow:0 10px 25px rgba(0,0,0,.35);
}

.categories,.cards{
display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
gap:25px;margin-top:40px;
}

.cat,.card{
background:rgba(255,255,255,0.25);
border-radius:18px;overflow:hidden;
backdrop-filter:blur(10px);
transition:.4s ease;
}

.cat:hover,.card:hover{transform:translateY(-10px) scale(1.02);}

.cat img,.card img{
width:100%;height:180px;object-fit:cover;
}

.cat h3{text-align:center;padding:12px;}

.card .info{padding:12px;}
.price{color:#0066ff;font-weight:700;}
.rating{color:gold;}

ul{list-style:none;margin-top:20px;}

#cart-items li{
background:rgba(255,255,255,0.15);
margin:10px 0;padding:12px;border-radius:10px;
display:flex;justify-content:space-between;align-items:center;
animation:slideIn .4s ease;
}

@keyframes slideIn{
from{transform:translateX(40px);opacity:0;}
to{transform:translateX(0);opacity:1;}
}

.remove{
background:red;color:white;border:none;padding:5px 10px;border-radius:8px;
cursor:pointer;
}

/* ===== TOGGLE SWITCH (GLASS STYLE) ===== */
.theme-toggle{
width:60px;height:30px;
background:rgba(255,255,255,0.4);
border-radius:30px;
position:relative;cursor:pointer;
backdrop-filter:blur(10px);
box-shadow:0 0 15px rgba(255,255,255,.4);
transition:.4s;
}

.toggle-circle{
width:26px;height:26px;
background:white;border-radius:50%;
position:absolute;top:2px;left:2px;
display:flex;align-items:center;justify-content:center;
transition:.4s;font-size:14px;
}

body.dark .theme-toggle{
background:rgba(0,0,0,0.5);
box-shadow:0 0 15px rgba(0,0,0,.8);
}

body.dark .toggle-circle{left:32px;background:#111;color:white;}

/* ===== ADD TO CART OVERLAY ===== */
.card{position:relative;}

.card::after{
content:"Added ✓";
position:absolute;inset:0;
background:rgba(0,0,0,.7);
display:flex;align-items:center;justify-content:center;
font-size:22px;font-weight:600;
opacity:0;transform:translateX(100%);
transition:.4s;color:white;
}

.card.added::after{opacity:1;transform:translateX(0);}

/* ===== MODAL ===== */
.modal{
position:fixed;
top:0;left:0;
width:100%;height:100%;
background:rgba(0,0,0,0.6);
display:none;
justify-content:center;
align-items:center;
z-index:999;
}

.modal-box{
background:#fff;
color:#000;
padding:25px;
border-radius:15px;
width:300px;
text-align:center;
animation:fadePage .4s ease;
position:relative;
}

.close-btn{
position:absolute;
top:10px;right:15px;
font-size:22px;
cursor:pointer;
font-weight:700;
}

.modal-box select,
.modal-box input{
width:100%;
padding:10px;
margin-top:10px;
border-radius:8px;
border:1px solid #ccc;
}


/* ===== MOBILE ===== */
@media(max-width:850px){
.hero{grid-template-columns:1fr;}
.container{padding:30px;}
nav{flex-direction:column;gap:10px;}
}

.modal-box input:focus,
.modal-box select:focus{
  outline:none;
  border:2px solid #0066ff;
}

.gateway-container{
  min-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gateway-box{
  background: #ffffff;
  width: 380px;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  color: #222;
}

.gateway-header{
  text-align: center;
  margin-bottom: 15px;
}

.gateway-header h2{
  margin: 0;
  font-size: 22px;
}

.gateway-header p{
  font-size: 13px;
  opacity: 0.7;
}

.gateway-box label{
  font-size: 14px;
  margin-top: 10px;
  display: block;
}

.gateway-box select,
.gateway-box input{
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.pay-btn{
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #0d6efd;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.pay-btn:hover{
  background: #0b5ed7;
}

.error-text{
  color: red;
  font-size: 13px;
}

.success-text{
  color: green;
  text-align: center;
  margin-top: 10px;
}

.secure-note{
  text-align: center;
  font-size: 12px;
  margin-top: 12px;
  opacity: 0.7;
}

.loader{
  margin: 10px auto;
  border: 4px solid #eee;
  border-top: 4px solid #0d6efd;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin{
  100%{ transform: rotate(360deg); }
}

.checkout-wrapper{
  display:flex;
  gap:40px;
  margin-top:40px;
}

.checkout-left{
  flex:2;
}

.checkout-right{
  flex:1;
  background:#f9fafb;
  padding:20px;
  border-radius:12px;
  box-shadow:0 4px 15px rgba(0,0,0,.08);
}

.payment-box{
  background:#fff;
  padding:25px;
  border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.payment-box label{
  display:block;
  font-weight:600;
  margin-top:15px;
  margin-bottom:6px;
}

.payment-box input,
.payment-box select{
  width:100%;
  padding:12px;
  border-radius:8px;
  border:1px solid #ccc;
  font-size:15px;
}

.pay-btn{
  width:100%;
  margin-top:20px;
  padding:14px;
  border-radius:30px;
  border:none;
  background:#0a66ff;
  color:#fff;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
}

.pay-btn:hover{
  background:#004fd8;
}

.secure-note{
  margin-top:15px;
  font-size:13px;
  color:#666;
  text-align:center;
}

/* ============================= */
/* DARK MODE – CHECKOUT FIX */
/* ============================= */

body.dark .checkout-left,
body.dark .checkout-right {
  background: #121212;
  color: #e0e0e0;
  box-shadow: 0 18px 40px rgba(0,0,0,.6);
}

body.dark .checkout-left h2,
body.dark .checkout-right h3,
body.dark .payment-box label {
  color: #ffffff;
}

body.dark .payment-box select,
body.dark .payment-box input {
  background: #1e1e1e;
  color: #ffffff;
  border: 1px solid #333;
}

body.dark .payment-box select option {
  background: #1e1e1e;
  color: #ffffff;
}

body.dark #summaryItems p,
body.dark #summaryTotal {
  color: #dddddd;
}

body.dark .secure-note {
  color: #81c784;
}

body.dark .pay-error {
  color: #ef5350;
}

body.dark .pay-success {
  color: #66bb6a;
}

body.dark hr {
  border-color: #333;
}
