/* ============================================================
   Khadim Design System v2.0
   Modern Grocery PWA — Mobile-first, Carrefour-inspired desktop
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* ── App-matched brand colors (from colors.xml) ── */
  --c-green:        #3CB43A;   /* colorPrimary */
  --c-green-dark:   #2A8C28;   /* colorPrimaryDark */
  --c-green-xdark:  #1e6b1e;
  --c-green-light:  #E6F9E6;   /* colorPrimaryContainer */
  --c-green-50:     #EDF7EE;   /* colorSurfaceVariant */
  --c-accent:       #44C431;   /* colorAccent */
  --c-amber:        #D97706;   /* colorWarning */
  --c-amber-light:  #FEF3C7;   /* colorWarningBg */
  --c-red:          #E53935;   /* colorDeal/colorBadge */
  --c-red-light:    #FFEBEE;   /* colorDealBg */
  --c-blue:         #2563EB;   /* colorInfo */
  --c-bg:           #F4F6F4;   /* colorBackground */
  --c-white:        #FFFFFF;
  --c-gray-50:      #F9FAFB;   /* colorInputBackground */
  --c-gray-100:     #F4F6F4;
  --c-gray-200:     #E5E7EB;   /* colorBorderLight */
  --c-gray-300:     #D1FAE5;   /* colorBorder */
  --c-gray-400:     #9CA3AF;   /* colorTextHint */
  --c-gray-500:     #6B7280;   /* colorTextLabel */
  --c-gray-600:     #4B5563;   /* colorTextSecondary */
  --c-gray-700:     #374151;
  --c-gray-800:     #1F2937;
  --c-gray-900:     #111827;   /* colorTextPrimary */
  --c-text:         #111827;   /* colorTextPrimary */
  --c-muted:        #4B5563;   /* colorTextSecondary */
  --c-border:       #E5E7EB;   /* colorBorderLight */
  --c-success:      #16A34A;   /* colorSuccess */
  --c-success-bg:   #DCFCE7;   /* colorSuccessBg */
  --c-shadow-sm:    0 1px 2px 0 rgb(0 0 0 / 0.05);
  --c-shadow:       0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --c-shadow-md:    0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --c-shadow-lg:    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --c-shadow-xl:    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --c-radius-sm:    6px;
  --c-radius:       10px;
  --c-radius-lg:    16px;
  --c-radius-xl:    20px;
  --c-radius-full:  9999px;
  --header-h:       70px;
  --header-top-h:   40px;
  --bottom-nav-h:   64px;
  --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bottom-nav-h);
}

@media (min-width: 1024px) { body { padding-bottom: 0; } }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── Top Strip ─────────────────────────────────────────── */
.top-strip {
  background: var(--c-green-xdark);
  color: white;
  font-size: 12px;
  padding: 8px 0;
  display: none;
}
@media (min-width: 1024px) { .top-strip { display: block; } }
.top-strip a { color: rgba(255,255,255,.85); transition: var(--transition); }
.top-strip a:hover { color: white; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  background: var(--c-green);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--c-shadow-md);
  display: none;
}
@media (min-width: 1024px) { .site-header { display: block; } }
.site-header .container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.header-main { display: flex; align-items: center; gap: 16px; padding: 12px 0; }

/* Logo */
.header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-logo img { height: 44px; width: 44px; object-fit: contain; border-radius: 10px; background: white; padding: 4px; }
.header-logo-text { color: white; font-size: 20px; font-weight: 700; line-height: 1; display: none; }
@media (min-width: 768px) { .header-logo-text { display: block; } }

/* Search */
.header-search { flex: 1; position: relative; max-width: 600px; }
.header-search input {
  width: 100%; background: white; border: 2px solid transparent;
  border-radius: var(--c-radius-full); padding: 10px 16px 10px 44px;
  font-size: 14px; font-weight: 500; transition: var(--transition);
  outline: none; color: var(--c-text);
}
.header-search input:focus { border-color: var(--c-amber); box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
.header-search input::placeholder { color: var(--c-gray-400); }
.header-search .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--c-gray-400); pointer-events: none; width: 18px; height: 18px;
}
.header-search .search-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: var(--c-green); color: white; border: none; cursor: pointer;
  border-radius: var(--c-radius-full); padding: 6px 14px; font-size: 13px;
  font-weight: 600; transition: var(--transition);
}
.header-search .search-btn:hover { background: var(--c-green-dark); }

/* Search Suggestions */
.search-suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: white; border-radius: var(--c-radius-lg); box-shadow: var(--c-shadow-xl);
  z-index: 200; overflow: hidden; border: 1px solid var(--c-border);
  display: none;
}
.search-suggestions.active { display: block; }
.suggestion-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  cursor: pointer; transition: var(--transition); font-size: 14px;
}
.suggestion-item:hover { background: var(--c-green-50); }
.suggestion-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.suggestion-item .name { font-weight: 500; color: var(--c-text); }
.suggestion-item .price { color: var(--c-green); font-weight: 600; font-size: 12px; }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15); border: none; border-radius: var(--c-radius);
  color: white; cursor: pointer; padding: 8px 12px; min-width: 50px;
  transition: var(--transition); position: relative; text-decoration: none;
}
.header-btn:hover { background: rgba(255,255,255,.25); color: white; }
.header-btn svg { width: 22px; height: 22px; }
.header-btn .btn-label { font-size: 10px; font-weight: 500; margin-top: 2px; }
.header-btn .badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--c-amber); color: var(--c-gray-900); border-radius: var(--c-radius-full);
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--c-green);
}

