
/* ===============================
   RESET
================================ */
*{box-sizing:border-box}
html,body{
  margin:0;
  background:#f6f8f7;
  font-family:Inter', 'Avenir Next', Arial, sans-serif ;
  font-size: 16px;
}

/* ===============================
   VARIABLES
================================ */
:root{
  --primary:#0f5132;
  --primary-dark:#0b3c27;
  --border:#dbe3de;
  --bg:#fff;
  --muted:#6b7280
}

/* ===============================
   LAYOUT
================================ */
.checkout-container{
  max-width:1080px;
  margin:auto;
  padding:20px 14px
}
.checkout-wrapper{
  display:grid;
  grid-template-columns: 1.15fr 1fr;
  gap:22px
}
@media(max-width:900px){
  .checkout-wrapper{grid-template-columns:1fr}
}
.checkout-title{
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 24px;
}


/* ================= LEFT STEPS ================= */
.checkout-step{
background:#fff;
border:1px solid #dbe3de;
border-radius:14px;
padding:22px;
position:relative;
margin-bottom:20px;
transition:all .15s ease;
}

/* ACTIVE */
.checkout-step.active{
  border-color:#0f5132;
  margin-bottom:24px;
}

/* COLLAPSED */
.checkout-step.collapsed > :not(.step-header) {
  display: none;
  padding:16px 20px
}

/* show header properly */
.checkout-step.collapsed .step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* show edit button */
.checkout-step.collapsed .edit-step {
  display: inline-block;
}


/* HEADER */
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* TITLE */
.step-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* EDIT BUTTON – PERFECT */
.edit-step{
  background: none !important;
  border: none !important;
  padding: 0 !important;
  width: auto !important;

  color: #0f5132;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;

  text-decoration: none;
  position: relative;
  z-index: 5;               /* 🔥 parent hover se upar */
}


.edit-step:hover{
  background: none !important;
  text-decoration: underline;
}

#pickup_location {
  width: 100%;
  padding: 14px 16px;     /* thoda taller */
  border-radius: 12px;
  border: 1.5px solid #dbe3de;
  font-size: 1rem;
  margin-bottom: 18px;   /* 🔥 select & button ke beech gap */
}
.product-frequency {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #dbe3de;
  background: #eef3f1;
  cursor: pointer;
}

/* DELIVERY DAY */
.day-pill{
display:inline-block;
background:#e6f4ea;
color:#1b5e20;
padding:8px 16px;
border-radius:25px;
font-weight:600;
font-size:14px;
border:1px solid #2f6b4f;
}

/* FREQUENCY */
#deliveryFrequency{
display:flex;
gap:12px;
width:100%;
margin-bottom:20px;
flex-wrap:wrap;
}

/* frequency pills */
.freq-btn{
flex:1;
padding:10px 14px;
border-radius:999px;
border:1.5px solid #cfd8d3;
background:#fff;
cursor:pointer;

font-size:0.85rem;
font-weight:500;
color:#111827;

text-align:center;
transition:all .15s ease;
}

.freq-btn:hover{
border-color:#0f5132;
color:#0f5132;
}

/* active */
.freq-btn.active{
  background: #0f5132;
  color: #ffffff;
  border-color: #0f5132;
}




.step-btn{
width:100%;
padding:14px;
border-radius:10px;
border:2px solid #2f6b4f;
background:#fff;
color:#2f6b4f;
font-weight:600;
cursor:pointer;
}
.step-btn:hover{
background:#2f6b4f;
color:white;
}



.step-btn.disabled {
  background: #ffffff;                 /* white */
  color: #0f5132;                      /* green text */
  border: 2px solid #0f5132;           /* green outline */
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}
.step-btn:not(.disabled) {
  background: #0f5132;                 /* green */
  color: rgb(255, 255, 255);           /* 🔥 white text */
  border: 2px solid #0f5132;
  cursor: pointer;
  opacity: 1;
}
.step-btn:not(.disabled):hover {
  background: #0b3c27;                 /* darker green */
}



/* ===============================
   PAYMENT INFO
================================ */
.payment-info-box {
  background: #f3f6f4;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
}
/* ===============================
   STEP 3 – PAYMENT SPACING
================================ */

/* payment section overall */
#step-3 {
  padding-bottom: 24px;
}

/* radio options container */
.payment-options {
  margin-top: 12px;
  margin-bottom: 22px;   /* 🔥 radios & button ke beech gap */
  display: flex;
  flex-direction: column;
  gap: 12px;             /* 🔥 COD & Online ke beech gap */
}

/* individual option */
.payment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

/* place order button spacing */
#placeOrderBtn {
  margin-top: 10px;      /* 🔥 clean separation */
}


