:root {
  /* Authentic Grocery Store Tokens (Guided by frontenddesign.md & UI/UX Pro Max) */
  --green: #15803d; /* Emerald 700 - Fresh Produce & Grocery Core */
  --green-dark: #064e3b; /* Deep Forest 900 - Premium Heritage */
  --green-hover: #166534; /* Emerald 800 */
  --green-light: #f0fdf4; /* Emerald 50 - Soft Fresh Tint */
  --lime: #4ade80; /* Fresh Leaf 400 */
  --sun: #f59e0b; /* Golden Amber 500 - Savings & Value */
  --sun-hover: #d97706; /* Amber 600 */
  --sun-light: #fffbeb; /* Amber 50 */
  --accent: #ea580c; /* Warm Orange 600 - High-Contrast Actions */
  --accent-hover: #c2410c; /* Warm Orange 700 */

  --ink: #0f172a; /* Slate 900 */
  --ink-light: #1e293b; /* Slate 800 */
  --muted: #475569; /* Slate 600 - WCAG AA compliant */
  --muted-light: #94a3b8; /* Slate 400 */
  --bg: #f8fafc; /* Slate 50 */
  --cream: #ffffff;
  --surface: #ffffff;
  --line: #e2e8f0; /* Slate 200 */
  --line-strong: #cbd5e1; /* Slate 300 */

  --font: 'Nunito Sans', 'Noto Sans Arabic', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --heading-font: 'Rubik', 'Noto Sans Arabic', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.03);
  --shadow-hover: 0 12px 24px -4px rgb(15 23 42 / 0.08), 0 4px 8px -2px rgb(15 23 42 / 0.04);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --control-size: 44px;
  --motion: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 32px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button { border: 0; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a, button {
  transition: background var(--motion), color var(--motion), border-color var(--motion), box-shadow var(--motion), transform var(--motion);
}
button:disabled { opacity: .45; cursor: default; }
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
button:active:not(:disabled), .button:active { transform: scale(0.98); }
img { display: block; max-width: 100%; height: auto; }
bdi { unicode-bidi: isolate; }
.icon { width: 22px; height: 22px; flex-shrink: 0; vertical-align: middle; }
a .icon, button .icon { pointer-events: none; }

.container {
  width: calc(100% - 32px);
  max-width: 1280px;
  margin-inline: auto;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; inset-inline-start: 16px; z-index: 100;
  padding: 12px 20px; background: #fff; color: var(--green-dark);
  border: 2px solid var(--green); border-radius: var(--radius-sm); font-weight: 600;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 12px; }

.brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; white-space: nowrap;
}
.brand > img {
  width: 44px; height: auto; aspect-ratio: 355/295; border-radius: 8px;
}
.brand strong {
  display: block; font: 700 22px/1.2 var(--heading-font); letter-spacing: -0.5px; color: var(--ink);
}
.brand strong b { font-weight: 700; color: var(--green); }
.brand-dot { color: var(--green); }
.brand small { display: block; font: 12px/1.6 'Noto Sans Arabic', sans-serif; color: var(--muted); }
.brand small > span { display: none; }

.icon-button {
  display: grid; place-items: center; position: relative;
  width: 44px; height: 44px; border-radius: 50%; background: transparent; flex-shrink: 0;
}
.icon-button:hover { background: #f1f5f9; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1.5; text-align: center;
}
.button-green {
  background: var(--green); color: #fff;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}
.button-green:hover {
  background: var(--green-hover);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}
.button-sun {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff; border: none; font-weight: 700;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.button-sun:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}
.text-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 14px; font-weight: 600; color: var(--green); line-height: 1.5;
}
.text-link:hover {
  color: var(--green-hover); text-decoration: underline; text-underline-offset: 4px;
}
.text-link > .icon { width: 16px; height: 16px; }

