:root {
  --primary: #8a2387;
  --accent: #f0be17;
  --magenta: #d95de8;
  --ink: #171217;
  --muted: #756575;
  --line: #eadfec;
  --paper: #fffaff;
  --soft: #f7eef9;
  --white: #ffffff;
  --danger: #a33a32;
  --success: #2d7954;
  --warning: #9a6a21;
  --shadow: 0 18px 45px rgba(36, 27, 32, 0.13);
}

.error-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fffafd;
  color: #29212a;
  text-align: center;
}
.error-card { width: min(100%, 440px); }
.error-card img { width: 86px; height: 86px; object-fit: contain; }
.error-card h1 { margin: 18px 0 8px; font-size: clamp(1.5rem, 5vw, 2.2rem); }
.error-card p { margin: 0 0 20px; color: #6f6570; line-height: 1.8; }
.error-card a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 22px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; }

* { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Alexandria", "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: normal; }
h1, h2, h3, h4 { line-height: 1.35; }
button { line-height: 1.35; }

.storefront-footer { border-top: 1px solid var(--line); margin-top: 22px; padding: 22px 16px calc(92px + env(safe-area-inset-bottom)); }
.storefront-footer-inner { display: grid; gap: 18px; margin: 0 auto; max-width: 1180px; }
.footer-brand { display: grid; gap: 5px; }
.footer-brand strong { font-size: 16px; }
.footer-brand span, .footer-brand a { color: var(--muted); font-size: 12px; }
.footer-brand a:hover, .footer-brand a:focus-visible, .footer-links a:hover, .footer-links a:focus-visible { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { color: var(--muted); font-size: 12px; font-weight: 600; }

.policy-body { min-height: 100vh; }
.policy-header { align-items: center; background: rgba(255, 250, 255, .97); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 12px clamp(16px, 5vw, 64px); position: sticky; top: 0; z-index: 10; }
.policy-brand { align-items: center; display: inline-flex; gap: 10px; }
.policy-brand img { height: 54px; object-fit: contain; width: 54px; }
.policy-brand strong, .policy-brand small { display: block; }
.policy-brand strong { font-size: 18px; }
.policy-brand small { color: var(--muted); font-size: 11px; }
.policy-home-link { border: 1px solid var(--line); border-radius: 999px; color: var(--primary); font-size: 12px; font-weight: 700; min-height: 42px; padding: 9px 15px; }
.policy-main { margin: 0 auto; max-width: 820px; padding: 34px 16px 48px; }
.policy-card { background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 36px rgba(36, 27, 32, .06); padding: clamp(20px, 5vw, 42px); }
.policy-card h1 { color: var(--primary); font-size: clamp(25px, 5vw, 36px); margin: 0 0 24px; }
.policy-card h2 { font-size: 18px; margin: 28px 0 10px; }
.policy-card p, .policy-card li { color: #514651; font-size: 14px; line-height: 2; }
.policy-card ul { padding-inline-start: 24px; }
.policy-card .policy-contact { background: var(--soft); border-radius: 14px; margin-top: 24px; padding: 16px; }
.policy-updated { color: var(--muted); font-size: 12px; margin-top: 28px; }
@media (min-width: 700px) {
  .storefront-footer-inner { align-items: start; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); }
  .footer-links { justify-content: flex-start; }
}

.site-header,
.admin-header {
  align-items: center;
  background: rgba(255, 250, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 88px;
  padding: 12px clamp(16px, 5vw, 64px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  font-weight: 800;
}

.brand small,
.eyebrow,
label,
.empty,
small {
  color: var(--muted);
}

.logo-crop {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-block;
  height: 76px;
  overflow: hidden;
  width: 76px;
}

.logo-crop img {
  display: block;
  height: 106px;
  object-fit: contain;
  object-position: center 8px;
  transform: translateY(-8px);
  width: 76px;
}

.logo-mark-crop {
  background: var(--white);
  display: inline-block;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
}

.logo-mark-crop img {
  display: block;
  height: auto;
  left: 50%;
  max-width: none;
  position: absolute;
  top: -7px;
  transform: translateX(-50%);
  width: 111px;
}

.admin-brand-copy,
.admin-login-brand-copy {
  align-content: center;
  display: grid;
  line-height: 1.3;
  text-align: right;
}

.admin-brand-ar {
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.admin-brand-copy small,
.admin-brand-tagline { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; margin: 7px 0 0; text-align: right; }
.admin-logo-mark { height: 78px; width: 60px; }
.admin-logo-mark img { top: -9px; width: 136px; }

.category-nav,
.header-actions,
.button-row,
.field-row,
.panel-head,
.card-meta,
.cart-controls {
  align-items: center;
  display: flex;
  gap: 10px;
}

.category-nav {
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
}

.nav-chip,
.sub-nav button,
.tab {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  padding: 9px 12px;
  white-space: nowrap;
}

.nav-chip.active,
.nav-chip:hover,
.sub-nav button:hover,
.tab.active {
  background: var(--soft);
  color: var(--ink);
}

.nav-group { position: relative; }

.sub-nav {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  min-width: 160px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: 100%;
}

.nav-group:hover .sub-nav,
.nav-group:focus-within .sub-nav {
  display: grid;
}

.btn {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--magenta));
  border-color: var(--primary);
  color: var(--white);
}

.btn.dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--white);
}

.btn.ghost { background: var(--soft); }
.btn.mini { min-height: 34px; padding: 5px 10px; }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }

#cartCount {
  background: var(--accent);
  border-radius: 999px;
  color: var(--ink);
  margin-right: 6px;
  min-width: 24px;
  padding: 1px 7px;
  text-align: center;
}

.hero {
  align-items: end;
  background:
    linear-gradient(90deg, rgba(23, 18, 23, 0.82), rgba(138, 35, 135, 0.14)),
    var(--hero-image) center 25% / cover;
  color: var(--white);
  display: flex;
  min-height: min(660px, calc(100vh - 86px));
  padding: clamp(44px, 8vw, 88px) clamp(18px, 6vw, 76px);
}

.hero-copy { max-width: 720px; }
.hero h1 { font-size: clamp(44px, 8vw, 88px); line-height: 1; margin: 6px 0 18px; }
.hero p { font-size: clamp(17px, 2vw, 21px); margin: 0 0 24px; }
.hero .eyebrow { color: rgba(255, 255, 255, 0.78); }

.content-section,
.catalog,
.admin-shell {
  padding: clamp(28px, 5vw, 64px) clamp(16px, 5vw, 72px);
}

.content-section {
  align-items: center;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr);
}

.content-section.image-side { grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr); }
.content-section img { border-radius: 8px; max-height: 420px; object-fit: cover; width: 100%; }

.catalog-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.filters {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 10px;
}

.filters.compact {
  background: transparent;
  border: 0;
  padding: 0;
}

input,
select,
textarea {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 12px;
  width: 100%;
}

label {
  display: grid;
  flex: 1;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 82%);
}

.product-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.product-card,
.card,
.admin-item,
.tree-node,
.cart-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(36, 27, 32, 0.06);
}

