/* Flipkart Clone Styles */
:root[data-theme="light"] {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --header-bg: #2874f0;
  --header-fg: #ffffff;
  --text: #212121;
  --text-muted: #878787;
  --border: #e0e0e0;
  --accent: #2874f0;
  --accent-yellow: #ffe500;
  --price: #212121;
  --discount: #388e3c;
  --orange: #fb641b;
  --orange-2: #ff9f00;
  --rating-green: #388e3c;
  --shadow: 0 1px 2px rgba(0,0,0,0.1);
}
:root[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #1a1f25;
  --surface-2: #232a32;
  --header-bg: #1565c0;
  --header-fg: #ffffff;
  --text: #e8e8e8;
  --text-muted: #9aa0a6;
  --border: #2c343d;
  --accent: #4d8df5;
  --accent-yellow: #ffe500;
  --price: #ffffff;
  --discount: #66bb6a;
  --orange: #ff7a3d;
  --orange-2: #ffab40;
  --rating-green: #66bb6a;
  --shadow: 0 1px 2px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: 'Roboto', 'Inter', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Header */
.fk-header {
  background: var(--header-bg);
  color: var(--header-fg);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.fk-header-inner {
  max-width: 1500px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 8px 24px; height: 56px;
}
.fk-logo { display: flex; flex-direction: column; line-height: 1; cursor: pointer; }
.fk-logo .brand {
  font-style: italic; font-weight: 700; font-size: 22px;
  color: #fff; letter-spacing: -0.5px;
}
.fk-logo .brand span { color: var(--accent-yellow); }
.fk-logo .tag {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; font-style: italic; color: #fff;
}
.fk-logo .tag em { color: var(--accent-yellow); font-weight: 600; }
.fk-logo .tag::after {
  content: ''; width: 9px; height: 9px;
  background: gold; border-radius: 50%;
  margin-left: 2px;
}

.fk-search {
  flex: 1; max-width: 700px; position: relative;
  background: #fff; border-radius: 2px;
  display: flex; align-items: center; height: 36px;
  padding: 0 12px;
}
.fk-search input {
  flex: 1; border: none; outline: none;
  background: transparent; font-size: 14px;
  color: #212121;
}
.fk-search .search-icon { color: var(--accent); margin-right: 10px; font-size: 18px; }

.fk-header-actions { display: flex; align-items: center; gap: 28px; font-weight: 500; font-size: 14px; }
.fk-header-actions .btn-login {
  background: #fff; color: var(--accent);
  padding: 6px 30px; font-weight: 600;
  border: 1px solid transparent;
}
.fk-header-actions .link {
  color: #fff; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.fk-header-actions .cart-badge {
  background: var(--orange); color: #fff;
  padding: 0 6px; border-radius: 10px;
  font-size: 11px; min-width: 18px; text-align: center;
  margin-left: 4px;
}

/* Category strip */
.fk-cats {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 99;
}
.fk-cats-inner {
  max-width: 1500px; margin: 0 auto;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 8px 24px; scrollbar-width: none;
}
.fk-cats-inner::-webkit-scrollbar { display: none; }
.fk-cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 90px; padding: 6px 10px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; border-radius: 4px;
  position: relative;
}
.fk-cat:hover { color: var(--accent); }
.fk-cat.active { color: var(--accent); }
.fk-cat.active::after {
  content: ''; position: absolute; bottom: -8px; left: 20%; right: 20%;
  height: 3px; background: var(--accent); border-radius: 2px;
}
.fk-cat .icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.fk-cat.active .icon {
  background: rgba(40,116,240,0.08); border-radius: 8px;
}

/* Page container */
.fk-main { max-width: 1500px; margin: 0 auto; padding: 16px 24px; }

/* Banners */
.banner-row { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 8px; margin-bottom: 12px; }
.banner {
  background: var(--surface); border-radius: 4px;
  overflow: hidden; aspect-ratio: 16/6;
  position: relative; cursor: pointer;
  display: flex; align-items: center; padding: 24px;
  color: #fff; font-weight: 700;
}
.banner.b1 { background: linear-gradient(120deg, #1a1a2e 0%, #16213e 60%, #c9a66b 100%); }
.banner.b2 { background: linear-gradient(120deg, #0a0a23 0%, #0f3460 50%, #e94560 100%); }
.banner.b3 { background: #d8f0ff; color: #003a6c; aspect-ratio: 8/6; }
.banner h3 { margin: 0 0 6px; font-size: 22px; }
.banner p { margin: 0; font-size: 13px; opacity: 0.9; font-weight: 400; }

/* Section card (Popular picks etc.) */
.section-card {
  background: var(--surface); border-radius: 4px;
  margin-bottom: 12px; overflow: hidden;
  box-shadow: var(--shadow);
}
.section-card.themed-blue { background: #2874f0; color: #fff; padding: 16px; }
.section-card.themed-orange { background: #ff5722; color: #fff; padding: 16px; }
.section-card .sc-title {
  font-size: 22px; font-weight: 600; margin: 0 0 14px;
  padding: 0 4px;
}
.section-card .sc-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  background: #fff; border-radius: 4px; padding: 10px;
}
.section-card.themed-blue .sc-grid,
.section-card.themed-orange .sc-grid { background: #fff; }
.sc-tile { padding: 10px; cursor: pointer; border-radius: 4px; transition: transform .15s; color: #212121; }
.sc-tile:hover { transform: translateY(-2px); }
.sc-tile img { aspect-ratio: 1; object-fit: contain; background: #f5f5f5; border-radius: 4px; padding: 12px; }
.sc-tile .label { margin-top: 8px; font-weight: 500; font-size: 14px; }
.sc-tile .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.section-plain { background: var(--surface); padding: 16px; border-radius: 4px; margin-bottom: 12px; }
.section-plain h2 { margin: 0 0 14px; font-size: 22px; font-weight: 600; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--surface); border-radius: 4px; }
.product-card {
  padding: 16px; cursor: pointer; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  position: relative; transition: box-shadow .15s; min-width: 0;
}
.product-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); z-index: 2; }
.product-card .img-wrap {
  aspect-ratio: 1; background: var(--surface); display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; position: relative;
}
.product-card img { max-height: 100%; object-fit: contain; }
.product-card .wishlist-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); font-size: 18px;
  z-index: 3;
}
.product-card .wishlist-btn.active { color: #ff3e6c; }
.product-card .rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.product-card .rating {
  background: var(--rating-green); color: #fff; padding: 2px 5px; border-radius: 3px;
  font-weight: 600; display: inline-flex; align-items: center; gap: 2px;
}
.product-card .rating-count { color: var(--text-muted); font-weight: 500; }
.product-card .name {
  font-size: 14px; font-weight: 500; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 36px;
}
.product-card .brand { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; }
.product-card .price { font-size: 16px; font-weight: 600; color: var(--price); }
.product-card .mrp { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.product-card .discount { font-size: 13px; color: var(--discount); font-weight: 500; }
.product-card .bank-offer { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* Product detail */
.pdp { display: grid; grid-template-columns: 5fr 7fr; gap: 0; background: var(--surface); }
.pdp-left { padding: 20px; position: sticky; top: 120px; align-self: start; }
.pdp-img-main {
  aspect-ratio: 1; background: var(--surface); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); padding: 20px;
}
.pdp-img-main img { max-height: 100%; object-fit: contain; }
.pdp-cta-row { display: flex; gap: 12px; margin-top: 20px; }
.btn-cart, .btn-buy {
  flex: 1; padding: 14px; font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.btn-cart { background: var(--orange-2); color: #fff; }
.btn-buy { background: var(--orange); color: #fff; }
.pdp-right { padding: 20px; border-left: 1px solid var(--border); }
.pdp-right h1 { font-size: 18px; font-weight: 400; margin: 0 0 8px; }
.pdp-rating-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.pdp-price { font-size: 28px; font-weight: 500; margin: 8px 0; color: var(--price); }
.pdp-mrp { color: var(--text-muted); text-decoration: line-through; font-size: 16px; font-weight: 400; margin-left: 8px; }
.pdp-discount { color: var(--discount); font-size: 16px; font-weight: 500; margin-left: 6px; }
.pdp-section { margin-top: 18px; }
.pdp-section h3 { font-size: 14px; color: var(--text-muted); margin: 0 0 8px; font-weight: 500; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 8fr 4fr; gap: 12px; }
.cart-list { background: var(--surface); border-radius: 4px; }
.cart-item { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 20px; border-bottom: 1px solid var(--border); }
.cart-item img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.qty-control { display: inline-flex; align-items: center; gap: 0; margin-top: 8px; }
.qty-control button {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 16px; font-weight: 600;
}
.qty-control input {
  width: 40px; height: 28px; text-align: center; border: 1px solid var(--border);
  margin: 0 4px; background: var(--surface); color: var(--text);
}
.summary { background: var(--surface); border-radius: 4px; padding: 20px; align-self: start; position: sticky; top: 120px; }
.summary h3 { margin: 0 0 16px; color: var(--text-muted); font-size: 16px; font-weight: 500; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; margin: 12px 0; }
.summary-row.total { font-weight: 700; font-size: 18px; padding-top: 12px; border-top: 1px dashed var(--border); }
.btn-place { width: 100%; background: var(--orange); color: #fff; padding: 14px; font-size: 16px; font-weight: 500; border-radius: 2px; margin-top: 12px; }

/* Checkout */
.checkout-step { background: var(--surface); border-radius: 4px; margin-bottom: 12px; padding: 20px; }
.checkout-step h2 { margin: 0 0 12px; font-size: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 12px; color: var(--text-muted); }
.form-field input, .form-field textarea, .form-field select {
  padding: 10px; border: 1px solid var(--border); border-radius: 2px;
  background: var(--surface); color: var(--text); font: inherit;
}
.pay-method-accordion { border: 1px solid var(--border); border-top: none; }
.pay-method-box { border-top: 1px solid var(--border); cursor: pointer; background: var(--surface); transition: background 0.2s; }
.pay-method-box.selected { background: #f5faff; }
.pay-method-header { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.pay-method-header input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.pay-method-header .pay-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.pay-method-body { padding: 0 20px 20px 66px; }

/* QR Modal */
.qr-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.qr-card { background: var(--surface); border-radius: 8px; padding: 32px; max-width: 420px; width: 100%; text-align: center; }
.qr-card h2 { margin: 0 0 8px; }
.qr-card .amount { font-size: 28px; font-weight: 700; color: var(--accent); margin: 8px 0 16px; }
.qr-canvas-wrap { background: #fff; padding: 16px; border-radius: 8px; display: inline-block; margin: 12px 0; }
.qr-card .upi-id { font-family: monospace; background: var(--surface-2); padding: 8px; border-radius: 4px; font-size: 13px; }
.qr-card .timer { color: var(--orange); font-weight: 500; margin-top: 8px; }

/* Login */
.auth-page { display: grid; grid-template-columns: 5fr 7fr; min-height: 500px; max-width: 750px; margin: 40px auto; background: var(--surface); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); }
.auth-side { background: var(--accent); color: #fff; padding: 36px 32px; }
.auth-side h2 { font-size: 28px; margin: 0 0 16px; }
.auth-side p { color: rgba(255,255,255,0.85); }
.auth-form { padding: 36px 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-form input { padding: 14px 8px; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; outline: none; }
.auth-form input:focus { border-bottom-color: var(--accent); }
.auth-form .btn-primary { background: var(--orange); color: #fff; padding: 14px; font-weight: 500; border-radius: 2px; margin-top: 12px; }
.auth-form .btn-secondary { background: var(--surface); color: var(--accent); padding: 14px; font-weight: 500; border-radius: 2px; box-shadow: var(--shadow); }
.auth-error { color: #d32f2f; font-size: 13px; }

/* Filter sidebar */
.listing-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; }
.filters { background: var(--surface); border-radius: 4px; padding: 16px; align-self: start; position: sticky; top: 120px; }
.filters h3 { margin: 0 0 12px; font-size: 16px; }
.filter-group { padding: 12px 0; border-top: 1px solid var(--border); }
.filter-group h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.filter-option { display: flex; align-items: center; gap: 6px; padding: 4px 0; cursor: pointer; font-size: 14px; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side { background: #1e2530; color: #fff; padding: 24px 0; }
.admin-side .brand { padding: 0 24px 24px; font-weight: 700; font-size: 18px; border-bottom: 1px solid #2c343d; margin-bottom: 12px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 12px 24px; color: #c9d1d9; cursor: pointer; }
.admin-side a:hover, .admin-side a.active { background: #2c343d; color: #fff; border-left: 3px solid var(--accent-yellow); padding-left: 21px; }
.admin-main { padding: 28px; background: var(--bg); }
.admin-card { background: var(--surface); border-radius: 8px; padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.admin-card h2 { margin: 0 0 16px; }
.admin-stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border-radius: 8px; padding: 20px; box-shadow: var(--shadow); }
.stat-card .label { color: var(--text-muted); font-size: 13px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }

.dropzone { border: 2px dashed var(--border); border-radius: 8px; padding: 32px; text-align: center; cursor: pointer; transition: background .15s; }
.dropzone.over { background: rgba(40,116,240,0.05); border-color: var(--accent); }
.dropzone img { max-width: 200px; max-height: 200px; margin-top: 12px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table th { background: var(--surface-2); font-weight: 600; color: var(--text-muted); }
.admin-table img { width: 50px; height: 50px; object-fit: contain; }

.btn-primary { background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 4px; font-weight: 500; }
.btn-danger { background: #d32f2f; color: #fff; padding: 6px 12px; border-radius: 4px; font-size: 12px; }
.btn-edit { background: var(--orange-2); color: #fff; padding: 6px 12px; border-radius: 4px; font-size: 12px; margin-right: 4px; }

/* Order confirmation */
.order-confirm { max-width: 720px; margin: 40px auto; background: var(--surface); border-radius: 8px; padding: 32px; text-align: center; box-shadow: var(--shadow); }
.order-confirm .check { width: 80px; height: 80px; border-radius: 50%; background: #e8f5e9; color: var(--discount); display: flex; align-items: center; justify-content: center; font-size: 48px; margin: 0 auto 16px; }
.order-confirm h1 { margin: 0 0 8px; color: var(--discount); }
.order-confirm .order-id { font-family: monospace; background: var(--surface-2); padding: 8px 16px; border-radius: 4px; display: inline-block; margin: 12px 0; }

/* Orders list */
.order-card { background: var(--surface); border-radius: 4px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.order-card .order-head { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.order-item-mini { display: flex; gap: 12px; padding: 8px 0; }
.order-item-mini img { width: 60px; height: 60px; object-fit: contain; }

/* Footer */
.fk-footer { background: #172337; color: #fff; padding: 40px 24px 0; margin-top: 40px; }
.footer-inner { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr) 2fr; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #2c343d; }
.footer-col h5 { color: #878787; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 12px; }
.footer-col a { display: block; color: #fff; padding: 4px 0; font-size: 13px; opacity: 0.9; }
.footer-bottom { max-width: 1500px; margin: 0 auto; padding: 16px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.footer-bottom .links { display: flex; gap: 24px; }

/* Theme toggle */
.theme-toggle { background: rgba(255,255,255,0.15); padding: 6px 10px; border-radius: 16px; font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Empty states */
.empty-state { text-align: center; padding: 60px 20px; background: var(--surface); border-radius: 4px; }
.empty-state .icon { font-size: 60px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { color: var(--text-muted); margin: 0 0 16px; }

/* Listing toolbar */
.listing-toolbar { background: var(--surface); padding: 12px 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; border-radius: 4px; }
.sort-pills { display: flex; gap: 4px; }
.sort-pill { padding: 6px 12px; font-size: 13px; cursor: pointer; border-radius: 16px; }
.sort-pill.active { background: var(--accent); color: #fff; }

/* Responsive */
@media (max-width: 1024px) {
  .pdp, .cart-layout, .listing-layout, .auth-page { grid-template-columns: minmax(0, 1fr); }
  .product-grid, .section-card .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner-row { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Multi-image gallery (PDP carousel + thumbnails)
   ============================================================ */
.pdp-carousel { position: relative; max-width: 100%; }
.pdp-carousel img { width: 100%; max-height: 460px; object-fit: contain; touch-action: pan-y; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.9); border: 1px solid var(--border);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); user-select: none;
}
.carousel-arrow.left { left: 8px; } .carousel-arrow.right { right: 8px; }
.carousel-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; }
.carousel-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,.25); cursor: pointer; }
.carousel-dots .dot.active { background: var(--accent); transform: scale(1.25); }
.pdp-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.pdp-thumb { flex: 0 0 64px; height: 64px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; padding: 4px; background: #fff; }
.pdp-thumb.active { border-color: var(--accent); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ============================================================
   Skeleton loaders
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  border-radius: 4px;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { padding: 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.skeleton-card .img { height: 160px; margin-bottom: 10px; }
.skeleton-card .line { height: 12px; margin: 6px 0; }
.skeleton-card .line.short { width: 50%; }

/* ============================================================
   Mobile-first responsive overrides (Flipkart-like)
   Strategy:
   - Hard-cap viewport width (no horizontal scroll anywhere).
   - Force every grid/flex child to have min-width:0 so long content
     can't blow out columns.
   - Tight padding, 2-column product grid, smooth horizontal scrolls
     for chips/categories, sticky compact header + bottom nav.
   ============================================================ */
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
html, body { max-width: 100vw; overflow-x: hidden; }
/* Universal safety net: kill any horizontal overflow on small viewports.
   Long unbroken strings (URLs, model numbers, hashes) inherit a sane wrap. */
@media (max-width: 820px) {
  html, body, #root { width: 100%; max-width: 100vw; overflow-x: hidden; }
  body { word-wrap: break-word; overflow-wrap: anywhere; }
  table { display: block; overflow-x: auto; max-width: 100%; }
}

@media (max-width: 820px) {
  /* Tighter page padding so cards have room to breathe */
  .fk-main { padding: 8px !important; max-width: 100vw !important; width: 100%; }

  /* Force every grid/flex item on mobile to allow shrinking. Without this,
     CSS Grid items default to min-width:auto and any wide child (e.g. a long
     product name) makes the whole column overflow the viewport. */
  .listing-layout > *,
  .product-grid > *,
  .section-card .sc-grid > *,
  .cart-layout > *,
  .pdp > *,
  .form-row > *,
  .banner-row > *,
  .footer-inner > *,
  .fk-header-inner > *,
  .listing-toolbar > * { min-width: 0; }
  .listing-layout, .product-grid, .section-card .sc-grid,
  .cart-layout, .pdp, .form-row, .banner-row, .footer-inner,
  .listing-toolbar, .listing-toolbar > section { min-width: 0; max-width: 100%; }

  /* Sticky compact header --------------------------------------- */
  .fk-header { position: sticky; top: 0; z-index: 50; }
  .fk-header-inner {
    padding: 8px 10px !important; gap: 8px !important;
    flex-wrap: wrap; height: auto !important; min-height: 56px;
  }
  .fk-logo .tag { display: none; }
  .fk-logo .brand { font-size: 18px; }
  .fk-search { flex: 1 1 100%; order: 3; min-width: 0; height: 38px; }
  .fk-search input { font-size: 14px; padding: 0; min-width: 0; }
  .fk-header-actions { gap: 16px; flex-wrap: nowrap; }
  .fk-header-actions .btn-login { padding: 5px 14px; font-size: 13px; }
  .fk-header-actions .link span:not(.cart-badge) + span,
  .fk-header-actions .theme-toggle { display: none; }

  /* Category strip --------------------------------------------- */
  .fk-cats { top: 56px; }
  .fk-cats-inner {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 6px 8px; gap: 4px;
  }
  .fk-cat {
    flex: 0 0 auto; min-width: 72px; padding: 6px 6px;
    font-size: 11px; scroll-snap-align: start;
  }
  .fk-cat .icon { width: 44px; height: 44px; font-size: 26px; }
  .fk-cat.active::after { bottom: -6px; height: 2px; }

  /* Banners stack ---------------------------------------------- */
  .banner-row { grid-template-columns: 1fr !important; gap: 8px; margin-bottom: 8px; }
  .banner { aspect-ratio: 16/8; padding: 16px; }
  .banner.b3 { aspect-ratio: 16/8; }
  .banner h3 { font-size: 18px; }

  /* Section cards (Popular picks etc.) ------------------------- */
  .section-card { margin-bottom: 8px; }
  .section-card.themed-blue,
  .section-card.themed-orange { padding: 12px; }
  .section-card .sc-title { font-size: 16px; margin: 0 0 10px; }
  .section-card .sc-grid {
    grid-template-columns: repeat(2, 1fr) !important; gap: 6px; padding: 6px;
  }
  .sc-tile { padding: 6px; min-width: 0; }
  .sc-tile img { padding: 6px; }
  .sc-tile .label { font-size: 13px; }
  .section-plain { padding: 12px; }
  .section-plain h2 { font-size: 16px; }

  /* Product grid: strict 2 cols, no overflow ------------------- */
  .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    width: 100%; max-width: 100%; min-width: 0;
    box-sizing: border-box;
  }
  .product-card {
    padding: 8px !important;
    min-width: 0;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    background: var(--surface);
  }
  .product-card .img-wrap {
    aspect-ratio: 1; height: auto; margin-bottom: 8px;
    background: var(--surface);
  }
  .product-card .img-wrap img {
    width: 100%; height: 100%; max-height: none; object-fit: contain;
  }
  .product-card .brand { font-size: 11px; }
  .product-card .name {
    font-size: 12px; line-height: 1.3; min-height: 32px;
    -webkit-line-clamp: 2; word-break: break-word; overflow-wrap: anywhere;
  }
  .product-card .brand,
  .product-card .name,
  .product-card .price-row,
  .product-card .bank-offer,
  .product-card .rating-row { max-width: 100%; overflow: hidden; }
  .product-card .price-row { flex-wrap: wrap; }
  .product-card .price { font-size: 14px; }
  .product-card .mrp, .product-card .discount { font-size: 11px; }
  .product-card .bank-offer { font-size: 11px; }
  .product-card .rating-row { font-size: 11px; gap: 4px; }
  .product-card .rating { padding: 1px 4px; }
  .product-card .wishlist-btn { width: 28px; height: 28px; font-size: 14px; top: 6px; right: 6px; }

  /* Listing page ----------------------------------------------- */
  .listing-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
  .listing-layout > section { min-width: 0; max-width: 100%; overflow: hidden; }
  .filters { display: none; }
  .listing-toolbar {
    position: sticky; top: 96px; z-index: 5;
    padding: 8px; margin-bottom: 8px;
    flex-direction: column; align-items: flex-start; gap: 6px;
    background: var(--surface);
    width: 100%; max-width: 100%; min-width: 0;
  }
  .sort-pills { overflow-x: auto; white-space: nowrap; width: 100%; -webkit-overflow-scrolling: touch; }
  .sort-pill { font-size: 12px; padding: 5px 10px; }

  /* PDP single-column ------------------------------------------ */
  .pdp { grid-template-columns: 1fr !important; gap: 0; padding: 0; }
  .pdp-left { padding: 8px; position: static; }
  .pdp-right { padding: 12px; border-left: none; border-top: 1px solid var(--border); }
  .pdp-right h1 { font-size: 16px; }
  .pdp-img-main { padding: 8px; aspect-ratio: 1; }
  .pdp-img-main img { max-height: 100%; }
  .pdp-cta-row {
    position: fixed; left: 0; right: 0; bottom: 56px;
    background: var(--surface); padding: 8px; gap: 6px;
    box-shadow: 0 -2px 12px rgba(0,0,0,.12); z-index: 40; margin: 0;
  }
  .pdp-cta-row .btn-cart, .pdp-cta-row .btn-buy { padding: 12px; font-size: 14px; }
  .pdp-price { font-size: 22px; }
  .pdp-mrp, .pdp-discount { font-size: 13px; }

  /* Carousel --------------------------------------------------- */
  .pdp-carousel img { max-height: 320px; }
  .carousel-arrow { width: 30px; height: 30px; font-size: 18px; }
  .pdp-thumb { flex: 0 0 50px; height: 50px; }

  /* Cart / checkout ------------------------------------------- */
  .cart-layout { grid-template-columns: 1fr !important; gap: 8px; }
  .cart-item { grid-template-columns: 80px 1fr !important; gap: 10px; padding: 12px; }
  .summary { position: static; padding: 12px; }
  .checkout-step { padding: 12px; }
  .form-row { grid-template-columns: 1fr !important; gap: 8px; }
  .pay-method-header { padding: 12px 16px; gap: 12px; }
  .pay-method-header .pay-icon { width: 28px; height: 28px; font-size: 20px; }
  .pay-method-body { padding: 0 16px 16px 50px; }

  /* Auth ------------------------------------------------------- */
  .auth-page { grid-template-columns: 1fr !important; margin: 12px; min-height: auto; }
  .auth-side { padding: 20px; }
  .auth-side h2 { font-size: 20px; margin-bottom: 8px; }
  .auth-form { padding: 20px; }

  /* QR modal --------------------------------------------------- */
  .qr-card { padding: 18px; max-width: 100%; }
  .qr-card .amount { font-size: 22px; }
  .qr-canvas-wrap { padding: 8px; }

  /* Footer compact -------------------------------------------- */
  .fk-footer { padding: 20px 12px 0; margin-top: 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr !important; gap: 12px; padding-bottom: 12px; }
  .footer-col h5 { font-size: 11px; margin-bottom: 6px; }
  .footer-col a, .footer-col p { font-size: 12px !important; }
  .footer-bottom { padding: 12px 0; flex-direction: column; align-items: flex-start; }
  .footer-bottom .links { flex-wrap: wrap; gap: 12px; }

  /* Bottom nav reserves space at the bottom of every page */
  body { padding-bottom: 60px; }

  /* Order confirmation ---------------------------------------- */
  .order-confirm { margin: 12px 8px; padding: 16px; }
  .order-confirm .check { width: 60px; height: 60px; font-size: 36px; }

  /* Empty states ---------------------------------------------- */
  .empty-state { padding: 40px 16px; }

  /* Admin ------------------------------------------------------ */
  .admin-shell { grid-template-columns: 1fr !important; }
  .admin-side { display: flex; overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
  .admin-side .brand { display: none; }
  .admin-side a { flex: 0 0 auto; white-space: nowrap; padding: 6px 10px; font-size: 12px; border-left: 0; }
  .admin-side a:hover, .admin-side a.active { padding-left: 10px; border-left: 0; border-bottom: 2px solid var(--accent-yellow); }
  .admin-main { padding: 10px !important; }
  .admin-card { padding: 12px !important; }
  .admin-stat-row { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .stat-card .value { font-size: 20px; }
  table.admin-table { font-size: 11px; display: block; overflow-x: auto; white-space: nowrap; }
  .admin-table img { width: 38px; height: 38px; }
}

/* Extra-small phones (≤ 380 px) — squeeze further --------------- */
@media (max-width: 380px) {
  .fk-main { padding: 6px !important; }
  .product-grid { gap: 6px !important; }
  .product-card { padding: 6px !important; }
  .product-card .name { font-size: 11px; }
  .product-card .price { font-size: 13px; }
  .fk-cat { min-width: 64px; }
  .fk-cat .icon { width: 38px; height: 38px; font-size: 22px; }
  .fk-bottom-nav .nav-item { font-size: 9px; }
}

/* ============================================================
   Bottom Mobile Navigation (Flipkart-style)
   ============================================================ */
.fk-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-top: 1px solid var(--border);
  height: 56px; padding: 4px 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.fk-bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-muted); cursor: pointer; gap: 2px;
}
.fk-bottom-nav .nav-item.active { color: var(--accent); }
.fk-bottom-nav .nav-item .icon { font-size: 20px; }
@media (max-width: 820px) { .fk-bottom-nav { display: flex; } }

/* Disable text selection on chrome (allow on .selectable, inputs, textareas) */
.fk-header, .fk-cats, .fk-bottom-nav, .product-card .brand, .product-card .name {
  -webkit-user-select: none; user-select: none;
}
