/* Design audit fixes (2026-11-26). Loaded last. See IMPLEMENTATION_PROGRESS.md. */

/* 1. Arabic letters join: any letter-spacing breaks the connections between glyphs. */
html[lang="ar"] *, html[lang="ar"] *::before, html[lang="ar"] *::after,
html[dir="rtl"] *, html[dir="rtl"] *::before, html[dir="rtl"] *::after {
  letter-spacing: 0 !important;
}

/* 2. Touch targets: keep the visual size, extend the tappable area to 44x44. */
.wish-button, .add-button, .header-action, .mobile-menu-toggle,
.close-button, .cart-pick-add, .whatsapp-float { position: relative; }
.wish-button { position: absolute; }
.whatsapp-float { position: fixed; }
.wish-button::after, .add-button::after, .header-action::after, .mobile-menu-toggle::after,
.close-button::after, .cart-pick-add::after, .whatsapp-float::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
}

/* 3. Tap feedback uses the brand tint, not the browser's default blue flash. */
a, button, input, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: rgba(46, 58, 140, .12);
}

/* 4. Explicit transition properties (these rules used `transition: <time>`, which animates `all`:
      layout properties and anything a later rule changes). Durations are kept. */
.support-link, .search-box, .button-primary, .category-pill, .staff-link {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
}
.product-card { transition-property: transform, box-shadow, border-color, opacity; }
.hero-dot { transition-property: background-color, width, opacity, transform; }
.drawer-progress i { transition-property: width, transform; }
.toggle-switch, .toggle-switch i { transition-property: background-color, border-color, transform, left, right, inset-inline-start; }
.toast-out { transition-property: opacity, transform; }
/* The global `button, a, input, select { transition-duration: .2s }` left the property at its default (`all`). */
button, a, input, select, textarea {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
}

/* 5. Forms: 16px on touch widths so iOS Safari does not zoom the page on focus. */
@media (max-width: 820px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
  select, textarea { font-size: 16px; }
}