/* ===============================
   RIGHT SIDE – CART
================================ */
.order-summary-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  width:550px;
}

.order-summary-section h2 {
  font-size: 1.25rem;
  margin: 0;
}

.edit-cart-btn {
  font-size: 0.85rem;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
}

.edit-cart-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ===============================
   CART ITEMS
================================ */
.cart-item {
  display: flex;
  gap: 12px;
  margin: 14px 0;
  align-items: center;
}

.cart-item img {
  width: 48px;
  border-radius: 8px;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.item-frequency.readonly {
  font-size: 0.8rem;
  background: #eef3f1;
  padding: 5px 10px;
  border-radius: 8px;
  margin-top: 4px;
}
.item-frequency-label{
font-size:13px;
color:#6b7280;
margin-right:8px;
}
.item-frequency{
display:inline-flex;
align-items:center;
gap:6px;
margin-top:2px;
}
/* container of label + select */
.item-middle{
display:flex;
flex-direction:column;
}

/* label + dropdown in same row */
.item-frequency-row{
display:flex;
align-items:center;
gap:8px;
margin-top:4px;
}

.item-right {
  margin-left: auto;
  font-weight: 600;
}

/* ===============================
   COUPON SECTION
================================ */
.coupon-box {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.coupon-box input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.coupon-box button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.coupon-box button:hover {
  background: var(--primary);
  color: #fff;
}

.coupon-box.applied input {
  background: #eef3f1;
  pointer-events: none;
}

.coupon-box.applied button {
  opacity: 0.5;
  pointer-events: none;
}

/* REMOVE COUPON */
.remove-coupon {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--danger);
  cursor: pointer;
}

.remove-coupon:hover {
  text-decoration: underline;
}

/* ===============================
   TOTALS / DISCOUNT
================================ */
.order-summary-section hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin: 6px 0;
}

.summary-row.discount {
  color: var(--success);
}

.summary-row.total {
  font-weight: 700;
  font-size: 1.05rem;
}

/* ===============================
   FIRST DELIVERY
================================ */
.first-delivery {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
@media (max-width: 900px) {
  .order-summary-section {
    width: 100%;
  }
}
@media (max-width: 600px) {

  .checkout-container {
    padding: 14px 10px;
  }

  .checkout-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }

  .checkout-step {
    padding: 16px;
  }

  .step-header h3 {
    font-size: 1rem;
  }
}
@media (max-width: 600px) {
  #deliveryFrequency {
    flex-wrap: wrap;
  }

  .freq-btn {
    flex: 0 0 48%;
    font-size: 0.8rem;
    padding: 9px 10px;
  }
}
@media (max-width: 600px) {
  .cart-item {
    align-items: flex-start;
  }

  .item-right {
    margin-left: 0;
    margin-top: 6px;
  }
}
@media (max-width: 500px) {
  .coupon-box {
    flex-direction: column;
  }

  .coupon-box button {
    width: 100%;
  }
}
@media (min-width: 901px) {
  .order-summary-section {
    position: sticky;
    top: 20px;
  }
}
/* ===============================
   🔥 TRUE MOBILE OPTIMIZATION
================================ */

@media (max-width: 600px) {

  /* PAGE */
  .checkout-container {
    padding: 12px 8px;
  }

  .checkout-title {
    font-size: 1.45rem;
    margin-bottom: 14px;
  }

  /* GRID → SINGLE COLUMN */
  .checkout-wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* STEPS CARD */
  .checkout-step {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .step-header h3 {
    font-size: 0.95rem;
  }

  /* SELECT */
  #pickup_location {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  /* DELIVERY FREQUENCY → 2x2 GRID */
  #deliveryFrequency {
    flex-wrap: wrap;
    gap: 8px;
  }

  .freq-btn {
    flex: 0 0 48%;
    font-size: 0.78rem;
    padding: 8px 6px;
  }

  /* ================= CART ================= */

  .order-summary-section {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
  }

  /* Cart header */
  .order-summary-section > div:first-child {
    align-items: center;
  }

  .order-summary-section h2 {
    font-size: 1.05rem;
  }

  .edit-cart-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  /* CART ITEM STACK */
  .cart-item {
    gap: 10px;
    margin: 12px 0;
  }

  .cart-item img {
    width: 42px;
  }

  .item-name {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .item-frequency.readonly {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .item-right {
    font-size: 0.85rem;
  }

  /* COUPON */
  .coupon-box {
    flex-direction: column;
    gap: 8px;
  }

  .coupon-box input {
    font-size: 0.9rem;
    padding: 10px;
  }

  .coupon-box button {
    width: 100%;
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 8px;
  }

  /* TOTAL */
  .summary-row {
    font-size: 0.9rem;
  }

  .summary-row.total {
    font-size: 1rem;
  }

  .first-delivery {
    font-size: 0.75rem;
  }
}

#delivery_address{
flex:1;
padding:14px;
border-radius:10px;
border:1px solid #dbe3de;
appearance:none;
background:white;
}

#apt_number{
width:120px;
padding:14px;
border-radius:10px;
border:1px solid #dbe3de;
}
.login-warning{
margin-top:14px;
font-size:0.9rem;
color:#374151;
}