.section-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px;
}
.section-heading h2 {
  font: 700 clamp(24px, 3vw, 32px)/1.3 var(--heading-font);
  letter-spacing: -0.5px; color: var(--ink); margin: 0 0 6px;
}
.section-heading p { font-size: 14px; color: var(--muted); margin: 0; }
.currency { font-size: .8em; font-weight: 600; white-space: nowrap; }

/* Product Grid and Card */
.product-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.product-card {
  min-width: 0; overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform var(--motion), box-shadow var(--motion), border-color var(--motion);
}
.product-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08);
  transform: translateY(-3px);
}
.product-visual {
  position: relative; aspect-ratio: 1.05; padding: 24px 14px 10px;
  background: #f8fafc; border-bottom: 1px solid #f1f5f9;
}
.product-visual > a {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
}
.product-visual img {
  width: 100%; height: 100%; object-fit: contain; min-width: 0;
  transition: transform 250ms ease;
}
.product-card:hover .product-visual img { transform: scale(1.04); }

.product-badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  font-size: 11px; font-weight: 700; line-height: 1.4;
  color: var(--green); background: var(--green-light);
  border: 1px solid #bbf7d0; padding: 3px 9px; border-radius: var(--radius-full);
  max-width: calc(100% - 60px); z-index: 1; letter-spacing: 0.3px;
}
.product-badge.badge-blue {
  background: #eff6ff; color: #0284c7; border-color: #bae6fd;
}
.save-button {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--muted);
  display: grid; place-items: center; z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); border: 1px solid var(--line);
}
.save-button > .icon { width: 18px; height: 18px; }
.save-button:hover {
  background: #fef2f2; color: #ef4444; border-color: #fecaca;
  transform: scale(1.06);
}
.save-button.is-saved {
  background: #fef2f2; color: #ef4444; border-color: #fecaca;
}
.save-button.is-saved > .icon { fill: #ef4444; stroke: #dc2626; }

.product-info { padding: 14px; display: flex; flex: 1; flex-direction: column; }
.product-brand {
  display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; color: var(--green); text-transform: uppercase; line-height: 1.5;
}
.product-name {
  display: block; font: 700 15px/1.35 var(--heading-font); color: var(--ink);
  min-height: 44px; overflow-wrap: anywhere;
}
.product-name:hover { color: var(--green); }
.pack-size {
  display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500;
}
.product-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: auto; padding-top: 12px;
}
.product-prices > strong {
  display: block; font: 800 18px/1.2 var(--heading-font); color: var(--ink); white-space: nowrap;
}
.product-prices del {
  display: block; font-size: 12px; color: var(--muted-light); margin-top: 2px; white-space: nowrap;
}
.no-discount { font-size: 11px; color: var(--muted); }

.add-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 14px; font-size: 13px; font-weight: 700;
  border: 1.5px solid #bbf7d0; border-radius: var(--radius-sm);
  background: var(--green-light); color: var(--green); flex-shrink: 0;
}
.add-button > .icon { height: 16px; width: 16px; }
.add-button:hover {
  background: var(--green); color: #fff; border-color: var(--green);
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.25);
  transform: translateY(-1px);
}

/* Breadcrumb */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-block: 20px 24px; color: var(--muted); font-size: 13px; line-height: 1.6;
}
.breadcrumb > .icon { width: 12px; height: 12px; }
.breadcrumb > a { min-height: 32px; display: inline-flex; align-items: center; }
.breadcrumb > a:hover { color: var(--green); text-decoration: underline; }

/* Shop Page */
.shop-page { padding-bottom: 56px; min-height: 65vh; }
.shop-page-heading {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px;
}
.shop-page-heading h1 {
  font: 700 clamp(28px, 4vw, 40px)/1.25 var(--heading-font);
  letter-spacing: -0.8px; color: var(--ink); margin: 8px 0 10px; overflow-wrap: anywhere;
}
.shop-page-heading p { font-size: 14px; color: var(--muted); margin: 0; }
.sort-label {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted);
}
select {
  min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line);
  background: #fff; border-radius: var(--radius-sm); max-width: 100%;
}
select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }

