/*
 * Shared components: header, bottom tab bar, touch targets and form borders.
 * Uses the variables in tokens.css. Selectors start with "body" so these rules win over older stylesheets
 * that are loaded later. Smallest touch target is 44 x 44 (Apple Human Interface Guidelines).
 */

/* Header actions: an icon beside a two-line label, 44 px high */
body .actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}
body .actions button:hover { background: var(--color-primary-soft); }
body .action-text { display: flex; flex-direction: column; align-items: flex-start; text-align: start; line-height: 1.25; }
body .action-icon { display: inline-flex; color: var(--color-primary); }
body .action-chevron { display: inline-flex; color: var(--color-text-secondary); }
body #bell { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap-min); min-width: var(--tap-min); color: var(--color-text); }
body #bell .ui-icon { color: var(--color-primary); }

/* Search field */
body .search > span { display: flex; align-items: center; top: 0; bottom: 0; font-size: inherit; color: var(--color-text-secondary); pointer-events: none; }
body .search input { min-height: var(--tap-min); border-color: var(--color-border-strong); }

/* Tablet and phone: keep the delivery area visible. It is what customers need before ordering. */
@media (max-width: 1000px) {
  body .actions .location { display: inline-flex; }
}
@media (min-width: 651px) and (max-width: 1000px) {
  body .actions .account { display: inline-flex; }
}
@media (max-width: 650px) {
  body .actions .location .action-text small,
  body .actions .location .action-chevron { display: none; }
  body .actions .location b { display: block; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Bottom tab bar (phones): icon above label, 56 px high, inactive labels in the secondary text colour */
body .mobile-nav { padding: var(--space-1) 0 calc(var(--space-1) + env(safe-area-inset-bottom)); }
body .mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: var(--tap-min);
  min-height: 56px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
body .mobile-nav span { display: flex; font-size: inherit; color: var(--color-primary); }

/* Touch targets and visible borders */
body .heart {
  right: auto;
  inset-inline-end: var(--space-1);
  top: var(--space-1);
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  font-size: inherit;
  color: var(--color-text);
}
body .heart .ui-icon-filled { color: var(--color-primary); }
body .add { display: grid; place-items: center; width: var(--tap-min); height: var(--tap-min); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); font-size: 24px; }
body .tab { display: inline-flex; align-items: center; min-height: var(--tap-min); border-color: var(--color-border-strong); }
body .tab.active { border-color: var(--color-primary); }
body .textlink { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap-min); }
body .nav button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-width: var(--tap-min); min-height: var(--tap-min); }
body .btn { min-height: var(--tap-min); }

/* WhatsApp button: on the inline-end side, so it moves to the left in Arabic and stays off right-aligned text */
body .whatsapp-fab { right: auto; inset-inline-end: max(16px, env(safe-area-inset-right)); }

/* Text links in the top bar, breadcrumb and footer get a 44px hit area. */
body .top-contact,body .breadcrumb a,body .footer-grid a{display:inline-flex;align-items:center;min-height:44px}

