/* ===== OK MART - CART 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; --danger: #ef4444;
  --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 ease;
}

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

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

/* ===== HEADER ===== */
.cart-page-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; }
.cart-count-badge {
  background: var(--primary); color: white; padding: 4px 12px;
  border-radius: 20px; font-size: .8rem; font-weight: 600;
}

/* ===== MAIN ===== */
.cart-main { padding: 0 14px 20px; }

/* ===== CART ITEMS ===== */
.cart-items-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }

.cart-item {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; gap: 12px; align-items: center;
  animation: fadeInUp .3s ease;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.cart-item-image {
  width: 70px; height: 70px; border-radius: 12px; object-fit: cover;
  background: #f1f5f9; flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name {
  font-weight: 700; font-size: .9rem; margin-bottom: 2px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.free-badge {
  background: #d1fae5; color: #065f46; padding: 2px 8px;
  border-radius: 20px; font-size: .6rem; font-weight: 600;
}
.cart-item-unit { font-size: .7rem; color: var(--muted); display: block; margin-bottom: 6px; }
.cart-item-price { font-weight: 700; color: var(--primary-dark); font-size: .9rem; }

.cart-item-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }

/* Quantity Controls */
.qty-control { display: flex; align-items: center; gap: 4px; background: var(--bg); padding: 3px; border-radius: 30px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%; background: white;
  border: 1.5px solid var(--border); font-size: 1.1rem; font-weight: 600;
  color: var(--primary); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: var(--transition);
}
.qty-btn:active { background: var(--primary); color: white; }
.qty-num { min-width: 24px; text-align: center; font-weight: 700; font-size: .9rem; }

.remove-btn {
  background: none; border: none; color: var(--danger); font-size: 1.2rem;
  cursor: pointer; padding: 4px; margin-left: auto;
}
.remove-btn:active { transform: scale(.9); }

.free-item-note { font-size: .7rem; color: #10b981; margin-top: 4px; }

.item-total-price { font-weight: 700; font-size: 1rem; color: var(--text); align-self: flex-end; }

/* ===== EMPTY CART ===== */
.empty-cart { text-align: center; padding: 60px 20px; }
.empty-cart-icon { font-size: 4rem; opacity: .5; display: block; margin-bottom: 16px; }
.empty-cart h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.empty-cart p { color: var(--muted); margin-bottom: 24px; }
.shop-now-btn {
  display: inline-block; background: var(--primary); color: white;
  padding: 14px 32px; border-radius: 40px; text-decoration: none; font-weight: 600;
}
.shop-now-btn:active { background: var(--primary-dark); transform: scale(.96); }

/* Popular Suggestions */
.popular-suggestions { margin-top: 40px; text-align: left; }
.popular-suggestions h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.popular-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* ===== COUPON SECTION ===== */
.coupon-section {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin: 12px 0;
}
.coupon-header { font-weight: 700; margin-bottom: 10px; font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.coupon-input-row { display: flex; gap: 8px; }
.coupon-input-row input {
  flex: 1; padding: 12px 14px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 12px;
  font-size: .9rem; text-transform: uppercase; font-family: inherit;
}
.coupon-input-row input:focus { outline: none; border-color: var(--primary); }
.coupon-input-row input::placeholder { text-transform: none; color: var(--muted); }
.coupon-input-row button {
  padding: 12px 18px; background: var(--primary); color: white;
  border: none; border-radius: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.coupon-input-row button:active { background: var(--primary-dark); transform: scale(.95); }
.coupon-message { font-size: .8rem; margin-top: 8px; min-height: 20px; }
.coupon-message.success { color: #10b981; }
.coupon-message.error { color: var(--danger); }

/* Applied Coupon */
.applied-coupon {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 10px 14px;
  background: var(--primary-light); border-radius: 12px;
}
.applied-coupon-info { display: flex; align-items: center; gap: 10px; }
.applied-code { font-weight: 700; color: var(--primary-dark); font-size: .9rem; }
.applied-discount { color: #10b981; font-weight: 600; font-size: .85rem; }
.remove-coupon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.remove-coupon-btn:active { color: var(--danger); }

/* ===== PRICE SUMMARY ===== */
.price-summary {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin: 12px 0;
}
.price-summary h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }
.summary-row.total-row { font-weight: 700; font-size: 1.1rem; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 12px; }
.discount-value { color: #10b981; }
.free-tag { color: #10b981; font-weight: 700; }
.delivery-message { text-align: center; font-size: .8rem; margin-top: 10px; font-weight: 500; }
.coupon-hint { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ===== RECOMMENDED ===== */
.recommended-section { padding: 16px 0; }
.recommended-section .section-header { margin-bottom: 12px; }
.recommended-section h3 { font-size: 1rem; font-weight: 700; }
.recommended-slider { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; -ms-overflow-style: none; scroll-snap-type: x mandatory; }
.recommended-slider::-webkit-scrollbar { display: none; }

/* Mini Product Card */
.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);
}
.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; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-product-price { font-weight: 700; color: var(--primary-dark); font-size: .85rem; margin-bottom: 8px; }
.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; }

/* Skeleton */
.skeleton-scroll { 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 CHECKOUT BAR ===== */
.sticky-checkout-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--card);
  padding: 12px 16px; box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  z-index: 95; border-top: 1px solid var(--border);
}
.checkout-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checkout-total-info { display: flex; flex-direction: column; }
.total-label { font-size: .7rem; color: var(--muted); }
.total-value { font-weight: 800; font-size: 1.2rem; color: var(--text); }
.total-items { font-size: .7rem; color: var(--muted); }
.checkout-actions { display: flex; align-items: center; gap: 8px; }
.add-more-btn {
  padding: 10px 14px; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 30px; font-weight: 600; font-size: .8rem; cursor: pointer; white-space: nowrap;
}
.add-more-btn:active { background: var(--border); }
.checkout-btn {
  background: var(--primary); color: white; padding: 12px 20px;
  border-radius: 40px; text-decoration: none; font-weight: 700;
  font-size: .9rem; box-shadow: 0 4px 12px rgba(46,204,113,.25);
  white-space: nowrap;
}
.checkout-btn:active { background: var(--primary-dark); transform: scale(.96); }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95); border-top: 1px solid var(--border);
  padding: 8px 16px; display: flex; justify-content: space-around;
  z-index: 90; max-width: 480px; margin: 0 auto;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--muted); font-size: .65rem;
  gap: 2px; padding: 6px 12px; border-radius: 40px;
}
.nav-item.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.nav-item span:first-child { font-size: 1.1rem; }

/* 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; }