.product-card { cursor: pointer; overflow: hidden; }
.product-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 45%); outline-offset: 3px; }
.product-card > img { aspect-ratio: 4 / 5; display: block; object-fit: cover; width: 100%; }
.product-info { display: grid; gap: 10px; padding: 14px; }
.product-info h3 { margin: 0; }
.product-info p { color: var(--muted); margin: 0; }

.pill,
.status {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
}

.pill { background: var(--soft); color: var(--primary); }
.status.ok { background: color-mix(in srgb, var(--success), white 84%); color: var(--success); }
.status.warn { background: color-mix(in srgb, var(--warning), white 84%); color: var(--warning); }
.price { color: var(--primary); font-size: 21px; font-weight: 700; }
.original-price { display: block; width: fit-content; color: var(--muted); font-size: 13px; font-weight: 400; text-decoration-line: line-through; text-decoration-thickness: 1px; text-decoration-color: currentColor; }
.admin-confirm-dialog { border: 0; border-radius: 14px; max-height: 85dvh; max-width: none; overflow: hidden; padding: 0; width: min(520px, calc(100vw - 24px)); }
.admin-confirm-dialog::backdrop { background: rgba(30, 18, 32, .55); }
.admin-confirm-card { max-height: 85dvh; overflow-x: hidden; overflow-y: auto; overflow-wrap: anywhere; padding: 24px; text-align: right; }
.admin-confirm-card p { line-height: 1.7; white-space: pre-line; }
.admin-confirm-card .button-row { position: sticky; bottom: 0; background: var(--white); padding-top: 10px; }
.admin-confirm-dialog[data-destructive="true"] #adminConfirmAccept { background: #a72239; color: white; }

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 720px;
  padding: 0;
  width: calc(100% - 28px);
}

dialog::backdrop { background: rgba(36, 27, 32, 0.54); }

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  position: relative;
}

.icon-close {
  background: var(--soft);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  height: 34px;
  left: 14px;
  position: absolute;
  top: 14px;
  width: 34px;
}

.icon-close.static {
  position: static;
}

.option-product {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr);
  padding-left: 42px;
}

.product-gallery { display: grid; gap: 8px; min-width: 0; }

.option-main-image {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.option-thumbnails { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; }
.option-thumbnail { background: var(--white); border: 2px solid transparent; border-radius: 8px; cursor: pointer; flex: 0 0 58px; padding: 0; }
.option-thumbnail.active { border-color: var(--primary); }
.option-thumbnail img { aspect-ratio: 4 / 5; border-radius: 6px; display: block; object-fit: cover; width: 100%; }

.cart-drawer {
  background: rgba(23, 18, 23, 0.42);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.18s ease;
  z-index: 80;
}

.cart-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  background: var(--white);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  height: 100%;
  margin-right: auto;
  max-width: 540px;
  overflow-y: auto;
  padding: 22px;
  width: min(100%, 540px);
}

.cart-items,
.checkout-form,
.admin-page.active,
.admin-shell,
.admin-list,
.tree,
.visual-editor {
  display: grid;
  gap: 14px;
}

.cart-item {
  display: grid;
  gap: 12px;
  grid-template-columns: 84px 1fr;
  padding: 10px;
}

.cart-item img,
.admin-item img {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
  width: 84px;
}

.cart-controls input { min-height: 34px; text-align: center; width: 72px; }
.cart-total { align-items: center; border-top: 1px solid var(--line); display: flex; font-size: 20px; justify-content: space-between; padding-top: 14px; }