/* User Dropdown */
.header-user { position: relative; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: white; border-radius: var(--c-radius-lg); box-shadow: var(--c-shadow-xl);
  min-width: 200px; border: 1px solid var(--c-border); overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: var(--transition); z-index: 200;
}
.header-user:hover .user-menu,
.header-user.open .user-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.user-menu a {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  font-size: 14px; font-weight: 500; color: var(--c-text);
  transition: var(--transition); border-bottom: 1px solid var(--c-gray-100);
}
.user-menu a:last-child { border-bottom: none; }
.user-menu a:hover { background: var(--c-green-50); color: var(--c-green); }
.user-menu a svg { width: 16px; height: 16px; color: var(--c-muted); }

/* ── Nav Bar (desktop) ──────────────────────────────────── */
.site-nav {
  background: var(--c-green-dark); display: none;
}
@media (min-width: 1024px) { .site-nav { display: block; } }
.site-nav .container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.site-nav ul { display: flex; list-style: none; gap: 0; }
.site-nav li a {
  display: block; color: rgba(255,255,255,.9); font-size: 13px; font-weight: 500;
  padding: 10px 16px; transition: var(--transition); white-space: nowrap;
}
.site-nav li a:hover,
.site-nav li a.active { color: white; background: rgba(255,255,255,.1); }
.site-nav li a.hot { color: var(--c-amber); }
.site-nav li a.hot:hover { color: white; }

/* ── Mobile Header ──────────────────────────────────────── */
.mobile-header {
  background: var(--c-green); position: sticky; top: 0; z-index: 100;
  box-shadow: var(--c-shadow-md);
}
@media (min-width: 1024px) { .mobile-header { display: none; } }
.mobile-header-top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
}
.mobile-header-top .logo { display: flex; align-items: center; gap: 8px; flex: 1; }
.mobile-header-top .logo img { height: 38px; width: 38px; object-fit: contain; border-radius: 8px; background: white; padding: 3px; }
.mobile-header-top .logo span { color: white; font-size: 17px; font-weight: 700; }
.mobile-search-bar { padding: 0 16px 10px; position: relative; }
.mobile-search-bar input {
  width: 100%; background: white; border: none; border-radius: var(--c-radius-full);
  padding: 9px 16px 9px 40px; font-size: 14px; outline: none; color: var(--c-text);
}
.mobile-search-bar .ico { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); color: var(--c-gray-400); }

/* ── Bottom Navigation (Mobile PWA) ────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white; border-top: 1px solid var(--c-border);
  display: flex; z-index: 100; height: var(--bottom-nav-h);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; cursor: pointer; position: relative;
  color: var(--c-gray-400); text-decoration: none; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item .label { font-size: 10px; font-weight: 500; }
.bottom-nav-item.active { color: var(--c-green); }
.bottom-nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 3px;
  background: var(--c-green); border-radius: 0 0 4px 4px;
}
.bottom-nav-item .badge {
  position: absolute; top: 8px; right: calc(50% - 20px);
  background: var(--c-red); color: white; border-radius: var(--c-radius-full);
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ── Page Wrapper ────────────────────────────────────────── */
.page-content { min-height: 100vh; }
.container-main { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
/* duplicate desktop rule removed — already in .site-header block above */

/* ── Hero Banner ────────────────────────────────────────── */
.hero-section { position: relative; background: var(--c-green-xdark); overflow: hidden; }
.hero-slider { position: relative; }
.hero-slide {
  position: relative; min-height: 280px; display: flex; align-items: center;
  background: #111;
}
@media (min-width: 768px) { .hero-slide { min-height: 420px; } }
@media (min-width: 1024px) { .hero-slide { min-height: 500px; } }
.hero-slide img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-content {
  position: relative; z-index: 2; padding: 40px 20px; max-width: 600px;
}
.hero-badge {
  display: inline-block; background: var(--c-amber); color: var(--c-gray-900);
  font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: var(--c-radius-full);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
}
.hero-title { font-size: 28px; font-weight: 800; color: white; line-height: 1.2; margin-bottom: 10px; }
@media (min-width: 768px) { .hero-title { font-size: 42px; } }
.hero-subtitle { font-size: 15px; color: rgba(255,255,255,.85); margin-bottom: 24px; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px; background: white;
  color: var(--c-green); font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: var(--c-radius-full);
  transition: var(--transition); box-shadow: var(--c-shadow-lg);
}
.hero-cta:hover { background: var(--c-amber); color: var(--c-gray-900); transform: translateY(-2px); }

/* Promo banners strip */
.promo-strip { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 20px 0; }
@media (min-width: 640px) { .promo-strip { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .promo-strip { grid-template-columns: 1fr 1fr 1fr; } }
.promo-card {
  border-radius: var(--c-radius-lg); overflow: hidden; position: relative;
  aspect-ratio: 16/7; cursor: pointer; box-shadow: var(--c-shadow);
}
.promo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.promo-card:hover img { transform: scale(1.04); }

/* ── Section Headers ─────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--c-text); }
@media (min-width: 768px) { .section-title { font-size: 22px; } }
.section-title span { color: var(--c-green); }
.section-link {
  font-size: 13px; font-weight: 600; color: var(--c-green);
  display: flex; align-items: center; gap: 4px; transition: var(--transition);
}
.section-link:hover { color: var(--c-green-dark); }

/* ── Category Chips ────────────────────────────────────── */
.category-scroll-wrap { position: relative; padding-bottom: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-scroll-wrap::-webkit-scrollbar { display: none; }
.category-scroll { display: flex; gap: 12px; width: max-content; padding: 4px 2px; }

/* ── Horizontal Product Scroll (Trending) ─────────────── */
.product-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
.product-scroll-wrap::-webkit-scrollbar { display: none; }
.product-scroll { display: flex; gap: 12px; width: max-content; padding: 2px 0; }
.product-scroll .product-card { width: 160px; flex-shrink: 0; }
@media (min-width: 640px) { .product-scroll .product-card { width: 190px; } }

.cat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: white; border-radius: var(--c-radius-lg);
  padding: 14px 16px; min-width: 88px; cursor: pointer;
  transition: var(--transition); box-shadow: var(--c-shadow-sm);
  border: 2px solid transparent;
}
.cat-chip:hover { border-color: var(--c-green); box-shadow: var(--c-shadow-md); }
.cat-chip.active { border-color: var(--c-green); background: var(--c-green-50); }
.cat-chip img { width: 52px; height: 52px; object-fit: contain; }
.cat-chip .name {
  font-size: 12px; font-weight: 600; color: var(--c-text); text-align: center;
  line-height: 1.3; max-width: 80px; word-break: break-word;
}

/* ── Product Grid ────────────────────────────────────────── */
.product-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

/* Product Card */
.product-card {
  background: white; border-radius: var(--c-radius-lg); overflow: hidden;
  box-shadow: var(--c-shadow-sm); transition: var(--transition);
  border: 1px solid var(--c-border); position: relative; display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--c-shadow-lg); transform: translateY(-3px); border-color: var(--c-green-light); }

.product-card-img {
  position: relative; aspect-ratio: 1/1; overflow: hidden;
  background: var(--c-gray-50);
}
.product-card-img img {
  width: 100%; height: 100%; object-fit: contain; padding: 10px;
  transition: transform 0.3s;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }

.product-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--c-red); color: white; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--c-radius-full);
}
.product-badge.off { background: var(--c-amber); color: var(--c-gray-900); }

