/* ===== OK MART - CHECKOUT PAGE STYLES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --primary-light: #e8f8ef;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1a1e2b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --radius: 16px;
  --transition: all .2s;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container { max-width: 480px; margin: 0 auto; position: relative; min-height: 100vh; }

/* ===== HEADER ===== */
.checkout-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; }
.back-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.3rem; font-weight: 600; color: var(--text);
}
.back-btn:active { background: var(--border); transform: scale(.92); }
.header-title { font-size: 1.2rem; font-weight: 700; flex: 1; }
.step-indicator {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 4px 12px; border-radius: 20px; font-size: .75rem; font-weight: 600;
}

/* ===== MAIN ===== */
.checkout-main { padding: 0 14px 100px; }

/* ===== SECTION CARD ===== */
.section-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin: 12px 0;
}
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-card h2 { font-size: 1rem; font-weight: 700; }
.edit-toggle-btn {
  background: var(--primary-light); color: var(--primary-dark);
  border: 1.5px solid var(--primary); padding: 6px 14px;
  border-radius: 30px; font-weight: 600; font-size: .75rem; cursor: pointer;
  transition: var(--transition);
}
.edit-toggle-btn:active { background: var(--primary); color: white; }

/* ===== DETAILS DISPLAY ===== */
.details-display { display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; align-items: center; gap: 10px; }
.detail-icon { font-size: 1.2rem; width: 24px; }
.detail-value { font-weight: 500; }

/* ===== DETAILS EDIT ===== */
.details-edit { animation: slideDown .3s ease; }
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 500px; } }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 14px; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 12px; font-size: .9rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 60px; }
.save-details-btn {
  width: 100%; padding: 14px; background: var(--primary); color: white;
  border: none; border-radius: 12px; font-weight: 700; cursor: pointer;
}
.save-details-btn:active { background: var(--primary-dark); }

/* ===== ORDER ITEMS ===== */
.order-items-list { margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.order-item-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.order-item-row:last-child { border-bottom: none; }
.order-item-image {
  width: 45px; height: 45px; border-radius: 10px; object-fit: cover; background: #f1f5f9;
}
.order-item-info { flex: 1; }
.order-item-name { font-weight: 600; font-size: .85rem; }
.order-item-qty { font-size: .7rem; color: var(--muted); }
.order-item-price { font-weight: 700; font-size: .85rem; }

/* ===== PRICE BREAKDOWN ===== */
.price-breakdown { display: flex; flex-direction: column; gap: 6px; }
.price-row { display: flex; justify-content: space-between; font-size: .9rem; }
.price-row.total-row {
  font-weight: 700; font-size: 1.1rem; border-top: 1px dashed var(--border);
  margin-top: 8px; padding-top: 12px;
}
.delivery-estimate {
  margin-top: 12px; padding: 10px; background: var(--bg);
  border-radius: 10px; font-size: .85rem; text-align: center;
}

/* ===== COUPON CARD ===== */
.coupon-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coupon-code-label { font-weight: 700; color: var(--primary-dark); }
.coupon-savings { color: #10b981; font-weight: 600; }

/* ===== UPSELL SLIDER ===== */
.upsell-slider {
  display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none;
  padding: 4px 0; -ms-overflow-style: none; scroll-snap-type: x mandatory;
}
.upsell-slider::-webkit-scrollbar { display: none; }

.mini-product-card {
  background: var(--card); border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  flex: 0 0 140px; scroll-snap-align: start;
  cursor: pointer; transition: var(--transition); position: relative;
}
.mini-product-card:active { transform: scale(.97); }
.mini-product-image {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 10px; margin-bottom: 8px; background: #f1f5f9;
}
.mini-product-name { font-weight: 700; font-size: .8rem; line-height: 1.3; margin-bottom: 4px; }
.mini-product-price { font-weight: 700; color: var(--primary-dark); font-size: .85rem; margin-bottom: 6px; }
.mini-add-btn {
  width: 100%; padding: 8px; background: var(--primary-light);
  border: 1.5px solid var(--primary); border-radius: 20px;
  color: var(--primary-dark); font-weight: 700; font-size: .7rem;
  text-transform: uppercase; cursor: pointer; transition: var(--transition);
}
.mini-add-btn:active { background: var(--primary); color: white; }

.loading-skeleton { display: flex; gap: 12px; }
.skeleton-card {
  width: 140px; height: 180px;
  background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--radius); flex-shrink: 0;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ===== STICKY ORDER BAR ===== */
.sticky-order-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--card);
  padding: 14px 16px; box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  z-index: 95; border-top: 1px solid var(--border);
}
.order-bar-inner { display: flex; align-items: center; justify-content: space-between; }
.total-label { font-size: .7rem; color: var(--muted); display: block; }
.total-value { font-weight: 800; font-size: 1.3rem; color: var(--text); }
.place-order-btn {
  background: var(--primary); color: white; padding: 14px 24px;
  border: none; border-radius: 40px; font-weight: 700;
  font-size: .95rem; cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 12px rgba(46,204,113,.25);
}
.place-order-btn:active { background: var(--primary-dark); transform: scale(.96); }
.place-order-btn:disabled { opacity: .6; cursor: not-allowed; }
.loading-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: white;
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-message {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(100px);
  padding: 12px 24px; border-radius: 40px; font-weight: 500; z-index: 999;
  opacity: 0; transition: all .3s; white-space: nowrap; pointer-events: none;
}
.toast-message.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (min-width: 500px) {
  .app-container { max-width: 500px; }
}