.admin-body { background: var(--soft); }
.admin-login-body { background: var(--soft); min-height: 100vh; }
.admin-login-shell { align-items: center; display: grid; min-height: 100vh; padding: 20px; }
.admin-login-card { margin: auto; max-width: 460px; width: 100%; }
.admin-login-brand { align-items: center; display: flex; gap: 14px; }
.admin-login-title { font-size: 24px; font-weight: 700; margin: 0; }
.admin-login-brand .eyebrow { margin: 0; }
.login-logo-mark { height: 73px; width: 56px; }
.login-logo-mark img { top: -8px; width: 127px; }
.login-error { background: #fdeaea; border-right: 4px solid var(--danger); color: var(--danger); margin: 0; padding: 10px; }
  .admin-header { border: 1px solid var(--line); border-radius: 8px; position: static; }
  .admin-notification-wrap { position: relative; }
  .admin-notification-bell { position: relative; white-space: nowrap; }
  .notification-unread { align-items: center; background: #a12d45; border-radius: 999px; color: white; display: inline-flex; font-size: 11px; justify-content: center; min-width: 19px; padding: 2px 5px; }
  .admin-notification-panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); inset-inline-end: 0; inset-inline-start: auto; max-height: min(70dvh, 520px); max-width: calc(100vw - 16px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 12px; position: absolute; top: calc(100% + 8px); width: min(380px, calc(100vw - 16px)); z-index: 110; }
  .admin-notification-head { align-items: center; display: flex; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
  .admin-notification-list { display: grid; gap: 5px; }
  .admin-notification-item { background: transparent; border: 0; border-radius: 8px; color: inherit; cursor: pointer; display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; padding: 10px; text-align: start; width: 100%; }
  .admin-notification-item.unread { background: var(--soft); }
  .admin-notification-item:hover { background: #eee5eb; }
  .admin-notification-item small, .admin-notification-empty { color: var(--muted); }
  .admin-order-target { outline: 2px solid var(--accent); outline-offset: -2px; }
.admin-tabs { background: var(--white); border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 8px; overflow-x: auto; padding: 8px; }
.admin-page { display: none; }
.admin-page > h2, .panel-head h2, .card > h2 { font-size: 23px; font-weight: 700; margin-block: 0; }
.admin-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.card { display: grid; gap: 14px; padding: 18px; }
.admin-import-workflow { display: grid; gap: 14px; min-width: 0; }
.alvina-import-section,
.import-workflow-panel {
  --soft: #fffdf2;
  background: #fff8d9;
  border-color: #ead58b;
  min-width: 0;
}
.alvina-import-section .notice { background: #fffdf2; }
.manual-product-section { min-width: 0; }
.manual-product-section.is-collapsed { gap: 0; padding-block: 12px; }
.manual-product-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  justify-content: space-between;
  min-height: 44px;
  padding: 0;
  text-align: right;
  width: 100%;
}
.manual-product-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 65%); outline-offset: 4px; }
.manual-product-chevron { font-size: 24px; line-height: 1; transition: transform 160ms ease; }
.manual-product-toggle[aria-expanded="true"] .manual-product-chevron { transform: rotate(180deg); }
.manual-product-fields { display: grid; gap: 14px; min-width: 0; }
.panel-head { justify-content: space-between; }
.sync-panel { margin-bottom: 18px; }
.sync-status { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sync-status > div { background: var(--soft); border-radius: 8px; display: grid; gap: 4px; padding: 11px; }
.sync-status span { color: var(--muted); font-size: 12px; font-weight: 600; }
.sync-state { color: var(--success); }
.sync-state.syncing { color: var(--warning); }
.sync-state.failed, .sync-error { color: var(--danger); }
.sync-error { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; }
.pricing-sections { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pricing-section { background: var(--soft); border-radius: 8px; display: grid; gap: 10px; padding: 14px; }
.pricing-section h3, .pricing-section p { margin: 0; }
.pricing-constants { display: flex; flex-wrap: wrap; gap: 10px; }
.pricing-constants span { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }

.tree-node {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.tree-node > div:first-child {
  border-right: 4px solid var(--primary);
  padding-right: 10px;
}

.tree-child {
  align-items: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-right: 18px;
  padding: 8px 10px;
}

.visual-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.visual-tools {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  left: 12px;
  padding: 8px;
  position: absolute;
  top: 12px;
  z-index: 2;
}

.small-hero { min-height: 420px; }
.admin-item { align-items: center; display: grid; gap: 12px; grid-template-columns: 84px 1fr auto; padding: 10px; }
.image-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.image-preview img { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; width: 76px; }
.notice { background: var(--soft); border-right: 4px solid var(--warning); margin: 0; padding: 10px; }
.import-preview { margin-top: 0; }
.bulk-import-heading { align-items: center; }
.bulk-import-limit { background: #fff1b8; border: 1px solid #dfc462; border-radius: 999px; color: #5f4a08; font-size: 12px; font-weight: 700; padding: 7px 11px; white-space: nowrap; }
.import-mode-tabs { background: rgba(255, 255, 255, .62); border: 1px solid #ead58b; border-radius: 12px; display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 5px; }
.import-mode-tab { background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; font: inherit; font-weight: 700; min-height: 44px; padding: 9px 14px; }
.import-mode-tab.active { background: var(--primary); color: var(--white); box-shadow: 0 4px 12px rgba(67, 25, 35, .15); }
.import-mode-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 55%); outline-offset: 2px; }
.import-mode-panel { background: rgba(255, 255, 255, .72); border: 1px solid #ead58b; border-radius: 10px; display: grid; gap: 12px; min-width: 0; padding: 14px; }
.import-shared-fields { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-mode-panel textarea { direction: ltr; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.55; min-height: 210px; resize: vertical; text-align: left; }
.batch-import-count { align-items: center; display: flex; flex-wrap: wrap; gap: 7px 14px; }
.batch-import-count span { background: #fff1b8; border-radius: 999px; color: #5f4a08; font-size: 12px; font-weight: 700; padding: 6px 10px; }
.batch-import-count span.invalid { background: #fdeaea; color: #9d2424; }
.bulk-import-row-error { color: var(--danger); font-size: 12px; font-weight: 600; margin: 0; }
.import-fetch-actions { justify-content: flex-start; }
.bulk-import-progress { background: #fff1b8; border-radius: 8px; color: #5f4a08; font-weight: 700; padding: 10px 12px; }
.bulk-preview-toolbar { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.bulk-preview-toolbar h2 { margin-bottom: 0; }
.bulk-preview-list { display: grid; gap: 10px; }
.bulk-preview-item { background: rgba(255, 255, 255, .72); border: 1px solid #ead58b; border-radius: 10px; min-width: 0; overflow: hidden; }
.bulk-preview-ruler { align-items: center; background: transparent; border: 0; color: var(--ink); cursor: pointer; display: grid; font: inherit; gap: 10px; grid-template-columns: auto minmax(72px, 1fr) minmax(100px, auto) auto; min-height: 54px; padding: 10px 13px; text-align: right; width: 100%; }
.bulk-preview-ruler:hover { background: rgba(255, 241, 184, .45); }
.bulk-preview-ruler:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 55%); outline-offset: -3px; }
.bulk-preview-ruler strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-preview-ruler > span:nth-last-child(2) { color: var(--muted); font-size: 13px; font-weight: 700; }
.bulk-preview-icon { color: var(--success); font-size: 18px; font-weight: 700; }
.bulk-preview-chevron { font-size: 20px; transition: transform 160ms ease; }
.bulk-preview-item.is-expanded .bulk-preview-chevron { transform: rotate(180deg); }
.bulk-preview-body { border-top: 1px solid #ead58b; display: grid; gap: 16px; padding: 15px; }
.preview-existing { font-weight: 700; }
.existing-product-notice {
  background: #fff1b8;
  border: 1px solid #dfc462;
  border-radius: 8px;
  color: #5f4a08;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
  padding: 12px 14px;
}
.existing-product-notice span { font-size: 13px; font-weight: 400; }
.preview-badge { background: var(--primary); border-radius: 999px; color: var(--white); font-size: 12px; font-weight: 600; padding: 7px 12px; }
.preview-summary { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.preview-summary > div { background: var(--soft); border-radius: 8px; min-width: 0; padding: 12px; }
.preview-summary dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.preview-summary dd { font-weight: 700; margin: 5px 0 0; overflow-wrap: anywhere; }
.preview-colors { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.preview-color-group { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 7px; padding: 12px; }
.preview-color-group small { color: var(--muted); }
.preview-images { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.preview-images img { aspect-ratio: 4 / 5; border: 1px solid var(--line); border-radius: 8px; flex: 0 0 92px; object-fit: cover; width: 92px; }
.preview-variants { min-width: 620px; }
.availability { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 600; padding: 5px 9px; }
.availability.available { background: #e6f7ee; color: #176b3a; }
.availability.unavailable { background: #fdeaea; color: #9d2424; }
.preview-actions { border-top: 1px solid var(--line); padding-top: 14px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 860px; width: 100%; }
td, th { border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 400; padding: 10px; text-align: right; vertical-align: top; }
th { font-weight: 600; }
.empty { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.hidden { display: none !important; }

.localization-source { padding: 14px; border: 1px solid var(--line, #e7ded8); border-radius: 14px; background: #faf7f4; }
.promotion-review { background: #fffaf0; border: 1px solid #ead9aa; border-radius: 14px; display: grid; gap: 12px; padding: 14px; }
.promotion-review fieldset { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 12px; margin: 0; padding: 14px; }
.promotion-review legend { font-weight: 700; padding-inline: 6px; }
.checkbox-label { align-items: center; display: flex; gap: 8px; }
.checkbox-label input { min-height: auto; width: auto; }
.source-copy { white-space: pre-wrap; max-height: 9rem; overflow: auto; color: #635b57; }
.color-localizations { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-block: 12px; }
.localization-editor { margin-block: 18px; padding-block: 14px; border-block: 1px solid var(--line, #e7ded8); }
.product-reference-link { color: var(--primary); display: inline-block; font-size: 12px; font-weight: 700; margin-top: 4px; text-decoration: underline; text-underline-offset: 3px; }
.product-reference-link.disabled { color: var(--muted); pointer-events: none; text-decoration: none; }
.hash-value { overflow-wrap: anywhere; direction: ltr; text-align: left; font-family: monospace; font-size: .78rem; }
.toast { border-radius: 8px; box-shadow: var(--shadow); color: var(--white); font-weight: 600; left: 24px; max-width: min(420px, calc(100vw - 48px)); padding: 12px 16px; position: fixed; top: 24px; z-index: 100; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@media (max-width: 860px) {
  .site-header,
  .admin-header,
  .catalog-head,
  .field-row,
  .panel-head,
  .header-actions,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .category-nav { justify-content: start; }
  .content-section.image-side,
  .admin-grid,
  .admin-item,
  .option-product,
  .cart-item {
    grid-template-columns: 1fr;
  }

  .admin-item img,
  .cart-item img {
    width: 100%;
  }

  .preview-summary { grid-template-columns: 1fr; }
  .sync-status { grid-template-columns: 1fr; }
  .pricing-sections { grid-template-columns: 1fr; }
  .alvina-import-section,
  .import-workflow-panel,
  .manual-product-section { max-width: 100%; overflow-x: hidden; }
  .import-workflow-panel .table-wrap { max-width: 100%; }
  .import-shared-fields { grid-template-columns: 1fr; }
  .bulk-preview-toolbar { align-items: stretch; flex-direction: column; }
  .bulk-preview-toolbar .button-row { width: 100%; }
  .bulk-preview-toolbar .button-row .btn { flex: 1 1 auto; }
  .bulk-preview-ruler { grid-template-columns: auto minmax(64px, 1fr) minmax(92px, auto) auto; padding-inline: 10px; }
  .bulk-preview-body { padding: 12px 10px; }
}

@media (max-width: 430px) {
  .bulk-import-heading { align-items: flex-start; }
  .import-mode-tab { font-size: 13px; padding-inline: 8px; }
  .import-fetch-actions .btn { width: 100%; }
  .import-mode-panel { padding: 11px; }
  .import-mode-panel textarea { min-height: 180px; }
  .bulk-preview-ruler { gap: 7px; grid-template-columns: auto minmax(58px, 1fr) minmax(84px, auto) auto; font-size: 13px; }
  .bulk-preview-ruler > span:nth-last-child(2) { font-size: 11px; }
}

/* Customer storefront v2 */
.storefront-body {
  background: #fbfafb;
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.app-header {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 7px;
  padding: 8px 14px 0;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-topline { align-items: center; display: flex; gap: 8px; justify-content: space-between; min-width: 0; }
.mobile-brand { align-items: center; display: flex; flex: 0 0 auto; gap: 12px; min-height: 69px; }
.mobile-brand-copy { align-content: center; display: grid; line-height: 1; text-align: right; }
.brand-name-ar { color: var(--ink); display: block; font-size: clamp(19px, 5.1vw, 21px); font-weight: 700; line-height: 1.25; white-space: nowrap; }
.brand-tagline { color: var(--muted); display: block; font-size: 12px; font-weight: 400; line-height: 1.4; margin-top: 7px; text-align: right; }
.mobile-logo { height: 69px; width: 52px; }
.header-season-filters { display: flex; flex: 1 1 0; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; min-width: 0; }
.season-chip { background: white; border: 2px solid currentColor; border-radius: 10px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; line-height: 1.25; min-height: 34px; min-width: 52px; padding: 5px 9px; white-space: nowrap; }
.season-chip[data-header-season="SUMMER"] { color: #c43d48; }
.season-chip[data-header-season="WINTER"] { color: #2866ad; }
.season-chip[data-header-season="SUMMER"].active { background: #b83240; border-color: #982632; color: white; box-shadow: 0 3px 10px rgba(184, 50, 64, .24); }
.season-chip[data-header-season="WINTER"].active { background: #2460a5; border-color: #194b83; color: white; box-shadow: 0 3px 10px rgba(36, 96, 165, .24); }
.season-chip:focus-visible { outline: 3px solid color-mix(in srgb, currentColor, transparent 62%); outline-offset: 2px; }

.store-search {
  align-items: center;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 13px;
  display: flex;
  gap: 9px;
  min-height: 39px;
  padding: 0 10px;
}
.store-search:focus-within { border-color: color-mix(in srgb, var(--primary), white 55%); }
.store-search svg { fill: none; height: 17px; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; width: 17px; }
.store-search input { background: transparent; border: 0; box-shadow: none; font-size: 15px; font-weight: 500; line-height: 1.35; min-height: 34px; padding: 0; }
.store-search input:focus { outline: 0; }

.category-strip {
  display: flex;
  gap: 6px;
  margin-inline: -14px;
  overflow-x: auto;
  padding: 0 14px 3px;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category-chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  padding: 6px 13px;
}
.category-chip.active { background: var(--primary); border-color: var(--primary); color: white; }

.app-content { margin: 0 auto; max-width: 1180px; padding: 12px 13px 26px; }
.app-view { display: none; }
.app-view.active { display: block; }
.view-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 8px; }
.view-heading h1 { font-size: 32px; font-weight: 600; line-height: 1.2; margin: 0; }
.section-kicker { color: var(--primary); display: block; font-size: 11px; font-weight: 600; margin-bottom: 3px; }
#homeView .view-heading h1 { font-size: 11px; font-weight: 600; line-height: 1.4; }
.home-heading-line { align-items: center; display: flex; flex-wrap: nowrap; gap: 8px; white-space: nowrap; }
.home-heading-line .section-kicker { margin-bottom: 0; }
.browse-filter-button { align-items: center; background: white; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; display: inline-flex; flex: 0 0 auto; font: inherit; font-size: 11px; font-weight: 600; gap: 5px; min-height: 40px; padding: 4px 9px; position: relative; }
.browse-filter-button svg { fill: none; height: 17px; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; width: 17px; }
.browse-filter-button.active { border-color: var(--primary); color: var(--primary); }
.filter-active-count { align-items: center; background: var(--primary); border-radius: 999px; color: white; display: inline-flex; font-size: 9px; height: 18px; justify-content: center; min-width: 18px; padding-inline: 4px; }
.category-result-heading { align-items: center; margin-bottom: 3px; }
.category-result-count { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.35; margin: 0; }
.category-result-heading h1 { font-size: 20px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
body[data-current-view="orders"] .store-search,
body[data-current-view="orders"] .header-season-filters,
body[data-current-view="orders"] #categoryStrip,
body[data-current-view="cart"] .store-search,
body[data-current-view="cart"] .header-season-filters,
body[data-current-view="cart"] #categoryStrip { display: none; }
body[data-current-view="orders"] .app-header,
body[data-current-view="cart"] .app-header { padding-bottom: 8px; }

.storefront-body .product-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-page-status { align-items: center; color: var(--muted); display: flex; flex-direction: column; font-size: 12px; gap: 9px; justify-content: center; min-height: 54px; padding: 14px 0 4px; text-align: center; }
.catalog-page-status:empty, .catalog-page-status.hidden { display: none; }
.catalog-page-status .secondary-action { min-height: 42px; padding: 8px 22px; width: auto; }
.catalog-page-status.loading span::before { animation: catalog-spin 700ms linear infinite; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; content: ""; display: inline-block; height: 16px; margin-left: 7px; vertical-align: -3px; width: 16px; }
.catalog-page-status.error { color: var(--danger); }
@keyframes catalog-spin { to { transform: rotate(360deg); } }
.storefront-body .product-card {
  background: white;
  border: 1px solid #eee8ed;
  border-radius: 15px;
  box-shadow: 0 7px 22px rgba(49, 34, 44, 0.045);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.storefront-body .product-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 45%); outline-offset: 3px; }
.product-image-wrap { aspect-ratio: 4 / 5; background: #f5f2f4; overflow: hidden; position: relative; }
.product-image-wrap > img { display: block; height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }
.product-image-wrap > img[data-card-image] { transform: translateX(0); }
.product-image-wrap > img[data-card-next-image] { transform: translateX(-100%); }
.product-image-wrap.card-image-sliding > img { transition: transform 400ms ease-in-out; }
.product-image-wrap.card-image-sliding > img[data-card-image] { transform: translateX(100%); }
.product-image-wrap.card-image-sliding > img[data-card-next-image] { transform: translateX(0); }
.product-card:hover .product-image-wrap:not(.card-image-sliding) > img[data-card-image] { transform: scale(1.015); transition: transform 180ms ease; }
.storefront-body .product-info { display: grid; gap: 6px; padding: 10px; }
.storefront-body .product-info h3 { display: -webkit-box; font-size: 14px; font-weight: 600; line-height: 1.55; margin: 0; min-height: 3.1em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-color-swatches { align-items: center; display: flex; gap: 6px; min-height: 16px; overflow: hidden; }
.card-color-swatch { background: var(--swatch-color, #eee9e6); border: 1px solid rgba(40, 36, 38, 0.22); border-radius: 50%; box-shadow: 0 0 0 1px #fff; flex: 0 0 13px; height: 13px; width: 13px; }
.card-color-swatch.unknown { background: linear-gradient(135deg, #eee9e6 0 48%, #c9c3c0 48% 52%, #eee9e6 52%); border-color: #a7a1a0; }
.storefront-body .price { color: var(--primary); direction: rtl; font-size: 17px; font-weight: 700; }

.favorite-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(65, 43, 57, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}
.product-image-wrap > .favorite-button { left: 8px; position: absolute; top: 8px; z-index: 2; }
.promotion-badge { background: var(--primary); border-radius: 999px; color: white; display: inline-block; font-size: 11px; font-weight: 700; margin-bottom: 8px; padding: 6px 9px; }
.card-promotion { bottom: 8px; margin: 0; max-width: calc(100% - 16px); position: absolute; right: 8px; z-index: 2; }
.favorite-button svg { fill: none; height: 19px; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 19px; }
.favorite-button .heart-shape.filled { fill: var(--primary); }

.customer-empty { background: white; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); grid-column: 1 / -1; padding: 30px 18px; text-align: center; }
.customer-empty strong, .customer-empty p { display: block; margin: 0; }
.customer-empty p { font-size: 13px; margin-top: 6px; }
.favorite-login-action { margin: 16px auto 0; max-width: 240px; }

.category-list { display: grid; gap: 10px; }
.category-card {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  grid-template-columns: 1fr auto auto;
  padding: 15px;
  text-align: right;
}
.category-card span strong, .category-card span small { display: block; }
.category-card span small, .category-card b { color: var(--muted); font-size: 11px; margin-top: 3px; }
.category-card span strong { font-size: 16px; }
.category-card span small { font-size: 10px; font-weight: 500; }
.category-card i { color: var(--primary); font-size: 27px; font-style: normal; margin-right: 10px; }
.text-action { background: transparent; border: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }

.cart-items { display: grid; gap: 11px; }
.storefront-body .cart-item { border-radius: 14px; box-shadow: none; display: grid; gap: 7px; padding: 10px; }
.cart-product-link { align-items: start; background: transparent; border: 0; border-radius: 10px; color: inherit; cursor: pointer; display: grid; font: inherit; gap: 12px; grid-template-columns: 92px minmax(0, 1fr); padding: 0; text-align: right; width: 100%; }
.cart-product-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 55%); outline-offset: 3px; }
.cart-product-link > img { aspect-ratio: 4 / 5; border-radius: 10px; height: auto; object-fit: cover; width: 92px; }
.cart-item-copy { display: grid; gap: 5px; min-width: 0; }
.cart-item-copy > strong { font-size: 14px; font-weight: 600; }
.cart-item-copy > small, .cart-item-copy > span { color: var(--muted); font-size: 12px; }
.cart-item-copy .line-total { color: var(--primary); }
.storefront-body .cart-controls { display: flex; gap: 6px; margin-right: 104px; margin-top: 0; }
.cart-quantity { color: var(--muted); font-size: 12px; }
.storefront-body .cart-controls .remove-item { background: transparent; color: var(--danger); margin-right: auto; width: auto; }
.cart-summary, .checkout-card { background: white; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 11px; margin-top: 14px; padding: 15px; }
.checkout-auth-gate { background: white; border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 13px; margin-top: 14px; padding: 18px 15px; text-align: center; }
.checkout-auth-gate p { font-size: 14px; font-weight: 600; line-height: 1.7; margin: 0; }
.checkout-auth-actions { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkout-auth-actions .secondary-action { min-height: 48px; }
.cart-summary > div { display: flex; justify-content: space-between; }
.promotion-discount-row, .promotion-discount-row > * { color: var(--danger); }
.cart-grand-total { border-top: 1px solid var(--line); font-size: 18px; padding-top: 12px; }
.checkout-heading { align-items: center; display: flex; justify-content: space-between; }
.checkout-heading h2 { font-size: 20px; font-weight: 700; margin: 0; }
.checkout-heading span { background: var(--soft); border-radius: 999px; color: var(--primary); font-size: 12px; font-weight: 600; padding: 6px 9px; }
.checkout-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.optional { color: var(--muted); font-size: 10px; }
.address-helper { color: var(--muted); display: block; font-size: 11px; font-weight: 400; line-height: 1.5; margin-top: 3px; }
.field-error { color: var(--danger); display: block; font-size: 11px; line-height: 1.4; margin-top: 4px; }
.field-error:empty { display: none; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.primary-action { background: var(--primary); border: 0; border-radius: 12px; color: white; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; min-height: 48px; padding: 11px 16px; width: 100%; }
.primary-action:disabled { cursor: not-allowed; opacity: 0.45; }

.guest-orders { display: grid; gap: 12px; }
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.admin-pagination span { color: var(--muted, #6f6670); font-size: 13px; }
.guest-order-card { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 14px; }
.order-head, .order-total, .order-summary-line, .order-delivery { align-items: center; display: flex; justify-content: space-between; }
.order-summary-line, .order-delivery { color: var(--muted); font-size: 12px; margin-block: 5px; }
.order-head small, .order-head strong { display: block; }
.order-head small { color: var(--muted); font-size: 10px; }
.order-head > span { background: #eaf7ef; border-radius: 999px; color: var(--success); font-size: 12px; font-weight: 600; padding: 6px 9px; }
.guest-order-items { border-block: 1px solid var(--line); display: grid; gap: 9px; margin-block: 12px; padding-block: 12px; }
.guest-order-items > div, .guest-order-items > .order-product-link { align-items: center; display: grid; gap: 9px; grid-template-columns: 48px 1fr auto; }
.order-product-link { background: transparent; border: 0; border-radius: 9px; color: inherit; cursor: pointer; font: inherit; padding: 4px; text-align: right; width: 100%; }
.order-product-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary), transparent 55%); outline-offset: 2px; }
.guest-order-items img { aspect-ratio: 4 / 5; border-radius: 7px; object-fit: cover; width: 48px; }
.guest-order-items span strong, .guest-order-items span small { display: block; }
.guest-order-items span small { color: var(--muted); font-size: 10px; margin-top: 3px; }

.product-dialog { background: white; height: 100dvh; margin: 0; max-height: none; max-width: none; width: 100%; }
.product-dialog::backdrop { background: rgba(28, 18, 24, 0.55); }
.product-dialog-card { min-height: 100%; position: relative; }
.dialog-close { align-items: center; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; display: flex; font-size: 25px; height: 40px; justify-content: center; left: max(13px, env(safe-area-inset-left)); position: fixed; top: max(13px, env(safe-area-inset-top)); width: 40px; z-index: 5; }
.product-floating-cart { align-items: center; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 50%; color: var(--primary); cursor: pointer; display: flex; height: 40px; justify-content: center; left: max(13px, env(safe-area-inset-left)); padding: 0; position: fixed; top: calc(max(13px, env(safe-area-inset-top)) + 48px); width: 40px; z-index: 5; }
.product-floating-cart svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 20px; }
.product-floating-cart .nav-badge { right: -8px; top: -8px; }
.product-floating-cart.cart-arrival { animation: cart-arrival-pulse 440ms ease-out; }
@keyframes cart-arrival-pulse { 45% { background: color-mix(in srgb, var(--primary), white 82%); box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary), transparent 82%); transform: scale(1.13); } }
.product-gallery { background: var(--soft); min-width: 0; overflow: hidden; }
.detail-gallery-viewport { overflow: hidden; touch-action: pan-y; width: 100%; }
.detail-gallery-track { --gallery-drag-x: 0px; direction: ltr; display: flex; transform: translate3d(calc(-100% + var(--gallery-drag-x)), 0, 0); width: 100%; will-change: transform; }
.detail-gallery-track.dragging { transition: none; }
.detail-gallery-track.settling { transition: transform 280ms cubic-bezier(.22,.72,.28,1); }
.detail-gallery-slide { flex: 0 0 100%; min-width: 0; }
.detail-main-image { aspect-ratio: 4 / 5; display: block; object-fit: cover; touch-action: pan-y; user-select: none; width: 100%; -webkit-user-drag: none; }
.detail-thumbnails { display: flex; gap: 7px; overflow-x: auto; padding: 9px; }
.detail-thumbnail { background: white; border: 2px solid transparent; border-radius: 9px; cursor: pointer; flex: 0 0 60px; overflow: hidden; padding: 0; }
.detail-thumbnail.active { border-color: var(--primary); }
.detail-thumbnail img { aspect-ratio: 4 / 5; display: block; object-fit: cover; width: 100%; }
.product-detail-copy { display: grid; gap: 14px; padding: 18px 15px calc(24px + env(safe-area-inset-bottom)); }
.product-title-row { align-items: start; display: flex; gap: 12px; justify-content: space-between; }
.product-title-row h1 { font-size: 24px; font-weight: 700; line-height: 1.4; margin: 0 0 7px; }
.product-reference { color: var(--muted); font-size: 12px; margin: -2px 0 7px; }
.product-detail-copy > .product-reference { margin: 0; }
.detail-favorite { flex: 0 0 40px; height: 40px; width: 40px; }
.product-description { color: var(--muted); line-height: 1.8; margin: 0; }
.purchase-options { display: grid; gap: 14px; min-width: 0; }
.option-section { display: grid; gap: 9px; }
.option-section h2 { font-size: 15px; font-weight: 700; margin: 0; }
.option-heading { align-items: center; display: flex; justify-content: space-between; }
.unavailable-message { color: var(--danger); font-size: 12px; font-weight: 600; }
.choice-list { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-button { background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; min-height: 40px; padding: 8px 13px; }
.choice-button.selected { background: color-mix(in srgb, var(--primary), white 88%); border-color: var(--primary); color: var(--primary); }
.choice-button.unavailable { opacity: 0.5; }
.size-choice small { display: block; font-size: 8px; margin-top: 2px; }
.muted-message { color: var(--muted); font-size: 12px; }
.quantity-field { max-width: 110px; }

.bottom-nav {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  left: 0;
  padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 40;
}
.bottom-nav-item { align-items: center; background: transparent; border: 0; color: #8a7e85; cursor: pointer; display: flex; flex-direction: column; font: inherit; font-size: 11px; font-weight: 600; gap: 3px; min-height: 52px; padding: 4px 2px; }
.bottom-nav-item svg { fill: none; height: 21px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 21px; }
.bottom-nav-item.active { color: var(--primary); }
.nav-icon-wrap { display: inline-flex; position: relative; }
.nav-badge { align-items: center; background: var(--primary); border: 2px solid white; border-radius: 999px; color: white; display: flex; font-size: 8px; height: 17px; justify-content: center; min-width: 17px; padding: 0 3px; position: absolute; right: -10px; top: -7px; }
.customer-toast { background: #263b2e; border-radius: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); color: white; font-size: 13px; font-weight: 600; left: 50%; max-width: calc(100% - 30px); opacity: 0; padding: 11px 15px; pointer-events: none; position: fixed; transform: translate(-50%, 12px); transition: 160ms ease; z-index: 80; }
.customer-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.customer-toast.error { background: var(--danger); }
.customer-toast.flying-to-cart { opacity: 0; transform: translate(calc(-50% + var(--toast-fly-x, -40vw)), var(--toast-fly-y, -55vh)) scale(.42); transition: opacity 520ms ease-in, transform 520ms cubic-bezier(.4,0,.7,1); }
.product-dialog > .customer-toast { box-shadow: 0 8px 28px rgba(0, 0, 0, .22); max-width: min(420px, calc(100% - 30px)); text-align: center; z-index: 1000; }
.customer-auth-dialog > .customer-toast { box-shadow: 0 8px 28px rgba(0, 0, 0, .22); max-width: min(420px, calc(100% - 30px)); text-align: center; z-index: 1000; }

.browse-filter-dialog { background: transparent; border: 0; height: 100dvh; margin: 0; max-height: none; max-width: none; padding: 0; width: 100%; }
.browse-filter-dialog::backdrop { background: rgba(28, 18, 24, .55); }
.browse-filter-sheet { background: white; border-radius: 22px 22px 0 0; bottom: 0; box-shadow: 0 -18px 55px rgba(28, 18, 24, .2); display: grid; gap: 18px; inset-inline: 0; margin: auto; max-height: min(82dvh, 680px); max-width: 620px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); position: absolute; width: 100%; }
.filter-sheet-handle { background: var(--line); border-radius: 999px; height: 4px; justify-self: center; width: 42px; }
.filter-sheet-head { align-items: center; display: flex; justify-content: space-between; }
.filter-sheet-head h2 { font-size: 20px; margin: 0; }
.filter-sheet-close { align-items: center; background: var(--soft); border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; display: inline-flex; font-size: 24px; height: 36px; justify-content: center; width: 36px; }
.filter-section { display: grid; gap: 10px; }
.filter-section h3, .filter-section label { color: var(--ink); font-size: 14px; font-weight: 700; margin: 0; }
.filter-option-list { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.filter-choice { align-items: center; background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; display: inline-flex; font: inherit; font-size: 13px; font-weight: 600; gap: 7px; min-height: 40px; padding: 7px 12px; }
.filter-choice.selected { background: color-mix(in srgb, var(--primary), white 88%); border-color: var(--primary); color: var(--primary); }
.filter-choice i { background: var(--swatch-color); border: 1px solid rgba(0,0,0,.14); border-radius: 50%; display: inline-block; height: 16px; width: 16px; }
.filter-sheet-actions { background: white; bottom: calc(-18px - env(safe-area-inset-bottom)); display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 8px calc(18px + env(safe-area-inset-bottom)); position: sticky; }
.filter-sheet-actions .secondary-action { min-height: 48px; }

.customer-account-panel { margin-bottom: 14px; }
.account-login-prompt, .account-profile { align-items: center; background: white; border: 1px solid var(--line); border-radius: 15px; display: flex; gap: 16px; justify-content: space-between; padding: 16px; }
.account-login-prompt strong, .account-profile h2 { font-size: 17px; margin: 0; }
.account-login-prompt p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 5px 0 0; }
.account-login-prompt .primary-action, .account-profile .secondary-action { flex: 0 0 auto; font-size: 13px; min-height: 40px; padding: 8px 13px; width: auto; }
.secondary-action { background: white; border: 1px solid var(--primary); border-radius: 10px; color: var(--primary); cursor: pointer; font: inherit; font-weight: 600; }
.account-profile small, .account-facts small { color: var(--muted); display: block; font-size: 10px; }
.account-facts { background: var(--soft); border-radius: 0 0 15px 15px; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin: -6px 8px 0; padding: 14px; }
.account-facts strong { display: block; font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.guest-orders-title { font-size: 15px; margin: 8px 0 0; }
.account-order-card { cursor: pointer; transition: border-color 150ms ease, transform 150ms ease; }
.account-order-card:hover { border-color: color-mix(in srgb, var(--primary), white 55%); transform: translateY(-1px); }
.account-order-card { padding: 10px 12px; }
.account-order-summary { align-items: center; background: transparent; border: 0; color: var(--ink); cursor: pointer; display: grid; font: inherit; gap: 8px; grid-template-columns: auto auto minmax(0, 1fr) auto; min-height: 44px; padding: 0; text-align: right; width: 100%; }
.account-order-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.short-order-id { font-size: 12px; font-weight: 700; white-space: nowrap; }
.account-order-summary time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.account-order-status { color: var(--primary); font-size: 11px; font-weight: 600; line-height: 1.45; min-width: 0; }
.order-chevron { color: var(--primary); font-size: 16px; }
.account-order-expanded { border-top: 1px solid var(--line); margin-top: 8px; overflow-wrap: anywhere; padding: 12px 3px 3px; }
.open-order-hint { color: var(--primary); display: block; font-size: 10px; margin-top: 9px; }

.customer-auth-dialog { background: transparent; border: 0; max-height: 100dvh; max-width: none; padding: 15px; width: 100%; }
.customer-auth-dialog::backdrop { background: rgba(28, 18, 24, .58); }
.customer-auth-card { background: white; border-radius: 20px; box-shadow: 0 24px 80px rgba(28, 18, 24, .22); margin: auto; max-width: 440px; padding: 25px 20px 20px; position: relative; width: 100%; }
.customer-auth-card .dialog-close { left: 12px; position: absolute; top: 12px; }
.auth-brand { align-items: center; display: flex; gap: 10px; margin-bottom: 18px; }
.auth-brand .logo-mark-crop { height: 58px; width: 46px; }
.auth-brand .logo-mark-crop img { top: -6px; width: 102px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 19px; }
.auth-brand small { color: var(--muted); font-size: 11px; margin-top: 5px; }
.customer-auth-card h2 { font-size: 22px; margin: 0 0 7px; }
.customer-auth-card > section > p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 17px; }
.customer-auth-form { display: grid; gap: 12px; }
.customer-auth-form label { color: var(--ink); display: grid; font-size: 12px; font-weight: 600; gap: 6px; }
.customer-auth-form input { background: white; border: 1px solid var(--line); border-radius: 10px; font: inherit; min-height: 45px; padding: 9px 11px; width: 100%; }
.customer-auth-form input:focus { border-color: var(--primary); outline: 2px solid color-mix(in srgb, var(--primary), transparent 85%); }
.auth-switch { display: block; margin: 16px auto 0; }
.order-detail-card { max-height: calc(100dvh - 30px); max-width: 620px; overflow-y: auto; }
.order-detail-heading { align-items: center; display: flex; gap: 10px; justify-content: space-between; padding-left: 42px; }
.order-detail-heading small, .order-detail-heading h2 { display: block; margin: 0; }
.order-detail-heading h2 { font-size: 14px; overflow-wrap: anywhere; }
.order-detail-heading > span { background: #eaf7ef; border-radius: 999px; color: var(--success); font-size: 11px; padding: 6px 9px; }
.order-date { color: var(--muted); font-size: 11px; }
.order-detail-totals { display: grid; gap: 8px; }
.order-detail-totals span { display: flex; justify-content: space-between; }
.order-detail-totals .total { border-top: 1px solid var(--line); font-size: 17px; padding-top: 10px; }
.delivery-snapshot { background: var(--soft); border-radius: 12px; margin-top: 15px; padding: 13px; }
.delivery-snapshot h3 { font-size: 14px; margin: 0 0 8px; }
.delivery-snapshot p { color: var(--muted); font-size: 11px; margin: 4px 0; white-space: pre-line; }
.customer-cancellation-reason { background: #fff1f1; border-radius: 10px; color: var(--danger); font-size: 12px; line-height: 1.7; padding: 10px 12px; }
.order-reason-wrap { display: grid; gap: 6px; margin-top: 8px; min-width: 200px; }
.order-reason-wrap label { font-size: 12px; }
.order-reason-wrap textarea { min-height: 62px; }
.order-reason-wrap .field-error { margin: 0; }
.order-timeline { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.order-timeline h3 { font-size: 14px; margin: 0 0 12px; }
.order-timeline ol { list-style: none; margin: 0; padding: 0 9px 0 0; }
.order-timeline li { display: flex; gap: 11px; min-height: 44px; position: relative; }
.order-timeline li:not(:last-child)::before { background: var(--line); content: ""; position: absolute; right: 6px; top: 15px; bottom: 0; width: 2px; }
.timeline-marker { background: #fff; border: 2px solid #b7c4bd; border-radius: 50%; flex: 0 0 14px; height: 14px; margin-top: 3px; position: relative; z-index: 1; }
.timeline-active .timeline-marker { background: var(--success); border-color: var(--success); }
.timeline-completed .timeline-marker { background: #bfd8c8; border-color: #bfd8c8; }
.timeline-pending { color: #8d9690; }
.order-timeline strong, .order-timeline time { display: block; }
.order-timeline strong { font-size: 12px; font-weight: 600; }
.order-timeline time { color: var(--muted); font-size: 11px; margin-top: 3px; }
.order-request-status, .order-request-pending, .admin-cancel-request { background: #fff4df; border: 1px solid #e7c879; border-radius: 10px; color: #70551b; font-size: 12px; line-height: 1.7; padding: 9px 11px; }
.order-request-status small, .admin-cancel-request small, .admin-cancel-request time { display: block; }
.order-cancel-request-button { margin-top: 12px; width: 100%; }
.admin-cancel-request { margin-bottom: 8px; min-width: 190px; }
.admin-order-items { display: grid; gap: 10px; min-width: 190px; }
.admin-order-item { background: var(--soft); border-radius: 10px; display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; padding: 10px; }
.admin-order-item + .admin-order-item { border-top: 1px solid var(--line); }
.admin-order-category { font-size: 13px; }
.admin-order-item small { display: block; }
.admin-order-variant { direction: ltr; font-size: 16px; font-weight: 700; letter-spacing: .01em; text-align: right; }
.admin-order-quantity { font-size: 12px; font-weight: 600; }
.admin-order-unit-price strong { color: var(--primary); }
.admin-order-source { justify-self: start; margin-top: 4px; }
.admin-order-financials { display: grid; gap: 6px; margin: 0; min-width: 190px; }
.admin-order-financials > div { align-items: start; display: flex; gap: 10px; justify-content: space-between; }
.admin-order-financials dt { color: var(--muted); font-size: 11px; }
.admin-order-financials dd { font-size: 12px; font-weight: 600; margin: 0; text-align: left; }
.admin-order-discount { color: var(--success); }
.admin-order-final { border-top: 1px solid var(--line); padding-top: 6px; }
.admin-order-promotions { display: grid !important; }
.admin-order-promotions ul { display: grid; gap: 4px; list-style: none; margin: 3px 0 0; padding: 0; }
.admin-order-promotions li { display: flex; gap: 8px; justify-content: space-between; }
.admin-order-promotions li span { overflow-wrap: anywhere; }
.admin-order-cancellation-reason { background: #fff1f1; border-radius: 8px; display: grid; gap: 3px; margin-block: 8px; padding: 8px; }
.admin-order-cancellation-reason small { overflow-wrap: anywhere; }
.admin-order-history { display: grid; gap: 8px; list-style: none; margin: 0; min-width: 170px; padding: 0; }
.admin-order-history li { border-inline-start: 2px solid var(--line); display: grid; gap: 2px; padding-inline-start: 8px; }
.admin-order-history strong { font-size: 12px; }
.admin-order-history time, .admin-order-history small { color: var(--muted); font-size: 10px; }

@media (max-width: 600px) {
  .admin-notification-panel { inset-inline: 8px; max-height: 70dvh; position: fixed; top: 76px; width: auto; }
  .admin-notification-head { align-items: flex-start; }
  .admin-notification-head .btn { white-space: normal; }
  .admin-confirm-card { padding: 20px 16px 16px; }
  .admin-confirm-card .button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-confirm-card .btn { width: 100%; }
}

@media (max-width: 370px) {
  .mobile-brand { gap: 10px; min-height: 64px; }
  .mobile-logo { height: 64px; width: 48px; }
  .mobile-logo img { top: -6px; width: 103px; }
  .brand-tagline { font-size: 12px; }
  .header-topline { gap: 5px; }
  .header-season-filters { gap: 3px; }
  .season-chip { font-size: 9px; padding-inline: 5px; }
  .account-order-summary { gap: 5px; }
  .account-order-summary time, .account-order-status { font-size: 10px; }
  .storefront-body .product-grid { gap: 9px; }
  .storefront-body .product-info { padding: 9px 8px; }
  .storefront-body .product-info h3 { font-size: 13px; }
  .bottom-nav-item { font-size: 10px; }
  .checkout-row { grid-template-columns: 1fr; }
  .account-login-prompt { align-items: stretch; flex-direction: column; }
  .account-login-prompt .primary-action { width: 100%; }
  .account-facts { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .app-content { padding-top: 10px; }
  .view-heading { margin-bottom: 6px; }
  .category-strip { padding-bottom: 2px; }
  .category-chip { font-size: 12px; min-height: 40px; padding-block: 5px; }
  .browse-filter-button { min-height: 40px; }
  .home-heading-line { gap: 6px; }
}

@media (min-width: 700px) {
  .app-header { grid-template-columns: minmax(0, 1fr) minmax(260px, 520px); padding: 12px max(20px, calc((100vw - 1180px) / 2)); }
  .header-season-filters { flex-basis: auto; max-width: none; }
  .mobile-brand { gap: 13px; min-height: 78px; }
  .mobile-logo { height: 78px; width: 60px; }
  .mobile-logo img { top: -9px; width: 136px; }
  .brand-name-ar { font-size: 24px; }
  .brand-tagline { font-size: 13px; }
  .category-result-heading h1 { font-size: 26px; }
  .category-strip { grid-column: 1 / -1; margin-inline: 0; padding-inline: 0; }
  .storefront-body .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-dialog { border-radius: 18px; height: min(86vh, 820px); margin: auto; max-width: 880px; width: calc(100% - 40px); }
  .product-dialog > .customer-toast { bottom: max(calc(7dvh + 24px), calc(50dvh - 386px)); }
  .product-dialog-card { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); min-height: 100%; }
  .detail-main-image { height: min(78vh, 730px); }
  .dialog-close { left: calc(50% - 414px); position: fixed; top: calc(7vh + 12px); }
  .product-floating-cart { left: calc(50% - 414px); top: calc(7vh + 60px); }
  .product-detail-copy { align-content: center; overflow-y: auto; padding: 28px; }
  .bottom-nav { border: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(49, 34, 44, .07); left: 50%; max-width: 620px; right: auto; transform: translateX(-50%); width: calc(100% - 30px); }
  .browse-filter-dialog { align-items: center; display: none; padding: 20px; }
  .browse-filter-dialog[open] { display: flex; }
  .browse-filter-sheet { border-radius: 20px; bottom: auto; max-height: min(82dvh, 680px); position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  .customer-toast.flying-to-cart { opacity: 0; transform: translate(-50%, 0) scale(.96); transition-duration: 140ms; }
  .product-floating-cart.cart-arrival { animation-duration: 180ms; }
}

@media (min-width: 1000px) {
  .storefront-body .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-content { padding-top: 25px; }
}
