/* ===== LAYOUT ===== */
.wrapper{
  max-width:1100px;
  margin:auto;
  padding:16px;
}
.cart-layout{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:16px;
}
@media(max-width:768px){
  .cart-layout{
    grid-template-columns:1fr;
  }
}

h1{margin-bottom:16px}

/* ===== CART ITEM ===== */
.cart-item{
  display:flex;
  gap:12px;
  background:#fff;
  padding:12px;
  border-radius:10px;
  margin-bottom:12px;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.cart-item img{
  width:90px;
  height:90px;
  object-fit:cover;
  border-radius:8px;
}
.cart-info{flex:1}
.cart-info h3{margin:0 0 6px}
.price{color:#2563eb;font-weight:600}

/* ===== ACTION ROW ===== */
.action-row{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:8px;
  flex-wrap:wrap;
}
@media(min-width:768px){
  .action-row{flex-wrap:nowrap}
}

/* ===== QTY ===== */
.qty-box{
  display:flex;
  align-items:center;
  gap:6px;
}
.qty-box button{
  width:32px;height:32px;
  border:none;
  background:#2563eb;
  color:#fff;
  border-radius:6px;
  cursor:pointer;
}

/* ===== BUTTONS ===== */
.actions{
  display:flex;
  gap:8px;
}
.actions a,
.actions button{
  border:none;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
  display:flex;
  align-items:center;
  gap:6px;
}
.view{
  background:#e5e7eb;
  color:#111;
  text-decoration:none;
}
.remove{
  background:#ef4444;
  color:#fff;
}

/* ===== SUMMARY ===== */
.summary{
  background:#fff;
  padding:16px;
  border-radius:10px;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  height:fit-content;
}
.summary h3{margin-top:0}
.summary-row{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
}
.checkout{
  display:block;
  margin-top:12px;
  text-align:center;
  background:#16a34a;
  color:#fff;
  padding:12px;
  border-radius:8px;
  text-decoration:none;
  font-weight:600;
}

.empty{
  background:#fff;
  padding:40px;
  text-align:center;
  border-radius:10px;
  color:#6b7280;
}


















/* ================== RESET ================== */
*{
  box-sizing:border-box;
}
body{
  margin:0;
  font-family:system-ui, -apple-system, BlinkMacSystemFont;
}

/* ================== OVERLAY ================== */
.checkout-popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:9999;
  display:none;
  justify-content:center;
  align-items:flex-start;      /* 🔥 DESKTOP GAP FIX */
  padding-top:60px;
  animation:fadeIn .35s ease;
  
}

/* ================== MAIN BOX ================== */
.checkout-box{
  background:#f9fafb;
  width:90%;
  max-width:1100px;
  max-height:calc(100vh - 60px);
  overflow:auto;
  border-radius:14px;
  animation:slideUp .45s ease;
  display:grid;
  grid-template-columns:1.2fr 1fr;
  box-shadow:0 20px 40px rgba(0,0,0,.25);
}

/* ================== HEADER ================== */
.checkout-header{
  grid-column:1/-1;
  background:#fff;
  height:56px;
  padding:0 16px;
  display:flex;
  align-items:center;
  gap:14px;
  border-bottom:1px solid #e5e7eb;
  position:sticky;
  top:0;
  z-index:5;
}
.checkout-header h2{
  margin:0;
  font-size:18px;
  font-weight:600;
}
.checkout-header .close{
  font-size:26px;
  cursor:pointer;
  line-height:1;
}

/* ================== LEFT (PRODUCTS) ================== */
.checkout-left{
  padding:18px;
}
#checkoutProducts > div{
  background:#fff;
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
  display:flex;
  gap:10px;
  align-items:center;
  box-shadow:0 4px 12px rgba(0,0,0,.06);
}
#checkoutProducts img{
  width:60px;
  height:60px;
  object-fit:cover;
  border-radius:8px;
}

.total-box{
  margin-top:16px;
  background:#111827;
  color:#fff;
  padding:14px;
  border-radius:12px;
  font-size:17px;
  font-weight:600;
  text-align:center;
}

/* ================== RIGHT (FORM) ================== */
.checkout-right{
  padding:18px;
  background:#fff;
}
.checkout-right h3{
  margin:18px 0 10px;
  font-size:15px;
  font-weight:600;
}