.shop-layout { display: grid; gap: 24px; min-width: 0; }
.shop-layout > div { min-width: 0; }
.shop-sidebar {
  display: flex; overflow: auto; gap: 8px; padding: 4px; scrollbar-width: thin;
}
.shop-sidebar > h3, .sidebar-note { display: none; }
.shop-sidebar > a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); white-space: nowrap; font-size: 13px; font-weight: 500;
  background: #fff;
}
.shop-sidebar > a.current {
  background: var(--green-light); border-color: var(--green); color: var(--green-hover); font-weight: 600;
}
.shop-sidebar > a > span {
  font-size: 12px; color: var(--muted); background: #f1f5f9; padding: 2px 6px; border-radius: 999px;
}

/* Product Detail Page */
.product-page { padding-bottom: 48px; }
.product-detail { display: grid; gap: 32px; }
.gallery-main {
  display: flex; align-items: center; justify-content: center; position: relative;
  aspect-ratio: 1.1; padding: 48px 32px 30px; border: 1px solid var(--line);
  border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-sm);
}
.gallery-main > img { width: 100%; height: 100%; max-height: 360px; object-fit: contain; }
.detail-badge {
  position: absolute; top: 16px; inset-inline-start: 16px;
  font-size: 12px; font-weight: 700; background: var(--green-light); color: var(--green-hover);
  border: 1px solid #a7f3d0; border-radius: var(--radius-full); padding: 5px 12px;
  max-width: calc(100% - 75px);
}
.gallery-main > .save-button { top: 12px; inset-inline-end: 12px; }
.gallery-caption {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  font-size: 13px; line-height: 1.8; color: var(--muted); margin-top: 14px; text-align: center;
}
.gallery-caption .icon { width: 16px; height: 16px; }