.product-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card-title {
  font-size: 13px; font-weight: 600; color: var(--c-text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-unit { font-size: 11px; color: var(--c-muted); }
.product-card-price { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.product-card-price .current { font-size: 15px; font-weight: 700; color: var(--c-green); }
.product-card-price .original { font-size: 12px; color: var(--c-muted); text-decoration: line-through; }

/* Add to Cart Button */
.add-to-cart-btn {
  width: 100%; background: var(--c-green); color: white; border: none;
  border-radius: var(--c-radius); padding: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center;
  justify-content: center; gap: 6px; margin-top: 8px;
}
.add-to-cart-btn:hover { background: var(--c-green-dark); }
.add-to-cart-btn:active { transform: scale(0.97); }
.add-to-cart-btn.in-cart { background: var(--c-green-50); color: var(--c-green); border: 1px solid var(--c-green); }

/* Qty Control */
.qty-control {
  display: flex; align-items: center; gap: 0; width: 100%;
  border: 1.5px solid var(--c-green); border-radius: var(--c-radius); overflow: hidden; margin-top: 8px;
}
.qty-control button {
  background: var(--c-green); color: white; border: none; cursor: pointer;
  width: 34px; height: 36px; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.qty-control button:hover { background: var(--c-green-dark); }
.qty-control input {
  flex: 1; border: none; text-align: center; font-size: 14px; font-weight: 700;
  color: var(--c-green); padding: 0 4px; height: 36px; outline: none; background: white;
  min-width: 0;
}

/* ── Horizontal Product Scroll ──────────────────────────── */
.product-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.product-scroll-wrap::-webkit-scrollbar { display: none; }
.product-scroll { display: flex; gap: 12px; width: max-content; padding: 4px 2px 8px; }
.product-scroll .product-card { width: 160px; flex-shrink: 0; }
@media (min-width: 768px) { .product-scroll .product-card { width: 200px; } }

/* ── Cart Drawer ─────────────────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
  opacity: 0; visibility: hidden; transition: var(--transition);
  backdrop-filter: blur(2px);
}
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; right: -100%; top: 0; bottom: 0; width: 100%; max-width: 420px;
  background: white; z-index: 301; transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15);
}
.cart-drawer.open { right: 0; }
.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--c-border); flex-shrink: 0;
}
.cart-drawer-header h3 { font-size: 17px; font-weight: 700; }
.cart-drawer-close {
  background: var(--c-gray-100); border: none; cursor: pointer; border-radius: var(--c-radius);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.cart-drawer-close:hover { background: var(--c-red-light); color: var(--c-red); }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-drawer-footer { padding: 16px 20px; border-top: 1px solid var(--c-border); flex-shrink: 0; }

.cart-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--c-gray-100);
}
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 60px; height: 60px; object-fit: contain; border-radius: var(--c-radius); background: var(--c-gray-50); padding: 4px; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; color: var(--c-text); line-height: 1.3; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: var(--c-muted); }
.cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-item-btn {
  background: var(--c-gray-100); border: none; cursor: pointer; border-radius: 6px;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; transition: var(--transition);
}
.cart-item-btn:hover { background: var(--c-green-light); color: var(--c-green); }
.cart-item-btn.del:hover { background: var(--c-red-light); color: var(--c-red); }
.cart-item-qty { font-size: 14px; font-weight: 700; min-width: 24px; text-align: center; }
.cart-item-total { font-size: 14px; font-weight: 700; color: var(--c-green); flex-shrink: 0; }

.cart-summary { background: var(--c-gray-50); border-radius: var(--c-radius); padding: 14px; margin-bottom: 12px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--c-muted); margin-bottom: 8px; }
.cart-summary-row.total { font-size: 16px; font-weight: 700; color: var(--c-text); border-top: 1px dashed var(--c-border); padding-top: 8px; margin-top: 8px; margin-bottom: 0; }
.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty svg { width: 80px; height: 80px; color: var(--c-gray-300); margin: 0 auto 16px; }
.cart-empty h4 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.cart-empty p { font-size: 14px; color: var(--c-muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; border: none;
  border-radius: var(--c-radius); padding: 10px 20px; cursor: pointer;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--c-green); color: white; }
.btn-primary:hover { background: var(--c-green-dark); color: white; box-shadow: 0 4px 12px rgba(22,163,74,.3); }
.btn-secondary { background: var(--c-gray-100); color: var(--c-text); }
.btn-secondary:hover { background: var(--c-gray-200); }
.btn-outline { background: transparent; color: var(--c-green); border: 2px solid var(--c-green); }
.btn-outline:hover { background: var(--c-green); color: white; }
.btn-danger { background: var(--c-red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-amber { background: var(--c-amber); color: var(--c-gray-900); }
.btn-amber:hover { background: #d97706; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--c-radius-lg); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--c-radius-sm); }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--c-radius-full); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
.form-control {
  width: 100%; background: white; border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius); padding: 10px 14px; font-size: 14px;
  font-family: inherit; color: var(--c-text); outline: none; transition: var(--transition);
}
.form-control:focus { border-color: var(--c-green); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.form-control.error { border-color: var(--c-red); }
.form-control::placeholder { color: var(--c-gray-400); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.input-group { position: relative; }
.input-group .form-control { padding-left: 42px; }
.input-group .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.form-error { font-size: 12px; color: var(--c-red); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--c-muted); margin-top: 4px; }

/* ── Cards ────────────────────────────────────────────────── */
.card { background: white; border-radius: var(--c-radius-lg); box-shadow: var(--c-shadow-sm); border: 1px solid var(--c-border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--c-border); font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--c-border); background: var(--c-gray-50); border-radius: 0 0 var(--c-radius-lg) var(--c-radius-lg); }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 12px 0; }
.breadcrumb a { color: var(--c-muted); transition: var(--transition); }
.breadcrumb a:hover { color: var(--c-green); }
.breadcrumb .sep { color: var(--c-gray-300); }
.breadcrumb .current { color: var(--c-text); font-weight: 600; }

/* ── Toast / Notification ─────────────────────────────────── */
#toast-container { position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 1024px) { #toast-container { bottom: 24px; } }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-gray-900); color: white; padding: 12px 16px;
  border-radius: var(--c-radius-lg); box-shadow: var(--c-shadow-xl);
  font-size: 13px; font-weight: 500; min-width: 220px; max-width: 360px;
  animation: toastIn 0.3s ease; border-left: 4px solid var(--c-green);
}
.toast.error { border-left-color: var(--c-red); }
.toast.warning { border-left-color: var(--c-amber); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── PWA Install Banner ───────────────────────────────────── */
#pwa-banner {
  position: fixed; bottom: calc(var(--bottom-nav-h) + 12px); left: 16px; right: 16px;
  background: white; border-radius: var(--c-radius-xl); box-shadow: var(--c-shadow-xl);
  border: 1px solid var(--c-green-light); padding: 16px 18px; z-index: 200;
  display: none; align-items: center; gap: 14px;
}
@media (min-width: 1024px) { #pwa-banner { left: auto; right: 24px; bottom: 24px; max-width: 360px; } }
#pwa-banner.show { display: flex; }
#pwa-banner img { width: 48px; height: 48px; border-radius: 10px; }
#pwa-banner .pwa-info { flex: 1; }
#pwa-banner .pwa-info strong { display: block; font-size: 14px; font-weight: 700; }
#pwa-banner .pwa-info span { font-size: 12px; color: var(--c-muted); }
#pwa-install-btn { background: var(--c-green); color: white; border: none; border-radius: var(--c-radius); padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
#pwa-dismiss-btn { background: none; border: none; color: var(--c-muted); cursor: pointer; padding: 4px; }

/* ── GPS Prompt ──────────────────────────────────────────── */
.gps-card {
  background: linear-gradient(135deg, var(--c-green-50), var(--c-green-light));
  border: 1.5px solid var(--c-green-light); border-radius: var(--c-radius-lg);
  padding: 20px; display: flex; align-items: center; gap: 16px; cursor: pointer;
  transition: var(--transition);
}
.gps-card:hover { box-shadow: var(--c-shadow-md); }
.gps-icon { width: 48px; height: 48px; background: var(--c-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gps-icon svg { width: 24px; height: 24px; color: white; }

/* ── Order Status ────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--c-radius-full);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.status-1 { background: #fef3c7; color: #92400e; }
.status-2 { background: #dbeafe; color: #1e40af; }
.status-3 { background: #ede9fe; color: #6d28d9; }
.status-4 { background: var(--c-green-light); color: #15803d; }
.status-5 { background: #cffafe; color: #0e7490; }
.status-8 { background: var(--c-red-light); color: #991b1b; }

/* ── Sidebar (desktop listing) ───────────────────────────── */
.listing-layout { display: block; }
@media (min-width: 1024px) { .listing-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; } }
.filter-sidebar {
  background: white; border-radius: var(--c-radius-lg); box-shadow: var(--c-shadow-sm);
  border: 1px solid var(--c-border); overflow: hidden; height: fit-content; position: sticky; top: 80px;
  display: none;
}
@media (min-width: 1024px) { .filter-sidebar { display: block; } }
.filter-section { padding: 16px 20px; border-bottom: 1px solid var(--c-gray-100); }
.filter-section:last-child { border-bottom: none; }
.filter-title { font-size: 13px; font-weight: 700; color: var(--c-text); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.filter-option { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.filter-option input[type="checkbox"],
.filter-option input[type="radio"] { accent-color: var(--c-green); width: 15px; height: 15px; cursor: pointer; }
.filter-option label { font-size: 13px; color: var(--c-text); cursor: pointer; }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.price-range input { padding: 8px 10px; }

/* Sort bar */
.sort-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; padding: 12px 16px; background: white; border-radius: var(--c-radius-lg);
  border: 1px solid var(--c-border); margin-bottom: 16px;
}
.sort-bar .results { font-size: 13px; color: var(--c-muted); }
.sort-bar .results strong { color: var(--c-text); }
.sort-select { padding: 7px 12px; border: 1.5px solid var(--c-border); border-radius: var(--c-radius); font-size: 13px; font-family: inherit; outline: none; cursor: pointer; }

/* ── Product Detail ──────────────────────────────────────── */
.product-detail-grid { display: block; }
@media (min-width: 768px) { .product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (min-width: 1024px) { .product-detail-grid { grid-template-columns: 1.2fr 1fr; gap: 48px; } }

.product-gallery { position: sticky; top: 80px; }
.gallery-main {
  aspect-ratio: 1; background: var(--c-gray-50); border-radius: var(--c-radius-xl);
  overflow: hidden; margin-bottom: 12px; border: 1px solid var(--c-border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.gallery-main img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transition: transform 0.3s ease;
}
.gallery-main:hover img { transform: scale(1.05); }

/* ── Product Image Bottom Sheet ───────────────────────────────── */
.product-image-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  max-height: 80vh;
  overflow-y: auto;
  will-change: transform;
}

.product-image-sheet.open {
  transform: translateY(0);
}

.product-image-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-image-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.product-image-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.product-image-sheet-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.product-image-sheet-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--c-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.product-image-sheet-close:hover {
  background: var(--c-gray-50);
  color: var(--c-text);
}

.product-image-sheet-content {
  padding: 20px;
}

.product-image-sheet-main {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--c-gray-50);
  margin-bottom: 16px;
}

.product-image-sheet-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.product-image-sheet-thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--c-radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--c-border);
  transition: var(--transition);
  background: var(--c-gray-50);
}

.product-image-sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-sheet-thumb.active {
  border-color: var(--c-green);
}

.product-image-sheet-thumb:hover {
  border-color: var(--c-green);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .product-image-sheet {
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }
  
  .product-image-sheet-main {
    max-height: 50vh;
  }
  
  .product-image-sheet-thumb {
    width: 60px;
    height: 60px;
  }
}

/* ── Mobile App-like Enhancements ───────────────────────────────── */
@media (max-width: 768px) {
  /* Native app feel */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Safe area insets for notched phones */
  .site-header {
    padding-top: env(safe-area-inset-top);
  }
  
  /* Touch-friendly buttons */
  .btn {
    min-height: 44px; /* iOS touch target */
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Remove tap delays */
  .btn, .header-btn, .add-to-cart-btn {
    touch-action: manipulation;
  }
  
  /* Native scroll momentum */
  .container-main {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Status bar theme */
  .site-header {
    color: #000;
    background: white;
  }
  
  /* Hide scrollbars for cleaner look */
  ::-webkit-scrollbar {
    display: none;
  }
  
  /* Smooth transitions */
  .product-gallery img,
  .gallery-thumb img,
  .product-image-sheet-main {
    transition: transform 0.3s ease;
  }
  
  /* Bottom sheet handle indicator */
  .product-image-sheet::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    z-index: 1;
  }
  
  /* Native pull-to-refresh hint */
  .container-main {
    min-height: 100vh;
    position: relative;
  }
  
  /* Card shadows for depth */
  .product-gallery,
  .checkout-section,
  .cart-item {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  
  /* Blur effects for modern look */
  .product-image-sheet-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.gallery-thumb {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: var(--c-radius);
  overflow: hidden; cursor: pointer; border: 2px solid var(--c-border); transition: var(--transition);
  background: var(--c-gray-50);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.gallery-thumb.active { border-color: var(--c-green); }
.gallery-thumb:hover { border-color: var(--c-green); }

.product-detail-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
@media (min-width: 768px) { .product-detail-title { font-size: 26px; } }
.product-detail-price { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.product-detail-price .current { font-size: 28px; font-weight: 800; color: var(--c-green); }
.product-detail-price .original { font-size: 16px; color: var(--c-muted); text-decoration: line-through; }
.product-detail-price .disc { background: var(--c-red); color: white; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--c-radius-full); }
.product-detail-unit { font-size: 14px; color: var(--c-muted); margin-bottom: 20px; }
.product-detail-desc { font-size: 14px; color: var(--c-muted); line-height: 1.8; margin-bottom: 24px; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-green-50) 0%, white 60%, var(--c-green-light) 100%);
  padding: 20px;
}
.auth-card {
  background: white; border-radius: var(--c-radius-xl); box-shadow: var(--c-shadow-xl);
  padding: 36px; width: 100%; max-width: 440px; border: 1px solid var(--c-green-light);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 56px; width: 56px; object-fit: contain; border-radius: 14px; margin: 0 auto 10px; }
.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--c-green); }
.auth-logo p { font-size: 13px; color: var(--c-muted); }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--c-muted); margin-bottom: 24px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }
.auth-divider span { font-size: 12px; color: var(--c-muted); white-space: nowrap; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--c-muted); }
.auth-footer a { color: var(--c-green); font-weight: 600; }

