:root {
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #1a2e28;
  --muted: #64748b;
  --brand: #00483a;
  --brand-light: #006b55;
  --brand-dark: #003528;
  --brand-soft: rgba(0, 72, 58, 0.08);
  --primary: #f5c518;
  --primary-dark: #c8960f;
  --primary-soft: rgba(245, 197, 24, 0.2);
  --accent-offer: #e63946;
  --accent-offer-soft: rgba(230, 57, 70, 0.1);
  --border: #e2e8f0;
  --border-focus: #c8960f;
  --input-bg: #f8fafc;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --price: #00483a;
  --price-offer: #e63946;
  --shadow-sm: 0 1px 3px rgba(0, 40, 32, 0.06);
  --shadow-md: 0 8px 28px rgba(0, 40, 32, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 40, 32, 0.14);
  --shadow-card: 0 2px 12px rgba(0, 40, 32, 0.07);
  --radius-input: 12px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --font-ar: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-ar);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

.container {
  max-width: 1100px;
  width: 100%;
  margin: 16px auto;
  padding: 0 12px;
  overflow-x: hidden;
  overflow-x: clip;
}

h1, h2, h3 {
  margin: 0 0 8px;
}

.cart-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;  
}

.cart-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #ffffff;
}

.cart-title-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.card-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-weight: 600;
}

.card-link:hover {
  border-color: var(--primary);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-btn {
  background: #ffffff;
  color: #000;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 300;
  font-size: 12px;
}

.category-btn:hover {
  border-color: #9ca3af;
  color: #000;
}

.category-btn.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}

.offers-category-btn {
  animation: offersPulse 1.6s ease-in-out infinite;
  border-color: var(--accent-offer);
  background: var(--accent-offer-soft);
  color: var(--accent-offer);
  font-weight: 600;
}

@keyframes offersPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(230, 57, 70, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
  }
}

input, select, button, textarea {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

input.readonly-field,
input[readonly] {
  background: #f3f4f6;
  color: #374151;
  cursor: not-allowed;
}

/* ── Form groups (Hub customer + admin login) ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.form-group input,
.form-group select,
.form-group textarea {
  min-height: 46px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-group input[inputmode="numeric"],
.form-group input[type="password"][maxlength="4"] {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding-inline: 14px;
}

.form-group input[inputmode="tel"] {
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.auth-form {
  margin-top: 4px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.form-actions button {
  flex: 1 1 140px;
  min-height: 46px;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: var(--radius-input);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-actions button:active:not(:disabled) {
  transform: scale(0.98);
}

.form-actions button.primary,
button.primary {
  background: linear-gradient(180deg, #ffd54f 0%, var(--primary) 55%, #e6b800 100%);
  border-color: #b8860b;
  color: var(--brand-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(200, 150, 15, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.form-actions button.primary:hover:not(:disabled),
button.primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(200, 150, 15, 0.35);
  transform: translateY(-1px);
}

.form-actions button.primary:active:not(:disabled),
button.primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.form-actions button.secondary:hover:not(:disabled),
button.secondary:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f9fafb;
}

.error {
  display: block;
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  border: 1px solid #fecaca;
}

.error:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Hub customer auth card */
#authView.card,
#authView.hub-auth-card {
  max-width: 440px;
  margin-inline: auto;
  padding: 28px 22px 24px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.8);
}

#authView h2 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

#authView .muted {
  font-size: 0.875rem;
  line-height: 1.6;
}

#registerMapWrap {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

#registerMap {
  box-shadow: var(--shadow-sm);
}

.register-map-toolbar {
  margin-bottom: 10px;
}

.hub-topbar {
  max-width: 440px;
  margin-inline: auto;
  margin-bottom: 16px;
  padding: 4px 2px;
}

.hub-topbar h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hub-topbar button.secondary {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
  font-weight: 600;
}

/* Admin login modal forms */
.modal-panel .form-group {
  margin-bottom: 14px;
}

.modal-panel .form-group input {
  min-height: 44px;
}

.modal-panel .form-actions,
.modal-panel button.primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.cart-qty-select {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
}

body.is-mobile .cart-qty-select {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  min-height: 36px;
}

button {
  border: 1px solid #2e1e02;
  background: var(--primary);
  color: #2e1e02;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.danger {
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.mobile-table-scroll {
  width: 100%;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 5px;
  text-align: center;
}

th {
  background: #f9fafb;
}

.hidden {
  display: none !important;
}

#storesModal.stores-modal-closed {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

#storesModal.stores-modal-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  z-index: 50;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
}