/* ================== INPUTS ================== */
.checkout-right input,
.checkout-right textarea{
  width:100%;
  padding:12px;
  margin-bottom:10px;
  border:1px solid #d1d5db;
  border-radius:10px;
  font-size:14px;
  background:#fff;
}
.checkout-right textarea{
  resize:none;
  min-height:80px;
}
.checkout-right input:focus,
.checkout-right textarea:focus{
  outline:none;
  border-color:#16a34a;
  box-shadow:0 0 0 2px rgba(22,163,74,.15);
}

/* ================== PAYMENT OPTIONS ================== */
.payment-option{
  display:flex;
  gap:12px;
  align-items:center;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:14px;
  margin-bottom:12px;
  cursor:pointer;
  background:#fff;
  transition:.25s;
}
.payment-option i{
  font-size:22px;
  color:#16a34a;
}
.payment-option p{
  margin:2px 0 0;
  font-size:13px;
  color:#6b7280;
}
.payment-option input{
  display:none;
}
.payment-option:hover{
  border-color:#16a34a;
}
.payment-option.active{
  border-color:#16a34a;
  background:#ecfdf5;
  box-shadow:0 0 0 2px rgba(22,163,74,.15);
}

/* ================== DESKTOP PLACE ORDER ================== */
.desktop-order-btn{
  width:100%;
  margin-top:18px;
  background:#16a34a;
  color:#fff;
  border:none;
  padding:15px;
  border-radius:12px;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  transition:.25s;
}
.desktop-order-btn:hover{
  background:#15803d;
}

/* ================== MOBILE STICKY ================== */
.mobile-sticky-btn{
  display:none;
}

/* ================== MOBILE VIEW ================== */
@media(max-width:768px){

  .checkout-popup{
    padding-top:0;
    align-items:stretch;
    
  }

  .checkout-box{
    grid-template-columns:1fr;
    border-radius:0;
    max-height:100vh;
    width:100%;
  }

  .checkout-left{
    order:1;
  }

  .checkout-right{
    order:2;
    padding-bottom:100px;
  }

  .desktop-order-btn{
    display:none;
  }

  .mobile-sticky-btn{
    display:block;
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    background:#fff;
    padding:10px;
    box-shadow:0 -6px 18px rgba(0,0,0,.12);
    z-index:10;
  }

  .mobile-sticky-btn button{
    width:100%;
    background:#16a34a;
    color:#fff;
    border:none;
    padding:16px;
    border-radius:14px;
    font-size:17px;
    font-weight:600;
  }
}

/* ================== ANIMATIONS ================== */
@keyframes slideUp{
  from{transform:translateY(30px); opacity:0}
  to{transform:translateY(0); opacity:1}
}
@keyframes fadeIn{
  from{opacity:0}
  to{opacity:1}
}







/* ===== FORM ERROR ===== */
.form-error{
  border-color:#ef4444 !important;
  box-shadow:0 0 0 2px rgba(239,68,68,.2);
  animation:shake .25s ease;
}

.error-msg{
  background:#fee2e2;
  color:#991b1b;
  padding:10px 14px;
  border-radius:8px;
  margin-bottom:12px;
  font-size:14px;
  display:none;
}

@keyframes shake{
  0%{transform:translateX(0)}
  25%{transform:translateX(-3px)}
  50%{transform:translateX(3px)}
  75%{transform:translateX(-3px)}
  100%{transform:translateX(0)}
}

.checkout-btn{
  width:100%;
  padding:12px;
  background:#2563eb;
  color:#fff;
  border:none;
  border-radius:8px;
  font-size:16px;
  cursor:pointer;
}

/* ===== MOBILE CHECKOUT BAR ===== */
.mobile-checkout-bar{
  display:none;
}

/* MOBILE ONLY */
@media(max-width:768px){

  /* desktop summary hide */
  .summary{
    display:none !important;
  }

  /* bottom bar */
  .mobile-checkout-bar{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    height:64px;
    background:#fff;
    border-top:1px solid #e5e7eb;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 14px;
    z-index:9999;
  }

  .mobile-total{
    font-size:18px;
    font-weight:700;
  }

  .mobile-checkout-bar button{
    background:#2563eb;
    color:#fff;
    border:none;
    padding:10px 18px;
    font-size:15px;
    border-radius:8px;
    cursor:pointer;
  }

  /* page bottom space so content hide na ho */
  body{
    padding-bottom:70px;
  }
}