/* ── Page Sections ────────────────────────────────────────── */
.page-section { padding: 24px 0; }
@media (min-width: 768px) { .page-section { padding: 32px 0; } }
.page-section + .page-section { border-top: 1px solid var(--c-border); }

/* My Orders */
.order-card {
  background: white; border-radius: var(--c-radius-lg); border: 1px solid var(--c-border);
  overflow: hidden; box-shadow: var(--c-shadow-sm); margin-bottom: 12px;
  transition: var(--transition);
}
.order-card:hover { box-shadow: var(--c-shadow-md); }
.order-card-header { padding: 14px 18px; border-bottom: 1px solid var(--c-gray-100); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-id { font-size: 13px; font-weight: 700; }
.order-date { font-size: 12px; color: var(--c-muted); }
.order-card-body { padding: 14px 18px; }
.order-items-preview { display: flex; gap: 8px; overflow: hidden; margin-bottom: 10px; }
.order-item-img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--c-gray-50); padding: 4px; }
.order-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 18px; background: var(--c-gray-50); border-top: 1px solid var(--c-gray-100); }
.order-total { font-size: 14px; font-weight: 700; }

/* Order Timeline */
.order-timeline { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; overflow-x: auto; }
.timeline-step { display: flex; flex-direction: column; align-items: center; text-align: center; flex-shrink: 0; width: 80px; }
.timeline-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.timeline-dot.done { background: var(--c-green); color: white; }
.timeline-dot.active { background: var(--c-amber); color: white; }
.timeline-dot.pending { background: var(--c-gray-200); color: var(--c-muted); }
.timeline-label { font-size: 10px; color: var(--c-muted); line-height: 1.3; }
.timeline-connector { flex: 1; height: 2px; background: var(--c-gray-200); margin-top: 16px; min-width: 30px; }
.timeline-connector.done { background: var(--c-green); }