.status-pending { background: #fef3c7; }
.status-accepted, .status-preparing, .status-ready { background: #dbeafe; }
.status-on_way { background: #ccfbf1; }
.status-delivered { background: #dcfce7; }
.status-suspended, .status-editing { background: #fff7ed; color: #9a3412; }
.status-cancel { background: #ffe4e6; color: #9f1239; }
.status-cancel-store { background: #dc2626; color: #ffffff; }
.status-cancelled { background: #fee2e2; }

.store-connection-status {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
}

.store-connection-status.store-open {
  background: #dbeafe;
  color: #1d4ed8;
}

.store-connection-status.store-closed {
  background: #fee2e2;
  color: #b91c1c;
}

.store-connection-status.store-connecting {
  background: #fef9c3;
  color: #a16207;
}

.customer-topbar {
  height: 56px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #ffffff;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 0 14px;
  margin: -10px -8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 72, 58, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.customer-topbar-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.customer-topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.customer-topbar-logo {
  width: 75px;
  height: 50px;
  object-fit: contain;
  flex: 0 0 auto;
}

.customer-cart-button {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-input);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  backdrop-filter: blur(8px);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.customer-cart-button:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
}

.customer-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.customer-topbar .store-connection-status {
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 11px;
  padding: 3px 8px;
}

.customer-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.customer-menu-button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.customer-menu-button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.customer-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  width: 190px;
  padding: 6px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.customer-menu-dropdown button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  text-align: right;
  padding: 8px 10px;
}

.customer-menu-dropdown button:hover {
  background: #f3f4f6;
}

.customer-desktop-back {
  position: absolute;
  top: calc(100% + 18px);
  left: 0;
  z-index: 3500;
  min-width: 72px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-color: #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.customer-desktop-back:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
}

body.is-mobile .customer-desktop-back {
  display: none !important;
}

.customer-menu.customer-menu-back-visible .customer-menu-dropdown {
  top: calc(100% + 58px);
}

.customer-view {
  width: 100%;
}

.view-toolbar {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.view-toolbar h3 {
  margin: 0;
}

.category-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 120px));
  gap: 12px;
  justify-content: center;
}

.category-tile {
  position: relative;
  width: 120px;
  height: 170px;
  padding: 0;
  border: none;
  border-radius: var(--radius-card);
  background: #ffffff;
  color: var(--text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.category-tile img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%);
}

.category-tile span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.95) 30%);
  text-align: center;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--brand);
}

.category-tile:hover,
.category-tile.active {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 72, 58, 0.18);
}

.category-tile.active {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.parent-category-block {
  border: none;
  border-radius: var(--radius-card);
  padding: 14px 12px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.parent-category-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 8px;
}

.parent-category-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  flex-shrink: 0;
}

.subcategory-row-block + .subcategory-row-block {
  margin-top: 10px;
}

.subcategory-row-title {
  margin: 0 0 6px;
  font-size: 13px;
  color: #334155;
}

.subcategory-products-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.subcategory-products-row .product-card {
  flex: 0 0 145px;
  min-width: 145px;
  scroll-snap-align: start;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-input);
  border: none;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%);
  display: block;
}

.product-card h4 {
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  font-weight: 800;
  font-size: 15px;
  margin: 4px 0 10px;
  color: var(--price);
}

.offer-price-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 8px;
}

.price-old {
  color: #666;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.price-new {
  color: var(--price-offer);
  font-weight: 800;
  font-size: 15px;
}

.product-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.product-no-image {
  color: var(--muted);
  font-size: 12px;
}

.add-to-cart-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.add-to-cart-counter {
  min-width: 32px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgba(0, 72, 58, 0.15);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
}

.add-to-cart-row button {
  min-height: 34px;
  min-width: 34px;
  border-radius: var(--radius-input);
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-dark);
}

.add-to-cart-row button.secondary,
.add-to-cart-row button:not(.primary) {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(0, 72, 58, 0.2);
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
  padding: 8px;
}