.login-warning a{
color:#0f5132;
font-weight:600;
text-decoration:none;
}

.login-warning a:hover{
text-decoration:underline;
}
/* =========================================
   UNIVERSAL RESPONSIVE SYSTEM
========================================= */

/* ===== LARGE DESKTOP ===== */
@media (min-width:1200px){

.checkout-container{
max-width:1150px;
}

.checkout-wrapper{
gap:26px;
}

}

/* ===== LAPTOP ===== */
@media (max-width:1100px){

.checkout-container{
padding:18px 14px;
}

.order-summary-section{
width:100%;
}

}

/* ===== TABLET ===== */
@media (max-width:900px){

.checkout-wrapper{
grid-template-columns:1fr;
gap:18px;
}

.order-summary-section{
position:relative;
top:0;
}

.cart-item{
align-items:center;
}

}

/* ===== SMALL TABLET ===== */
@media (max-width:768px){

.checkout-title{
font-size:1.6rem;
}

.checkout-step{
padding:18px;
}

.step-header h3{
font-size:1rem;
}

#pickup_location{
font-size:0.95rem;
}

}

/* ===== MOBILE ===== */
@media (max-width:600px){

.checkout-container{
padding:12px 10px;
}

.checkout-title{
font-size:1.45rem;
margin-bottom:16px;
}

.checkout-step{
padding:14px;
border-radius:12px;
}

.step-header h3{
font-size:0.95rem;
}

/* ADDRESS ROW STACK */
.address-row{
flex-direction:column;
}

#apt_number{
width:100%;
}

/* DELIVERY FREQUENCY GRID */
#deliveryFrequency{
flex-wrap:wrap;
gap:8px;
}

.freq-btn{
flex:0 0 48%;
font-size:0.78rem;
padding:8px 6px;
}


/* CART */
.order-summary-section{
padding:14px;
border-radius:14px;
}

.cart-item{
align-items:flex-start;
}

.item-name{
font-size:0.85rem;
}

.item-right{
margin-top:6px;
font-size:0.85rem;
}

/* COUPON */
.coupon-box{
flex-direction:column;
gap:8px;
}

.coupon-box button{
width:100%;
}

/* TOTAL */
.summary-row{
font-size:0.9rem;
}

.summary-row.total{
font-size:1rem;
}

}

/* ===== SMALL MOBILE ===== */
@media (max-width:480px){

.checkout-title{
font-size:1.3rem;
}

.step-header h3{
font-size:0.9rem;
}

.freq-btn{
flex:0 0 100%;
font-size:0.75rem;
}

.cart-item img{
width:40px;
}

.item-name{
font-size:0.82rem;
}

}

/* ===== EXTRA SMALL DEVICES ===== */
@media (max-width:360px){

.checkout-container{
padding:10px 6px;
}

.freq-btn{
font-size:0.72rem;
padding:7px;
}

}
.stock-warning{
color:#c0392b;
font-size:13px;
margin-top:4px;
font-weight:500;
}

.item-qty{
font-weight:500;
color:#666;
margin-left:4px;
}

.delivery-summary strong{
display:block;
font-size:13px;
color:#6b7280;
margin-top:4px;
}

.delivery-summary p{
margin:4px 0 10px;
font-weight:500;
color:#111827;
}

.delivery-summary a{
font-size:13px;
color:#2563eb;
text-decoration:none;
}
.delivery-summary{
width:100%;
background:#f9fbfa;
padding:18px;
border-radius:10px;
border:1px solid #e5e7eb;
}
.delivery-badge{
display:inline-block;
background:#e6f4ea;
color:#0f5132;
padding:6px 14px;
border-radius:20px;
font-size:13px;
font-weight:600;
border:1px solid #0f5132;
margin-bottom:6px;
}
#deliveryDaysContainer{
margin-bottom:22px;
}
.step-content h4{
margin-top:18px;
margin-bottom:10px;
font-size:15px;
font-weight:600;
color:#374151;
}
.address-row{
display:flex;
align-items:flex-start;
gap:20px;
}