/* ── Account Profile ──────────────────────────────────────── */
.profile-header { background: linear-gradient(135deg, var(--c-green), var(--c-green-dark)); border-radius: var(--c-radius-xl); padding: 28px; color: white; margin-bottom: 20px; display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-avatar svg { width: 38px; height: 38px; color: white; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-phone { font-size: 13px; opacity: .8; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: white; border-radius: var(--c-radius-lg); padding: 16px; text-align: center; box-shadow: var(--c-shadow-sm); border: 1px solid var(--c-border); }
.stat-card .num { font-size: 22px; font-weight: 800; color: var(--c-green); }
.stat-card .label { font-size: 11px; color: var(--c-muted); }
.menu-list { background: white; border-radius: var(--c-radius-lg); overflow: hidden; border: 1px solid var(--c-border); box-shadow: var(--c-shadow-sm); }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--c-gray-100); cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--c-text); }
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--c-green-50); }
.menu-item .icon { width: 38px; height: 38px; border-radius: var(--c-radius); background: var(--c-gray-100); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-item:hover .icon { background: var(--c-green-light); color: var(--c-green); }
.menu-item .text { flex: 1; }
.menu-item .text strong { display: block; font-size: 14px; font-weight: 600; }
.menu-item .text small { font-size: 12px; color: var(--c-muted); }
.menu-item .chevron { color: var(--c-gray-400); }

/* ── Checkout ─────────────────────────────────────────────── */
.checkout-layout { display: block; }
@media (min-width: 1024px) { .checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; } }
.checkout-section { background: white; border-radius: var(--c-radius-lg); border: 1px solid var(--c-border); margin-bottom: 16px; overflow: hidden; }
.checkout-section-title { padding: 14px 18px; border-bottom: 1px solid var(--c-gray-100); display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.checkout-section-title .step { width: 24px; height: 24px; background: var(--c-green); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.checkout-section-body { padding: 16px 18px; }

/* Address Cards */
.address-card {
  border: 1.5px solid var(--c-border); border-radius: var(--c-radius); padding: 14px;
  cursor: pointer; transition: var(--transition); margin-bottom: 10px; position: relative;
}
.address-card.selected { border-color: var(--c-green); background: var(--c-green-50); }
.address-card:hover { border-color: var(--c-green); }
.address-card h5 { font-size: 13px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.address-card p { font-size: 12px; color: var(--c-muted); line-height: 1.5; }
.address-card .check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-border); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.address-card.selected .check { background: var(--c-green); border-color: var(--c-green); color: white; }

/* Payment Options */
.payment-option {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1.5px solid var(--c-border); border-radius: var(--c-radius);
  cursor: pointer; transition: var(--transition); margin-bottom: 10px;
}
.payment-option.selected { border-color: var(--c-green); background: var(--c-green-50); }
.payment-option:hover { border-color: var(--c-green); }
.payment-option .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); }
.payment-option.selected .radio { border-color: var(--c-green); }
.payment-option.selected .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c-green); }
.payment-option .pay-icon { width: 42px; height: 42px; border-radius: var(--c-radius); object-fit: contain; background: var(--c-gray-50); padding: 4px; }
.payment-option .pay-info strong { display: block; font-size: 14px; font-weight: 700; }
.payment-option .pay-info small { font-size: 12px; color: var(--c-muted); }