.modal-panel {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-panel-compact {
  max-width: 420px;
  height: auto;
  max-height: calc(100dvh - 16px);
  margin: 8vh auto 0;
  overflow: auto;
}

.modal-table-wrap {
  margin-top: 8px;
  overflow: auto;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mapboxgl-map {
  position: relative;
  overflow: hidden;
}

.mapboxgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.mapboxgl-marker {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  will-change: transform;
}

.admin-map-tasks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.admin-map-task-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.admin-zone-tools button.is-active {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
}

.admin-map-zone-active .mapboxgl-canvas {
  cursor: crosshair;
}

.admin-zone-tools .hidden {
  display: none !important;
}

.admin-store-map {
  width: 100%;
  height: 336px;
  margin-top: 8px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 10px;
  background: #f8fafc;
}

/* زر سلة Mapbox Draw مخفي — نستخدم أزرارنا؛ trash يبقى مفعّلاً للاختصارات */
.admin-store-map .mapbox-gl-draw_trash {
  display: none !important;
}

.admin-store-map .mapboxgl-ctrl-top-left,
.admin-store-map .mapboxgl-ctrl-top-right {
  z-index: 2;
}

.maqadi-location-marker {
  pointer-events: none;
}

.maqadi-location-marker svg {
  display: block;
}

.store-product-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  cursor: zoom-in;
}

.previewable-image {
  cursor: zoom-in;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

.image-preview-overlay.hidden {
  display: none !important;
}

.image-preview-original {
  width: auto;
  height: auto;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 20px);
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: zoom-out;
}

@supports not (height: 100dvh) {
  .image-preview-original {
    max-height: calc(100vh - 20px);
  }
}

.icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.icon-btn svg {
  pointer-events: none;
}

.icon-btn-danger {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}

.icon-btn-danger:hover {
  background: #fee2e2;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  transition: 0.2s;
  border-radius: 999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  right: 4px;
  top: 4px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2b90e3;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(-22px);
}

body.is-mobile {
  font-size: 13px;
}

body.is-mobile .container {
  margin: 10px auto;
  padding: 0 8px;
}

body.is-mobile .card {
  padding: 8px;
}

body.is-mobile th,
body.is-mobile td {
  padding: 6px;
  font-size: 12px;
}

body.is-mobile table {
  table-layout: fixed;
}

body.is-mobile .mobile-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #9ca3af #f1f5f9;
  scrollbar-width: thin;
  -ms-overflow-style: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

body.is-mobile .mobile-table-scroll::-webkit-scrollbar {
  display: block;
  height: 7px;
}

body.is-mobile .mobile-table-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

body.is-mobile .mobile-table-scroll::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 999px;
}

body.is-mobile .mobile-table-scroll table {
  width: 100%;
  min-width: 470px;
  table-layout: fixed;
}

body.is-mobile .cart-table th:first-child,
body.is-mobile .cart-table td:first-child {
  width: 36px;
}

body.is-mobile .mobile-table-scroll th,
body.is-mobile .mobile-table-scroll td {
  white-space: nowrap;
}

body.is-mobile .cart-table th:nth-child(2),
body.is-mobile .cart-table td:nth-child(2) {
  width: 112px;
  white-space: normal;
  line-height: 1.35;
}

body.is-mobile .cart-table th:nth-child(3),
body.is-mobile .cart-table td:nth-child(3) {
  width: 58px;
  white-space: normal;
}

body.is-mobile .cart-table th:nth-child(5),
body.is-mobile .cart-table td:nth-child(5),
body.is-mobile .cart-table th:nth-child(6),
body.is-mobile .cart-table td:nth-child(6),
body.is-mobile .cart-table th:nth-child(7),
body.is-mobile .cart-table td:nth-child(7) {
  width: 64px;
}

body.is-mobile .cart-table th:nth-child(4),
body.is-mobile .cart-table td:nth-child(4) {
  width: 58px;
}

body.is-mobile .orders-table {
  min-width: 500px;
}

body.is-mobile .orders-table th:first-child,
body.is-mobile .orders-table td:first-child {
  width: 34px;
}

body.is-mobile .orders-table th:nth-child(2),
body.is-mobile .orders-table td:nth-child(2),
body.is-mobile .orders-table th:nth-child(4),
body.is-mobile .orders-table td:nth-child(4) {
  width: 76px;
}

body.is-mobile .orders-table th:nth-child(3),
body.is-mobile .orders-table td:nth-child(3),
body.is-mobile .orders-table th:nth-child(7),
body.is-mobile .orders-table td:nth-child(7) {
  width: 62px;
}

body.is-mobile .orders-table th:nth-child(5),
body.is-mobile .orders-table td:nth-child(5) {
  width: 96px;
}

body.is-mobile .orders-table th:nth-child(6),
body.is-mobile .orders-table td:nth-child(6) {
  width: 94px;
}