/* 6. Checkout */
.checkout-modal .section-kicker { font-size: 11px; color: #5B6478; letter-spacing: .08em; }
.checkout-progress button span, .checkout-steps span { color: #5B6478; }
.checkout-progress button.active span { color: #fff; }
.checkout-modal .checkout-progress {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: rgba(29, 29, 31, .08);
}
.manual-fields { background: #F5F6FB; border-color: #DDE1F0; }
.transfer-copy { background: #EEF0F7; color: #2E3A8C; border-color: #D9DCE8; }
@media (prefers-reduced-transparency: reduce) {
  .checkout-modal .checkout-progress { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* 7. Account */
.ae-ico::after { display: none; }          /* red dot on an empty state read as an alert */
.ss-banner { flex-wrap: nowrap; justify-content: space-between; text-align: start; padding: 10px 16px; font-size: 14px; line-height: 1.4; }
.ss-banner > span { flex: 1 1 auto; min-width: 0; }
.ss-banner button { min-height: 44px; min-width: 44px; padding-inline: 8px; }

/* 8. Floating help button: icon-only on phones so it stops covering content. */
#whatsappButton { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) {
  #whatsappButton { width: 52px; height: 52px; min-width: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  #whatsappButton small { display: none; }
}
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }

/* 9. Account: tab strip shows an edge hint where more tabs are scrollable (pure CSS, no JS). */
#accountPage .customer-portal-sidebar nav {
  background:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left,  #fff 30%, rgba(255,255,255,0)) right center / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(29,29,31,.10), rgba(29,29,31,0)) left center / 12px 100% no-repeat scroll,
    linear-gradient(to left,  rgba(29,29,31,.10), rgba(29,29,31,0)) right center / 12px 100% no-repeat scroll;
}
@media (min-width: 900px) { #accountPage .customer-portal-sidebar nav { background: none; } }
.account-actions .button-quiet { white-space: nowrap; }

/* 6b. Checkout: stronger selectors (older rules win otherwise). */
.checkout-modal .checkout-progress button span { color: #5B6478 !important; }
.checkout-modal .checkout-progress button.active span { color: #fff !important; }
.checkout-modal .checkout-progress button:disabled { opacity: .85; }
.checkout-modal > .section-kicker { display: block; margin-top: 40px; }
.checkout-modal .section-kicker { color: #5B6478 !important; }
.checkout-modal .manual-fields { background: #F5F6FB !important; border-color: #DDE1F0 !important; }
.checkout-modal .transfer-destination-card { border-color: #DDE1F0 !important; color: #1D1D1F; }
.checkout-modal .transfer-destination-card strong { color: #1D1D1F; }
.checkout-modal .transfer-copy { background: #EEF0F7 !important; color: #2E3A8C !important; border-color: #D9DCE8 !important; }
.checkout-modal input[type="file"]::file-selector-button { background: #EEF0F7; color: #2E3A8C; border: 1px solid #D9DCE8; }
.checkout-modal .coupon-ticket { background: #EEF0F7 !important; color: #2E3A8C !important; border-color: #D9DCE8 !important; }

/* Carousel controls: thin chevron icons instead of arrow glyphs; mirrored in RTL so "previous" points to its own side. */
.product-carousel-controls .carousel-chevron { width: 18px; height: 18px; display: block; margin: auto; }
[dir="rtl"] .product-carousel-controls .carousel-chevron { transform: scaleX(-1); }

/* 10. Legibility floor on the storefront: badges and struck-through prices were 7-10px. */
body:not(.admin-view) .product-card .discount-badge,
body:not(.admin-view) .product-card .type-badge,
body:not(.admin-view) .product-card .stock-badge { font-size: 11px; line-height: 1.2; }
body:not(.admin-view) .product-card del { font-size: 12px; }
body:not(.admin-view) .header-actions .counter, body:not(.admin-view) .cart-button .counter { font-size: 10px; }
/* Text links get a taller tap area without changing how they look. */
body:not(.admin-view) .section-link, body:not(.admin-view) .quick-view, body:not(.admin-view) #homeDealsAll { position: relative; }
body:not(.admin-view) .section-link::after, body:not(.admin-view) .quick-view::after, body:not(.admin-view) #homeDealsAll::after { content: ""; position: absolute; inset: -12px -6px; }

/* 11. Newsletter: brand navy (not the bright gradient), readable label, 48px target. */
body:not(.admin-view) .newsletter form button, body:not(.admin-view) #newsletterForm .button-primary {
  background: #2E3A8C !important; background-image: none !important; color: #fff !important; box-shadow: none !important;
  min-height: 48px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 700; white-space: nowrap;
  transition-property: background-color, transform; transition-duration: .15s;
}
body:not(.admin-view) #newsletterForm .button-primary:hover { background: #243174 !important; }
body:not(.admin-view) #newsletterForm .button-primary:active { transform: scale(.97); }
body:not(.admin-view) #newsletterForm input { min-height: 48px; }
@media (max-width: 560px) {
  body:not(.admin-view) #newsletterForm { flex-direction: column; align-items: stretch; gap: 10px; }
  body:not(.admin-view) #newsletterForm input, body:not(.admin-view) #newsletterForm .button-primary { width: 100%; box-sizing: border-box; }
  body:not(.admin-view) .newsletter p { font-size: 14px; }
}

/* 12. Product page: the photo fills its tile (no white frame around a grey square) and links use the brand navy. */
#productDetailPage .pd-main-image { background: #F5F5F7; }
#productDetailPage .pd-main-image img { padding: 0 !important; width: 100%; height: 100%; object-fit: contain; }
#productDetailPage .pd-main-image img[src*="win11-card"] { mix-blend-mode: multiply; }  /* the only photo on pure white */
body:not(.admin-view) .quick-view { color: #2E3A8C; }
/* Tablet: the purchase card spans the row instead of leaving an empty half beside it. */
@media (min-width: 701px) and (max-width: 1023px) {
  #productDetailPage .pd-purchase { grid-column: 1 / -1; width: 100%; max-width: none; box-sizing: border-box; }
}