/* Order Summary */
.order-summary-card { background: var(--c-green-50); border: 1.5px solid var(--c-green-light); border-radius: var(--c-radius-lg); overflow: hidden; }
.summary-items { max-height: 250px; overflow-y: auto; padding: 12px 16px; }
.summary-item { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.summary-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: white; padding: 3px; }
.summary-item .info { flex: 1; min-width: 0; }
.summary-item .info span { font-size: 12px; color: var(--c-text); display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.summary-item .info small { font-size: 11px; color: var(--c-muted); }
.summary-item .price { font-size: 13px; font-weight: 700; color: var(--c-green); flex-shrink: 0; }
.summary-totals { padding: 12px 16px; border-top: 1px dashed var(--c-green-light); background: white; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.summary-row.grand { font-size: 16px; font-weight: 800; color: var(--c-green); border-top: 1px solid var(--c-border); padding-top: 10px; margin-top: 8px; margin-bottom: 0; }

/* ── Order Success ────────────────────────────────────────── */
.success-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.success-card { background: white; border-radius: var(--c-radius-xl); box-shadow: var(--c-shadow-xl); padding: 40px; max-width: 480px; width: 100%; text-align: center; }
.success-icon { width: 90px; height: 90px; background: var(--c-green-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; animation: popIn 0.5s ease; }
.success-icon svg { width: 48px; height: 48px; color: var(--c-green); }
@keyframes popIn { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.success-title { font-size: 24px; font-weight: 800; color: var(--c-text); margin-bottom: 8px; }
.success-subtitle { font-size: 14px; color: var(--c-muted); margin-bottom: 28px; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { background: var(--c-gray-900); color: var(--c-gray-400); margin-top: 40px; display: none; }
@media (min-width: 1024px) { .site-footer { display: block; } }
.footer-top { padding: 48px 0 32px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-brand { margin-bottom: 16px; }
.footer-brand img { height: 44px; margin-bottom: 10px; }
.footer-brand p { font-size: 13px; line-height: 1.7; color: var(--c-gray-500); max-width: 280px; }
.footer-col h6 { font-size: 12px; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 13px; color: var(--c-gray-500); transition: var(--transition); }
.footer-col ul li a:hover { color: white; }
.footer-bottom { padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-bottom p { font-size: 13px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 36px; height: 36px; background: rgba(255,255,255,.08); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--c-gray-400); transition: var(--transition); }
.footer-social a:hover { background: var(--c-green); color: white; }

/* ── Loading Skeleton ─────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--c-radius); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-card { background: white; border-radius: var(--c-radius-lg); overflow: hidden; border: 1px solid var(--c-border); }

/* ── Utilities ────────────────────────────────────────────── */
.section-pad { padding: 24px 0; }
.divider { height: 1px; background: var(--c-border); margin: 24px 0; }
.text-green { color: var(--c-green); }
.text-muted { color: var(--c-muted); }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.no-scroll { overflow: hidden; }

/* ── Cart ────────────────────────────────────────────────────────────────── */
.cart-layout { display:grid; grid-template-columns:1fr; gap:20px; }
@media(min-width:768px){ .cart-layout{ grid-template-columns:1.5fr 1fr; } }
.cart-item { display:flex; align-items:flex-start; gap:14px; padding:16px 18px; }
.cart-item img { width:72px; height:72px; object-fit:cover; border-radius:10px; border:1px solid var(--c-border); flex-shrink:0; }
.cart-item-info { flex:1; min-width:0; }
.cart-item-name { font-size:14px; font-weight:600; color:var(--c-text); text-decoration:none; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cart-item-unit { font-size:11px; color:var(--c-muted); margin:3px 0; }
.cart-item-price { font-size:15px; font-weight:800; color:var(--c-green); margin-top:4px; display:flex; align-items:center; gap:6px; }
.cart-item-actions { display:flex; flex-direction:column; align-items:flex-end; justify-content:space-between; flex-shrink:0; min-height:72px; }

/* ── Qty Control ─────────────────────────────────────────────────────────── */
.qty-control { display:flex; align-items:center; border:1.5px solid var(--c-border); border-radius:10px; overflow:hidden; }
.qty-control button { width:32px; height:32px; border:none; background:var(--c-bg); color:var(--c-text); font-size:18px; font-weight:700; cursor:pointer; transition:background .15s; display:flex; align-items:center; justify-content:center; }
.qty-control button:hover { background:var(--c-green-50); color:var(--c-green); }
.qty-control input { width:40px; height:32px; border:none; text-align:center; font-size:14px; font-weight:700; font-family:inherit; background:white; -moz-appearance:textfield; appearance:textfield; }
.qty-control input::-webkit-inner-spin-button, .qty-control input::-webkit-outer-spin-button { -webkit-appearance:none; appearance:none; }

/* ── Form Inputs (used in checkout, auth, address pages) ─────────────────── */
.form-group { margin-bottom:14px; }
.form-label { display:block; font-size:13px; font-weight:600; color:var(--c-text); margin-bottom:5px; }
.form-input { width:100%; padding:11px 14px; border:1.5px solid var(--c-border); border-radius:10px; font-size:14px; font-family:inherit; color:var(--c-text); background:white; transition:border-color .2s, box-shadow .2s; outline:none; box-sizing:border-box; }
.form-input:focus { border-color:var(--c-green); box-shadow:0 0 0 3px rgba(22,163,74,.1); }
.form-input::placeholder { color:var(--c-muted); }
textarea.form-input { resize:vertical; min-height:80px; }

/* ── Buttons extra sizes ─────────────────────────────────────────────────── */
.btn-sm { padding:7px 14px; font-size:12px; border-radius:8px; }
.btn-outline { background:white; color:var(--c-green); border:1.5px solid var(--c-green); border-radius:10px; padding:10px 20px; font-size:14px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:6px; transition:all .2s; }
.btn-outline:hover { background:var(--c-green-50); }

/* ── Account nav pill active ─────────────────────────────────────────────── */
.account-nav a { padding:8px 18px; border-radius:999px; font-size:13px; font-weight:600; text-decoration:none; background:white; color:var(--c-text); border:1.5px solid var(--c-border); transition:all .2s; }
.account-nav a.active { background:var(--c-green); color:white; border-color:var(--c-green); }

/* ── Push Notification Bell animation ────────────────────────────────────── */
@keyframes bellRing { 0%,100%{transform:rotate(0)} 20%{transform:rotate(-15deg)} 40%{transform:rotate(15deg)} 60%{transform:rotate(-10deg)} 80%{transform:rotate(10deg)} }
.bell-ring { animation: bellRing .6s ease; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARREFOUR-QUALITY MICRO-INTERACTIONS & POLISH LAYER
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Smooth global transitions ───────────────────────────────────────────── */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

/* ── Product card hover lift + shadow bloom ──────────────────────────────── */
.product-card {
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease;
  will-change: transform;
}
.product-card:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 12px 36px rgba(60,180,58,.18);
}
.product-card:active { transform: translateY(-1px) scale(1.005); }

/* ── Product image zoom on hover ─────────────────────────────────────────── */
.product-card img {
  transition: transform .35s cubic-bezier(.25,.46,.45,.94);
}
.product-card:hover img { transform: scale(1.07); }

/* ── Button press micro-animation ────────────────────────────────────────── */
.btn {
  transition: transform .12s ease, box-shadow .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(60,180,58,.35);
}

/* ── Add-to-cart button bounce ───────────────────────────────────────────── */
@keyframes cartBounce { 0%{transform:scale(1)} 40%{transform:scale(1.18)} 70%{transform:scale(.94)} 100%{transform:scale(1)} }
.btn-cart-added { animation: cartBounce .4s cubic-bezier(.36,.07,.19,.97); }

/* ── Badge pulse (sale / new) ────────────────────────────────────────────── */
@keyframes badgePulse { 0%,100%{opacity:1} 50%{opacity:.75} }
.product-badge.pulse { animation: badgePulse 2s ease infinite; }

/* ── Skeleton loader ─────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
.skeleton-card { height: 240px; border-radius: 16px; }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 18px; margin-bottom: 10px; }

/* ── Toast notification ──────────────────────────────────────────────────── */
#khadim-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(24px);
  background: #1F2937; color: white; padding: 12px 22px;
  border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  z-index: 9999; pointer-events: none; white-space: nowrap;
}
#khadim-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#khadim-toast.success { background: var(--c-green); }
#khadim-toast.error   { background: #DC2626; }

/* ── Page fade-in on load ────────────────────────────────────────────────── */
@keyframes pageFadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.container-main { animation: pageFadeIn .32s ease both; }

/* ── Category pill hover ─────────────────────────────────────────────────── */
.category-item {
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease;
}
.category-item:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(60,180,58,.15); }
.category-item:active { transform: translateY(0) scale(.96); }

/* ── Input focus glow ────────────────────────────────────────────────────── */
.form-input {
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.form-input:focus { transform: none; }

/* ── Section-title animated underline ───────────────────────────────────── */
.section-title span {
  background: linear-gradient(90deg, var(--c-green), var(--c-green-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Header shadow on scroll (JS adds .scrolled) ────────────────────────── */
.site-header { transition: box-shadow .2s ease; }
.site-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,.1); }

/* ── Breadcrumb animated separator ──────────────────────────────────────── */
.breadcrumb .sep { opacity: .4; margin: 0 4px; }

/* ── Quantity control press feedback ─────────────────────────────────────── */
.qty-control button:active { transform: scale(.88); }

/* ── Cart Drawer ───────────────────────────────────────────────────── */
.cart-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 9998;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed; top: 0; right: -400px; width: 400px; height: 100%;
  background: white; z-index: 9999;
  display: flex; flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.cart-drawer.open { right: 0; }

.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--c-border);
  background: white; position: sticky; top: 0; z-index: 1;
}
.cart-drawer-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.cart-drawer-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--c-muted); padding: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: all 0.2s ease;
}
.cart-drawer-close:hover { background: var(--c-gray-50); color: var(--c-text); }

.cart-drawer-body {
  flex: 1; overflow-y: auto; padding: 0;
}

.cart-drawer-footer {
  padding: 20px; border-top: 1px solid var(--c-border);
  background: white; position: sticky; bottom: 0;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .cart-drawer { width: 100%; right: -100%; }
}

/* ── Cart Dual Pricing ───────────────────────────────────────────── */
.cart-item-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-price-current {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-green);
}

.cart-price-original {
  font-size: 12px;
  color: var(--c-muted);
  text-decoration: line-through;
  font-weight: 400;
}

.cart-price-discount {
  font-size: 10px;
  font-weight: 700;
  color: var(--c-red);
  background: var(--c-red);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

/* ── Order status badge shimmer on pending ───────────────────────────────── */
@keyframes statusPulse { 0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.4)} 70%{box-shadow:0 0 0 8px rgba(245,158,11,0)} }
.status-pending { animation: statusPulse 2s ease infinite; }

/* ── Scroll-reveal fade (add .reveal class via JS IntersectionObserver) ──── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Cart count bounce ───────────────────────────────────────────────────── */
@keyframes countBounce { 0%{transform:scale(1)} 50%{transform:scale(1.5)} 100%{transform:scale(1)} }
.cart-count-bump { animation: countBounce .3s ease; }

/* ── Image lazy-load fade ────────────────────────────────────────────────── */
img.lazy { opacity: 0; transition: opacity .4s ease; }
img.lazy.loaded { opacity: 1; }
