/* ==========================================================
   Sarthak Enterprises - Storefront styles (App UI, v2)
   A phone-app shell: centered fixed-width column, sticky top bar,
   sticky bottom tab bar, everything else built from rounded cards.
   ========================================================== */

:root{
  --navy: #163A4D;
  --navy-dark: #0E2733;
  --navy-soft: #1F4A61;
  --orange: #F2A93B;
  --orange-dark: #E0952A;
  --peach: #FBEEDD;
  --peach-text: #9A5B1E;
  --cream: #F3F0E8;
  --white: #FFFFFF;
  --text: #1C2B33;
  --muted: #6C7B84;
  --border: #EAE5D8;
  --danger: #D64545;
  --success: #2E9E5B;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(22,58,77,0.10);
  --shell-w: 440px;
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html,body{ margin:0; padding:0; height:100%; }
body{
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: #DCE3E1;
  color: var(--text);
  line-height: 1.5;
}
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ color: var(--navy); margin: 0 0 .4em; font-weight: 800; }
p{ margin: 0 0 1em; color: var(--muted); }
button{ font-family: inherit; }

/* ---------- App shell ---------- */
.app-shell{
  max-width: var(--shell-w);
  margin: 0 auto;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(22,58,77,0.05), 0 30px 70px rgba(14,39,51,0.28);
  -ms-overflow-style: none;
  scrollbar-width: thin;
}
.app-content{ padding: 0 20px 110px; min-height: calc(100% - 1px); }
.container{ max-width: none; margin: 0; padding: 0 20px; } /* legacy alias kept for older markup */