/* Inputs: a visible 3:1 border, 44px high, a clear focus ring. */
body input:not([type=radio]):not([type=checkbox]):not([type=file]):not([type=range]),body select,body textarea{border:1px solid var(--color-border-strong);border-radius:var(--radius-sm,8px);min-height:44px;background:var(--color-surface,#fff);color:var(--color-text)}
body input:focus-visible,body select:focus-visible,body textarea:focus-visible{outline:2px solid var(--color-primary);outline-offset:1px;border-color:var(--color-primary)}

/* Selectable card (checkout addresses): the whole card is the target; the chosen one gets a 2px primary outline. */
body .select-card{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;margin-bottom:12px;border:1px solid var(--color-border-strong);border-radius:12px;background:var(--color-surface,#fff);cursor:pointer;min-height:44px}
body .select-card:hover{border-color:var(--color-primary)}
body .select-card input[type=radio]{flex:none;width:22px;height:22px;margin:2px 0 0;accent-color:var(--color-primary)}
body .select-card:has(input:checked){border-color:var(--color-primary);box-shadow:0 0 0 1px var(--color-primary);background:var(--color-primary-soft,#f1f8f6)}
body .select-card:has(input:focus-visible){outline:2px solid var(--color-primary);outline-offset:2px}
body .select-card-body{flex:1;min-width:0}

/* Product pictures: a real photo when the catalogue has one, otherwise a tinted brand tile with a category icon. */
body .product-photo{width:100%;height:100%;object-fit:contain;padding:16px;mix-blend-mode:multiply}
body .product-art{--art:#087f70;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:100%;height:100%;min-height:170px;padding:16px;text-align:center;background:linear-gradient(150deg,color-mix(in srgb,var(--art) 16%,#fff),color-mix(in srgb,var(--art) 4%,#fff));color:var(--art)}
body .product-art-icon{display:grid;place-items:center;width:84px;height:84px;border-radius:50%;background:#fff;box-shadow:0 6px 18px color-mix(in srgb,var(--art) 22%,transparent)}
body .product-art b{margin-top:8px;font-size:17px;line-height:1.2;color:var(--color-text)}
body .product-art small{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--color-text-secondary)}
body .product-art-icon svg{width:44px;height:44px;max-width:none;position:static}
body .product-art b{font-size:15px}
body .details .product-visual .product-art-icon svg,body .product-visual .product-art-icon svg{width:44px;height:44px;filter:none}
body .details .product-art{min-height:100%;gap:10px}
body .details .product-art-icon{width:120px;height:120px}
body .details .product-art-icon svg{width:60px;height:60px}
body .details .product-art b{font-size:22px}
body .details .product-photo{padding:32px}

/* Product cards, as in the Figma design: a square photo area, the photo fills it, tag on top. */
body .product-media .product-visual{height:auto;aspect-ratio:1/1}
body .product-media .product-photo{width:100%;height:100%;padding:0;object-fit:cover;mix-blend-mode:normal}
body .product-media .tag{position:absolute;top:14px;inset-inline-start:14px;z-index:2;padding:4px 10px;border-radius:8px;background:rgba(255,255,255,.85);color:var(--color-primary);font-size:13px;font-weight:500}
body .product .add[aria-disabled="true"]{opacity:.55}
@media (max-width:650px){body .product-media .product-visual{height:auto}}
@media (max-width:650px){body .product-media .tag{display:none}body .product .price{font-size:15px;line-height:1.3}body .product .heart{top:4px;inset-inline-end:4px}}

/* Pharmacy preparations ("Made by our pharmacy"): banner and section, as designed in Figma. */
body .prep-section{margin-top:48px}
body .prep-banner{position:relative;display:flex;align-items:center;justify-content:space-between;gap:32px;overflow:hidden;margin:20px 0 24px;padding:56px 64px;border-radius:24px;color:#fff;background:linear-gradient(135deg,var(--color-deep,#0b3d36),var(--color-primary,#087f70))}
body .prep-banner::before{content:"";position:absolute;inset-inline-end:-120px;top:-160px;width:420px;height:420px;border-radius:50%;background:rgba(255,255,255,.07)}
body .prep-copy{position:relative;z-index:1;max-width:560px;display:grid;gap:14px}
body .prep-eyebrow{font-size:12px;font-weight:500;letter-spacing:.14em;opacity:.8}
body .prep-banner h2{margin:0;font-size:44px;line-height:1.2;color:#fff}
body .prep-banner p{margin:0;font-size:17px;line-height:1.6;opacity:.9;color:#fff}
body .prep-chips{display:flex;flex-wrap:wrap;gap:8px}
body .prep-chips span{padding:6px 12px;border:1px solid rgba(255,255,255,.3);border-radius:999px;background:rgba(255,255,255,.14);font-size:12px;font-weight:500}
body .prep-cta{justify-self:start;background:#fff;color:var(--color-primary-pressed,#055a50);border-radius:12px;min-height:48px;padding:0 24px}
body .prep-art{position:relative;z-index:1;flex:none;margin-inline-end:40px}
body .prep-disc{display:grid;place-items:center;width:224px;height:224px;border-radius:50%;background:#fff;color:var(--color-primary,#087f70);box-shadow:0 14px 40px rgba(0,0,0,.25)}
body .prep-disc svg{width:96px;height:96px;stroke-width:1.5}
@media (max-width:650px){body .prep-banner{flex-direction:column;align-items:flex-start;padding:28px 24px 24px;border-radius:20px}body .prep-banner h2{font-size:28px}body .prep-banner p{font-size:14px}body .prep-art{align-self:flex-end;margin:0}body .prep-disc{width:120px;height:120px}body .prep-disc svg{width:52px;height:52px}}

/* Price on the photo and a lighter currency, as in the Figma card. */
body .product-media .price-pill{position:absolute;bottom:14px;inset-inline-start:14px;z-index:2;padding:6px 14px;border-radius:999px;background:var(--color-primary,#087f70);color:#fff;font-size:15px;line-height:1.2}
body .product-media .price-pill .amt{font-size:20px;font-weight:600}
body .product .price .amt{font-weight:600}
body .product .price .cur,body .product-media .price-pill .cur{font-weight:400;font-size:.8em;letter-spacing:.02em}
body .product .price .cur{color:var(--muted)}
@media (max-width:650px){body .product-media .price-pill{bottom:8px;inset-inline-start:8px;padding:4px 10px}body .product-media .price-pill .amt{font-size:16px}}

/* Product page: the photo keeps its own background. No grey panel behind it, and it fits its square instead of spilling out. */
body .details .product-visual:has(.product-photo){height:auto;aspect-ratio:1/1;background:transparent;overflow:hidden;border-radius:14px}
body .details .product-visual .product-photo{width:100%;height:100%;padding:0;object-fit:cover;border-radius:inherit}
@media (max-width:650px){body .details .product-visual:has(.product-photo){height:auto}}