.detail-info > h1 {
  font: 700 clamp(28px, 4vw, 36px)/1.3 var(--heading-font); letter-spacing: -0.6px;
  color: var(--ink); margin: 12px 0 8px;
}
.detail-subtitle {
  display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); margin-bottom: 16px;
}
.stock-status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--green-hover);
}
.stock-status > span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}
.detail-price {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 20px;
}
.detail-price > strong {
  font: 700 32px/1.2 var(--heading-font); color: var(--ink); letter-spacing: -0.8px;
}
.detail-price > del { font-size: 18px; color: var(--muted); }
.save-tag {
  font-size: 12px; font-weight: 700; background: #fff7ed; color: #ea580c;
  border: 1px solid #ffedd5; padding: 4px 10px; border-radius: var(--radius-full);
}
.price-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.product-description { font-size: 15px; line-height: 1.8; color: #334155; margin: 20px 0; }
.pack-label { font-size: 14px; font-weight: 700; color: var(--ink); margin: 20px 0 10px; }
.pack-option {
  display: inline-flex; align-items: center; gap: 20px; min-height: 44px;
  border: 1.5px solid var(--green); background: var(--green-light); color: var(--green-hover);
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
}
.pack-option > .icon { height: 16px; width: 16px; }

.add-to-bag-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.quantity-stepper {
  display: flex; align-items: center; border: 1.5px solid var(--line);
  background: #fff; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
}
.quantity-stepper > button {
  width: 44px; height: 44px; display: grid; place-items: center; background: transparent;
}
.quantity-stepper > button:hover { background: #f1f5f9; }
.quantity-stepper output { min-width: 32px; text-align: center; font-size: 16px; font-weight: 600; }
.quantity-stepper .icon { width: 16px; height: 16px; }
.detail-add {
  flex: 1; justify-content: space-between; gap: 12px; min-width: 180px; font-size: 15px;
}
.detail-add > span { margin-inline-start: auto; white-space: nowrap; font-weight: 700; }

.product-reassurance {
  display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 13px; color: var(--muted); margin-block: 28px;
}
.product-reassurance > span { display: flex; align-items: center; gap: 8px; }
.product-reassurance .icon { width: 18px; height: 18px; color: var(--green); }
.product-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.product-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.product-facts dd { font-size: 13px; font-weight: 600; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }

.product-accordions {
  margin-block: 36px 44px; border-top: 1px solid var(--line);
}
.product-accordions > details { border-bottom: 1px solid var(--line); }
.product-accordions summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding-block: 16px; font-size: 15px; font-weight: 600; list-style: none;
}
summary::-webkit-details-marker { display: none; }
.product-accordions details[open] summary > .icon { transform: rotate(45deg); }
.product-accordions p { font-size: 15px; color: #475569; line-height: 1.8; max-width: 850px; margin: 0 0 20px; }
.related-section { padding-bottom: 24px; }

/* Empty State */
.empty-state { padding: 72px 20px; text-align: center; }
.empty-state > .icon { display: block; width: 52px; height: 52px; color: var(--green); margin: 0 auto 20px; }
.empty-state h2, .empty-state h3 { font: 700 24px/1.3 var(--heading-font); color: var(--ink); margin: 0 0 12px; }
.empty-state p { font-size: 15px; color: var(--muted); line-height: 1.8; margin: 0 auto 24px; max-width: 400px; }

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
  color: #f0fdf4; padding-top: 56px;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px 24px; padding-bottom: 40px;
}
.footer-brand { grid-column: 1 / -1; }
.brand-footer strong { color: #fff; }
.brand-footer .brand-dot { color: var(--lime); }
.footer-brand > h3 { font: 600 15px/1.6 var(--font); color: #e2e8f0; margin: 20px 0 10px; }
.footer-brand > p { font-size: 14px; line-height: 1.8; color: #cbd5e1; max-width: 360px; margin: 0; }
.footer-grid > div:not(.footer-brand) > h3 {
  font: 700 14px/1.5 var(--heading-font); color: #fff; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 14px;
}
.footer-grid > div:not(.footer-brand) > a {
  display: flex; align-items: center; min-height: 44px; font-size: 13px; color: #cbd5e1; line-height: 1.6;
}
.footer-grid a:hover { color: var(--lime); }
.footer-neighbourhood { display: none; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12); padding-block: 24px;
  display: flex; flex-direction: column; gap: 12px; font-size: 12px; color: #94a3b8; line-height: 1.8;
}
.footer-bottom > span:last-child { max-width: 600px; }

/* Newsletter */
.newsletter {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  margin-block: 40px; padding: 32px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
}
.newsletter > div { display: flex; align-items: center; gap: 16px; }
.newsletter > div > .icon { width: 36px; height: 36px; color: var(--green); }
.newsletter h2 { font: 700 20px/1.3 var(--heading-font); color: var(--ink); margin: 0 0 6px; }
.newsletter p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.6; }
.newsletter form { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; min-width: 0; }
.newsletter input {
  flex: 1; min-width: 180px; min-height: 44px; border: 1.5px solid var(--line);
  background: #fff; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 16px;
}
.newsletter input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }
.newsletter .button { font-size: 14px; }

/* Dialogs */
dialog { border: 0; color: var(--ink); background: #fff; }
dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
}
.cart-dialog {
  position: fixed; inset-block: 0; inset-inline-start: auto; inset-inline-end: 0;
  width: 480px; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0;
  border-left: 1px solid var(--line); box-shadow: var(--shadow-hover);
}
.cart-dialog[open] { display: flex; flex-direction: column; }
.dialog-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0; border-bottom: 1px solid var(--line); padding: 20px 24px;
}
.dialog-header > h2 { font: 700 22px/1.3 var(--heading-font); margin: 0; }
.dialog-header > h2 > span { font-size: 15px; color: var(--muted); font-weight: 500; }
.cart-items { flex: 1; overflow: auto; padding-inline: 24px; overscroll-behavior: contain; }
.cart-item {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px;
  padding-block: 20px; border-bottom: 1px solid var(--line);
}
.cart-item > a {
  display: grid; place-items: center; padding: 8px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); align-self: start; min-height: 88px; background: #f8fafc;
}
.cart-item img { width: 100%; height: 76px; object-fit: contain; }
.cart-item-name { display: block; font: 600 15px/1.4 var(--heading-font); }
.cart-item > div > small { display: block; font-size: 13px; color: var(--muted); margin-block: 4px; }
.cart-item > div > strong { font: 700 17px/1.3 var(--heading-font); color: var(--ink); }
.cart-item-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px;
}
.remove-button {
  display: grid; place-items: center; width: 44px; height: 44px;
  background: transparent; color: var(--muted); border-radius: var(--radius-sm);
}
.remove-button:hover { background: #fee2e2; color: #dc2626; }
.remove-button > .icon { height: 18px; width: 18px; }
.cart-summary {
  padding: 24px; flex-shrink: 0; background: #f8fafc; border-top: 1px solid var(--line);
}
.cart-summary > div {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 14px; margin-bottom: 12px; color: var(--muted);
}
.cart-summary .shipping-row { font-size: 13px; color: var(--muted); }
.cart-summary .cart-total {
  font: 700 19px/1.2 var(--heading-font); color: var(--ink);
  border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px;
}
.checkout-button { width: 100%; justify-content: space-between; font-size: 15px; }
.demo-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.cart-summary .demo-note { margin-bottom: 0; margin-top: 12px; }
.cart-empty { margin: auto; padding: 40px 24px; }

.small-dialog {
  width: 460px; max-width: calc(100% - 32px); border-radius: var(--radius-xl);
  padding: 0; box-shadow: var(--shadow-hover);
}
.small-dialog form { padding: 12px 24px 28px; }
.small-dialog form > p { font-size: 14px; color: var(--muted); line-height: 1.7; }
.small-dialog form > label { display: block; font-size: 14px; font-weight: 600; margin: 20px 0 8px; }
.small-dialog select { width: 100%; font-size: 16px; }
.small-dialog form > .button { width: 100%; margin-top: 16px; }

.toast {
  position: fixed; inset-inline-start: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px); opacity: 0; visibility: hidden; z-index: 100;
  background: var(--ink); color: #fff; border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full); box-shadow: var(--shadow-lg);
  padding: 12px 20px; display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; line-height: 1.5; width: max-content;
  max-width: calc(100% - 32px);
  transition: opacity var(--motion), transform var(--motion), visibility var(--motion);
}
.toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast > .icon { width: 18px; height: 18px; color: var(--lime); }
.image-unavailable { object-fit: contain; background: #f8fafc; }
html[dir=rtl] .icon-direction { transform: scaleX(-1); }

@media(min-width: 640px) {
  .container { width: calc(100% - 48px); }
  .product-info { padding: 16px; }
  .product-brand { font-size: 12px; }
  .product-name { font-size: 15px; min-height: 45px; }
  .product-bottom { flex-wrap: nowrap; }
  .product-prices > strong { font-size: 19px; }
  .shop-page-heading { margin-bottom: 32px; }
  .product-detail { grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
  .gallery-main { aspect-ratio: .95; }
  .detail-info > h1 { font-size: 32px; }
  .detail-info .detail-add { flex-basis: 100%; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: row; justify-content: space-between; gap: 32px; }
  .footer-bottom > span:first-child { flex-shrink: 0; max-width: 240px; }
  .newsletter form { flex: 0 1 480px; }
  .cart-dialog { border-start-start-radius: var(--radius-xl); border-end-start-radius: var(--radius-xl); }
}

@media(min-width: 960px) {
  .container { width: calc(100% - 96px); }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .shop-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
  .shop-sidebar { display: block; overflow: visible; padding: 0; }
  .shop-sidebar > h3 { display: block; font: 700 16px/1.4 var(--heading-font); margin: 0 0 16px; color: var(--ink); }
  .shop-sidebar > a { margin-bottom: 8px; white-space: normal; }
  .sidebar-note { display: block; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); margin-top: 24px; }
  .sidebar-note strong { display: block; font-size: 15px; margin-top: 10px; color: var(--ink); }
  .sidebar-note p { font-size: 13px; line-height: 1.7; color: var(--muted); }
  .shop-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-detail { gap: 56px; }
  .gallery-main { aspect-ratio: 1.05; padding: 60px 48px 36px; }
  .detail-info > h1 { font-size: 38px; }
  .detail-info .detail-add { flex-basis: auto; }
  .related-section > .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1.3fr; gap: 40px; }
  .footer-neighbourhood { display: block; }
  .footer-neighbourhood > p { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #cbd5e1; }
  .footer-neighbourhood .arabic-footer { font: 21px 'Noto Sans Arabic', sans-serif; margin-block: 24px 8px; color: #fff; }
  .footer-neighbourhood > span { font-size: 12px; color: #94a3b8; }
}

/* eCommerce Dialogs: Checkout, Auth, Orders, Account */
.checkout-dialog, .auth-dialog {
  width: 540px; max-width: calc(100% - 32px); border-radius: var(--radius-xl);
  padding: 0; max-height: 90dvh; overflow: auto; box-shadow: var(--shadow-hover);
}
.checkout-dialog form, .auth-dialog form { padding: 20px 28px 28px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; min-height: 44px; border: 1.5px solid var(--line);
  background: #fff; border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 15px; font-family: inherit; color: var(--ink); box-sizing: border-box;
}
.form-group textarea { min-height: 72px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width: 480px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

.form-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; margin-bottom: 16px;
}
.form-success {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; margin-bottom: 16px;
}
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); background: #f8fafc; }
.auth-tab {
  flex: 1; text-align: center; padding: 14px 16px; background: none; border: none;
  border-bottom: 2px solid transparent; font-weight: 600; font-size: 15px; color: var(--muted);
  cursor: pointer; transition: all var(--motion);
}
.auth-tab.active { border-bottom-color: var(--green); color: var(--green); background: #fff; }

.checkout-summary {
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 20px;
}
.checkout-summary-row {
  display: flex; justify-content: space-between; font-size: 14px; line-height: 1.8; color: var(--muted);
}
.checkout-summary-row.total-row {
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px;
  font: 700 17px/1.3 var(--heading-font); color: var(--ink);
}

/* Order and Account Pages */
.order-page, .account-page { padding-block: 36px 72px; max-width: 880px; }
.order-header, .account-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.order-header h1, .account-header h1 { font: 700 28px/1.3 var(--heading-font); margin: 0; color: var(--ink); }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #e0e7ff; color: #3730a3; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-returned { background: #f3f4f6; color: #374151; }

.order-card, .account-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.order-card h2, .account-card h2 {
  font: 700 18px/1.4 var(--heading-font); color: var(--ink); margin: 0 0 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.order-items-table { width: 100%; border-collapse: collapse; }
.order-items-table th, .order-items-table td {
  padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14px;
}
.order-items-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.order-totals-box { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.order-totals-row { display: flex; justify-content: space-between; width: 280px; max-width: 100%; font-size: 14px; color: var(--muted); }
.order-totals-row.grand-total {
  border-top: 1px solid var(--line); padding-top: 12px; font: 700 18px/1.2 var(--heading-font); color: var(--green);
}
.order-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.order-meta-grid h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 8px; }
.order-meta-grid p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.order-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.button-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.button-danger:hover { background: #b91c1c; }

.saved-address-item {
  display: flex; justify-content: space-between; align-items: center; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: #fff;
}
.saved-address-item p { margin: 0; font-size: 14px; line-height: 1.5; }
.order-history-item {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  margin-bottom: 14px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color var(--motion), box-shadow var(--motion);
}
.order-history-item:hover { border-color: var(--green); box-shadow: var(--shadow-md); }

@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