/* ---------- Top bar ---------- */
.app-topbar{
  position: sticky; top:0; z-index: 20; background: var(--cream);
  padding: 18px 20px 6px; display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.app-topbar .greet strong{ display:block; color: var(--navy); font-size:1.15rem; }
.app-topbar .greet span{ color: var(--muted); font-size:.78rem; }
.icon-btn{
  width:42px; height:42px; border-radius: 14px; background:#fff; border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color: var(--navy); position:relative; flex-shrink:0;
}
.icon-btn .dot{ position:absolute; top:8px; right:8px; width:7px; height:7px; border-radius:50%; background: var(--orange); }
.topbar-actions{ display:flex; gap:10px; }

/* ---------- Bottom tab bar ---------- */
.bottom-nav{
  position: sticky; bottom:0; z-index: 30; background: #fff;
  border-top: 1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(22,58,77,0.08);
}
.bottom-nav a{
  display:flex; flex-direction:column; align-items:center; gap:4px; color: #9AA7AD;
  font-size:.62rem; font-weight:700; width:44px;
}
.bottom-nav a.active{ color: var(--navy); }
.bottom-nav a .tab-dot{ width:4px; height:4px; border-radius:50%; background: transparent; }
.bottom-nav a.active .tab-dot{ background: var(--orange); }
.bottom-nav a svg{ width:22px; height:22px; }
.bottom-nav .tab-cart{
  width:56px; height:56px; border-radius: 50%; background: var(--orange); color: var(--navy-dark);
  display:flex; align-items:center; justify-content:center; margin-top:-30px;
  box-shadow: 0 10px 20px rgba(242,169,59,0.45); position:relative; flex-shrink:0;
}
.bottom-nav .tab-cart svg{ width:24px; height:24px; }
.bottom-nav .tab-cart .cart-count{
  position:absolute; top:-4px; right:-4px; background: var(--navy); color:#fff; font-size:.62rem; font-weight:800;
  border-radius:999px; min-width:18px; height:18px; display:flex; align-items:center; justify-content:center; padding:0 4px;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 13px 22px; border-radius: 16px; font-weight:700; font-size:.92rem;
  border: 2px solid transparent; cursor:pointer; transition: all .15s ease;
}
.btn-sm{ padding: 9px 16px; font-size:.82rem; border-radius:12px; }
.btn-primary{ background: var(--orange); color: var(--navy-dark); }
.btn-primary:hover{ background: var(--orange-dark); }
.btn-outline{ background: #fff; border-color: var(--border); color: var(--navy); }
.btn-outline:hover{ border-color: var(--navy); }
.btn-dark{ background: var(--navy); color: #fff; }
.btn-dark:hover{ background: var(--navy-dark); }
.btn-danger{ background: #FBE7E7; color: var(--danger); border-color:#F3C9C9; }
.btn-block{ width:100%; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ---------- Cards (base building block) ---------- */
.card{ background:#fff; border-radius: var(--radius-lg); padding: 20px; box-shadow: 0 4px 18px rgba(22,58,77,0.06); border:1px solid var(--border); }
.card + .card{ margin-top: 14px; }

/* ---------- Flash messages ---------- */
.flash{ margin: 14px 0; padding: 13px 18px; border-radius: var(--radius-sm); font-weight:600; font-size:.85rem; }
.flash-success{ background:#E4F6EC; color: var(--success); }
.flash-error{ background:#FBE7E7; color: var(--danger); }
.flash-info{ background:#E7F0F8; color: var(--navy); }

/* ---------- Hero card (home) ---------- */
.hero{
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  border-radius: var(--radius-xl); color:#fff; padding: 26px 24px; margin: 6px 0 18px;
  position: relative; overflow: hidden;
}
.hero::after{
  content:""; position:absolute; right:-50px; top:-60px; width:200px; height:200px; border-radius:50%;
  background: rgba(242,169,59,0.16);
}
.hero h1{ color:#fff; font-size: 1.35rem; max-width: 320px; margin-bottom: .3em; position:relative; }
.hero span{ color: var(--orange); }
.hero p{ color: #CFE0E8; font-size:.85rem; margin-bottom:16px; position:relative; }
.hero-stats{ display:flex; gap: 22px; position:relative; }
.hero-stats div strong{ display:block; font-size:1.25rem; color: var(--orange); }
.hero-stats div small{ color:#CFE0E8; font-size:.68rem; }

/* ---------- Search ---------- */
.search-card{ display:flex; background:#fff; border-radius: 16px; border:1px solid var(--border); overflow:hidden; margin-bottom:18px; }
.search-card input{ flex:1; border:0; background:transparent; padding: 13px 16px; font-size:.88rem; outline:none; }
.search-card button{ border:0; background: var(--navy); color:#fff; padding: 0 16px; cursor:pointer; }

/* ---------- Section heading ---------- */
.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin: 6px 0 12px; }
.section-head h2{ margin:0; font-size:1.05rem; }
.section-head span{ color: var(--muted); font-size:.78rem; }
.section-head a{ color: var(--orange-dark); font-weight:700; font-size:.8rem; }

/* ---------- Category cards ---------- */
#categories{ scroll-margin-top: 80px; }
.category-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.category-card{
  border-radius: var(--radius-md); padding: 16px; min-height: 96px; display:flex; flex-direction:column; justify-content:space-between;
  position:relative; overflow:hidden;
}
.category-card strong{ font-size:.88rem; line-height:1.25; }
.category-card small{ font-size:.7rem; opacity:.75; }
.category-card.tone-navy{ background: var(--navy); color:#fff; }
.category-card.tone-navy strong{ color:#fff; }
.category-card.tone-peach{ background: var(--peach); color: var(--peach-text); }
.category-card.tone-peach strong{ color: var(--navy); }
.category-card.tone-cream{ background:#fff; border:1px solid var(--border); color: var(--muted); }
.category-card.tone-cream strong{ color: var(--navy); }
.category-card.active{ outline: 2px solid var(--orange); }
.chip-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 18px; }
.chip{ padding: 8px 14px; border-radius: 999px; background:#fff; border:1px solid var(--border); font-weight:600; font-size:.78rem; color: var(--navy); }
.chip.active{ background: var(--navy); color:#fff; border-color: var(--navy); }

/* ---------- Product grid / cards ---------- */
.product-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.product-card{
  background:#fff; border-radius: var(--radius-md); overflow:hidden; border:1px solid var(--border);
  box-shadow: 0 4px 14px rgba(22,58,77,0.05); display:flex; flex-direction:column;
}
.product-card .thumb{ background: var(--cream); aspect-ratio: 1/1; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.product-card .thumb img{ width:100%; height:100%; object-fit: cover; }
.product-card .body{ padding: 12px; display:flex; flex-direction:column; gap:4px; flex:1; }
.product-card .cat{ font-size:.62rem; text-transform:uppercase; letter-spacing:.05em; color: var(--orange-dark); font-weight:800; }
.product-card h3{ font-size:.88rem; margin:0; line-height:1.25; }
.product-card .meta{ font-size:.7rem; color: var(--muted); }
.product-card .price-row{ display:flex; align-items:center; justify-content:space-between; margin-top:auto; padding-top:8px; }
.product-card .price{ font-weight:800; color: var(--navy); font-size:.85rem; }
.product-card .price small{ display:block; color: var(--muted); font-weight:500; font-size:.62rem; }
.badge-stock{ font-size:.6rem; font-weight:800; padding: 3px 8px; border-radius:999px; white-space:nowrap; }
.badge-in{ background:#E4F6EC; color: var(--success); }
.badge-low{ background:#FDF1DC; color: var(--orange-dark); }
.badge-out{ background:#FBE7E7; color: var(--danger); }

.empty-state{ text-align:center; padding: 50px 20px; color: var(--muted); }
.empty-state .btn{ margin-top:6px; }

/* ---------- Product detail ---------- */
.product-detail{ padding-top: 6px; }
.thumb-lg{ background:#fff; border:1px solid var(--border); border-radius: var(--radius-xl); overflow:hidden; aspect-ratio: 1/1; margin-bottom:16px; box-shadow: var(--shadow); }
.thumb-lg img{ width:100%; height:100%; object-fit:cover; }
.product-info .cat{ font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color: var(--orange-dark); font-weight:800; }
.product-info h1{ margin:.2em 0; font-size:1.4rem; }
.product-info .desc{ margin-bottom: 4px; font-size:.86rem; }
.selector-group{ margin: 16px 0; }
.selector-group label{ display:block; font-weight:800; margin-bottom:8px; font-size:.8rem; color: var(--navy); }
.pill-select{ display:flex; flex-wrap:wrap; gap:8px; }
.pill-select .pill{
  padding: 9px 15px; border-radius: 12px; border: 2px solid var(--border); background:#fff;
  font-weight:700; font-size:.82rem; cursor:pointer; color: var(--text);
}
.pill-select .pill.selected{ border-color: var(--orange); background:#FFF6E7; color: var(--navy); }
.pill-select .pill.disabled{ opacity:.35; text-decoration: line-through; cursor:not-allowed; }
.variant-summary{ background: var(--navy); color:#fff; border-radius: var(--radius-md); padding: 16px 18px; margin: 16px 0; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.variant-summary .price{ font-size:1.3rem; font-weight:800; color:#fff; }
.variant-summary .price + div{ font-size:.72rem; color:#CFE0E8; }
.qty-input{ display:flex; align-items:center; border:2px solid var(--border); border-radius: 12px; overflow:hidden; width: fit-content; background:#fff; }
.qty-input button{ background: var(--cream); border:0; width:36px; height:40px; font-size:1.1rem; cursor:pointer; }
.qty-input input{ width: 52px; border:0; text-align:center; font-weight:700; font-size:.95rem; }
.add-cart-row{ display:flex; gap: 12px; align-items:center; margin-top: 16px; flex-wrap:wrap; }

/* ---------- Forms ---------- */
.form-card{ background:#fff; border-radius: var(--radius-lg); border:1px solid var(--border); padding: 26px 22px; margin: 10px 0 20px; box-shadow: var(--shadow); }
.form-card.wide{ max-width: none; }
.form-card h1{ font-size: 1.25rem; text-align:center; }
.form-card > p.subtitle{ text-align:center; margin-bottom: 20px; font-size:.85rem; }
.form-row{ margin-bottom: 14px; }
.form-row label{ display:block; font-weight:700; font-size:.8rem; margin-bottom:6px; color: var(--navy); }
.form-row input, .form-row select, .form-row textarea{
  width:100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  font-size:.9rem; font-family: inherit; outline:none; background:#fbfaf7;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus{ border-color: var(--orange); background:#fff; }
.form-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap: 12px; }
.form-foot{ text-align:center; margin-top: 16px; font-size:.85rem; color: var(--muted); }
.form-foot a{ color: var(--orange-dark); font-weight:700; }
.field-error{ color: var(--danger); font-size:.74rem; margin-top:4px; }

/* ---------- Cart (card list, not table) ---------- */
.cart-item-card{ display:flex; gap:12px; padding:14px; background:#fff; border-radius: var(--radius-md); border:1px solid var(--border); margin-bottom:12px; align-items:center; }
.cart-item-card img{ width:64px; height:64px; object-fit:cover; border-radius: 12px; background: var(--cream); flex-shrink:0; }
.cart-item-card .info{ flex:1; min-width:0; }
.cart-item-card .info strong{ display:block; font-size:.88rem; }
.cart-item-card .info small{ color: var(--muted); font-size:.74rem; }
.cart-item-card .row-bottom{ display:flex; align-items:center; justify-content:space-between; margin-top:8px; gap:8px; }
.cart-item-card .subtotal{ font-weight:800; color: var(--navy); font-size:.85rem; }
.remove-link{ color: var(--danger); font-size:.75rem; font-weight:700; background:none; border:0; cursor:pointer; padding:0; }
.cart-summary{ background: var(--navy); color:#fff; border-radius: var(--radius-lg); padding: 20px; margin-top: 16px; }
.cart-summary .row{ display:flex; justify-content:space-between; margin-bottom:8px; font-size:.85rem; color:#CFE0E8; }
.cart-summary .total{ font-weight:800; font-size:1.1rem; color:#fff; border-top:1px solid rgba(255,255,255,.15); padding-top:10px; margin-top:4px; }

/* ---------- Account / Orders ---------- */
.account-hero{ display:flex; align-items:center; gap:14px; margin: 4px 0 18px; }
.avatar-circle{ width:56px; height:56px; border-radius:18px; background: var(--navy); color: var(--orange); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:1.1rem; flex-shrink:0; }
.account-hero strong{ display:block; color: var(--navy); font-size:1.05rem; }
.account-hero span{ color: var(--muted); font-size:.78rem; }
.info-list{ display:flex; flex-direction:column; gap:2px; margin-bottom: 4px; }
.info-list .muted{ font-size:.82rem; color: var(--muted); }

.order-card{ background:#fff; border-radius: var(--radius-md); border:1px solid var(--border); padding: 16px 18px; margin-bottom: 12px; }
.order-card .order-head{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom: 8px; }
.order-card .order-head strong{ color: var(--navy); font-size:.88rem; }
.status-pill{ font-size:.66rem; font-weight:800; padding: 4px 11px; border-radius:999px; text-transform:capitalize; }
.status-pending{ background:#FDF1DC; color:#B4750E; }
.status-confirmed{ background:#E7F0F8; color:#2C5F8A; }
.status-processing{ background:#EFE7FB; color:#6A3FBE; }
.status-shipped{ background:#E1F1FB; color:#1A7FB0; }
.status-delivered{ background:#E4F6EC; color: var(--success); }
.status-cancelled{ background:#FBE7E7; color: var(--danger); }
.order-items-list{ font-size:.78rem; color: var(--muted); }
.order-items-list li{ display:flex; justify-content:space-between; padding: 3px 0; }

@media (min-width: 720px){
  .product-grid{ grid-template-columns: repeat(2, 1fr); }
}