body.is-mobile .cart-table th,
body.is-mobile .cart-table td,
body.is-mobile .orders-table th,
body.is-mobile .orders-table td {
  padding: 4px 3px;
}

body.is-mobile .orders-table th:nth-child(2),
body.is-mobile .orders-table td:nth-child(2),
body.is-mobile .orders-table th:nth-child(3),
body.is-mobile .orders-table td:nth-child(3),
body.is-mobile .orders-table th:nth-child(6),
body.is-mobile .orders-table td:nth-child(6) {
  white-space: normal;
  line-height: 1.35;
}

@media (orientation: landscape) and (max-height: 520px) {
  body.is-mobile .mobile-table-scroll table,
  body.is-mobile .orders-table {
    width: 100%;
    min-width: 0;
  }

  body.is-mobile .mobile-table-scroll th,
  body.is-mobile .mobile-table-scroll td {
    padding: 5px 4px;
    font-size: 11px;
  }

  body.is-mobile .cart-table th:first-child,
  body.is-mobile .cart-table td:first-child {
    width: 7%;
  }

  body.is-mobile .cart-table th:nth-child(2),
  body.is-mobile .cart-table td:nth-child(2) {
    width: 27%;
  }

  body.is-mobile .cart-table th:nth-child(3),
  body.is-mobile .cart-table td:nth-child(3),
  body.is-mobile .cart-table th:nth-child(5),
  body.is-mobile .cart-table td:nth-child(5),
  body.is-mobile .cart-table th:nth-child(6),
  body.is-mobile .cart-table td:nth-child(6),
  body.is-mobile .cart-table th:nth-child(7),
  body.is-mobile .cart-table td:nth-child(7) {
    width: 13%;
  }

  body.is-mobile .cart-table th:nth-child(4),
  body.is-mobile .cart-table td:nth-child(4) {
    width: 14%;
  }

  body.is-mobile .orders-table th:first-child,
  body.is-mobile .orders-table td:first-child {
    width: 7%;
  }

  body.is-mobile .orders-table th:nth-child(2),
  body.is-mobile .orders-table td:nth-child(2) {
    width: 16%;
  }

  body.is-mobile .orders-table th:nth-child(3),
  body.is-mobile .orders-table td:nth-child(3),
  body.is-mobile .orders-table th:nth-child(4),
  body.is-mobile .orders-table td:nth-child(4),
  body.is-mobile .orders-table th:nth-child(7),
  body.is-mobile .orders-table td:nth-child(7) {
    width: 13%;
  }

  body.is-mobile .orders-table th:nth-child(5),
  body.is-mobile .orders-table td:nth-child(5),
  body.is-mobile .orders-table th:nth-child(6),
  body.is-mobile .orders-table td:nth-child(6) {
    width: 19%;
  }
}

body.is-mobile th,
body.is-mobile td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

body.is-mobile .products-grid {
  gap: 10px;
}

body.is-mobile .parent-category-block {
  padding: 8px;
}

body.is-mobile .subcategory-products-row {
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-inline-end: 10px;
  scroll-padding-inline: 10px;
}

body.is-mobile .subcategory-products-row::-webkit-scrollbar {
  display: none;
}

body.is-mobile .subcategory-products-row .product-card {
  flex: 0 0 36vw;
  min-width: 36vw;
}

body.is-mobile .product-card img {
  height: 82px;
}

body.is-mobile button {
  padding: 5px 9px;
  font-size: 12px;
}

body.is-mobile input,
body.is-mobile select,
body.is-mobile textarea {
  padding: 7px;
  font-size: 12px;
}

body.is-desktop {
  font-size: 14px;
}

.ad-slider-container {
  width: 100%;
  max-width: 1024px;
  height: 304px;
  margin: 0 auto 16px auto;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.ad-slider-track {
  display: flex;
  width: 400%;
  height: 100%;
  animation: adSlideAnimation 16s infinite ease-in-out;
}

.ad-slide {
  width: 25%;
  height: 100%;
  flex: 0 0 25%;
}

.ad-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes adSlideAnimation {
  0%, 20% { transform: translateX(0); }
  25%, 45% { transform: translateX(25%); }
  50%, 70% { transform: translateX(50%); }
  75%, 95% { transform: translateX(75%); }
  100% { transform: translateX(0); }
}

@media (max-width: 1024px) {
  .ad-slider-container {
    height: auto;
    aspect-ratio: 1024 / 304;
  }
}

.offer-badge-img {
  animation: offerPulse 1.5s infinite ease-in-out;
  transform-origin: center center;
}

@keyframes offerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
