/* Lahza opt-in dark theme. Light theme is intentionally unchanged unless data-theme="dark" is set. */
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #172733;
  --surface: #203542;
  --surface-muted: #293f4c;
  --text: #edf3f6;
  --muted: #bac9d2;
  --border: #49606d;
  /* Shared inline service-page tokens. */
  --petrol: #27495b;
  --orange: #f08b25;
  --line: #49606d;
  --muted: #bac9d2;
  background: var(--page) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body {
  background: var(--page) !important;
  color: var(--text);
}

/* Homepage: recolor utility-defined light surfaces, never the hero imagery or CTA fills. */
html[data-theme="dark"] .public-home {
  background-color: var(--page);
  color: var(--text);
}
html[data-theme="dark"] .public-home :is(.bg-white, .bg-gray-50, .bg-gray-100, .bg-slate-50, .bg-slate-100, .bg-zinc-50, .bg-zinc-100, .bg-neutral-50, .bg-neutral-100) {
  background-color: var(--surface) !important;
}
html[data-theme="dark"] .public-home :is(.border-gray-100, .border-gray-200, .border-slate-100, .border-slate-200, .border-zinc-100, .border-zinc-200, .border-neutral-100, .border-neutral-200) {
  border-color: var(--border) !important;
}
html[data-theme="dark"] .public-home :is(.text-gray-500, .text-gray-600, .text-gray-700, .text-gray-800, .text-gray-900, .text-slate-500, .text-slate-600, .text-slate-700, .text-slate-800, .text-slate-900, .text-zinc-500, .text-zinc-600, .text-zinc-700, .text-zinc-800, .text-zinc-900, .text-neutral-500, .text-neutral-600, .text-neutral-700, .text-neutral-800, .text-neutral-900) {
  color: var(--text) !important;
}
html[data-theme="dark"] .public-home :is(.text-gray-400, .text-slate-400, .text-zinc-400, .text-neutral-400) {
  color: var(--muted) !important;
}
html[data-theme="dark"] .public-home :is(input, select, textarea, .form-control, [role="dialog"], [role="alertdialog"], .modal, .modal-content, .dialog, .dialog-content, .chat-widget, .chat-panel) {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .public-home :is(input, select, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
html[data-theme="dark"] .public-home :is(#services, #site-offers, #reviews, #branches, #contact, #booking, .services-section, .offers-section, .reviews-section, .branches-section, .booking-section) {
  color: var(--text);
}

/* The administration portal uses a separate React entry point and opts in via data-admin-page. */
html[data-theme="dark"] body[data-admin-page="true"] {
  background: var(--page) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] :is(.bg-white, .bg-slate-50, .bg-slate-100, .bg-gray-50, .bg-gray-100) {
  background-color: var(--surface) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] [class*="bg-white/"] {
  background-color: var(--surface) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] :is(.border-slate-100, .border-slate-200, .border-gray-100, .border-gray-200) {
  border-color: var(--border) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] :is(.text-slate-900, .text-slate-800, .text-slate-700, .text-slate-600, .text-gray-900, .text-gray-800, .text-gray-700, .text-gray-600) {
  color: var(--text) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] :is(.text-slate-500, .text-slate-400, .text-gray-500, .text-gray-400) {
  color: var(--muted) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] [class*="bg-[#f4f6f8]"],
html[data-theme="dark"] body[data-admin-page="true"] [class*="bg-[#f8fafc]"],
html[data-theme="dark"] body[data-admin-page="true"] [class*="bg-[#f1f5f9]"] {
  background-color: var(--page) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] [class*="text-[#27495B]"] {
  color: #dbe8ed !important;
}
html[data-theme="dark"] body[data-admin-page="true"] :is(input, select, textarea) {
  background-color: var(--surface-muted) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] body[data-admin-page="true"] :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
html[data-theme="dark"] body[data-admin-page="true"] .lahza-preference-controls button {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}

/* Shared server-rendered service pages. Dark hero and footer treatments remain intact. */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .mobile-links {
  background-color: var(--surface) !important;
  color: var(--text);
  border-color: var(--border) !important;
}
html[data-theme="dark"] .main-nav,
html[data-theme="dark"] .main-nav a,
html[data-theme="dark"] .mobile-links a,
html[data-theme="dark"] .breadcrumbs a,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .service-card h2 {
  color: var(--text) !important;
}
html[data-theme="dark"] .service-card {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text);
}
html[data-theme="dark"] .service-card p,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .note,
html[data-theme="dark"] .availability-note {
  color: var(--muted) !important;
}
html[data-theme="dark"] .note,
html[data-theme="dark"] .availability-note {
  background-color: var(--surface-muted) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] :is(input, select, textarea, .booking-panel, .booking-dialog, .booking-content, .booking-frame) {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] :is(input, select, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
html[data-theme="dark"] .booking-overlay {
  background-color: rgb(13 25 33 / 88%);
}
html[data-theme="dark"] .booking-overlay :is(.booking-panel, .booking-dialog, .booking-content) {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Consistent, visible keyboard focus with the existing orange brand accent. */
html[data-theme="dark"] :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #ffb45e !important;
  outline-offset: 3px;
}
html[data-theme="dark"] :is(input, select, textarea) {
  accent-color: #f08b25;
}

/* Optional preference controls: stylesheet support only; it does not insert controls. */
.lahza-preference-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}
.lahza-preference-controls button {
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #78909c;
  border-radius: 999px;
  background: #f4f7f8;
  color: #243744;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.lahza-preference-controls button:hover {
  border-color: #f08b25;
}
.lahza-preference-controls button:focus-visible {
  outline: 3px solid #b85808;
  outline-offset: 3px;
}
html[data-theme="dark"] .lahza-preference-controls button {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
}
html[data-theme="dark"] .lahza-preference-controls button:focus-visible {
  outline-color: #ffb45e;
}
@media (max-width: 480px) {
  .lahza-preference-controls { gap: 0.3rem; }
  .lahza-preference-controls button { min-height: 2.125rem; padding-inline: 0.6rem; font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lahza-preference-controls button { transition: none; }
}


/* Shared language/theme preference controls and bilingual layout support. */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
.lahza-preference-controls { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; max-width:100%; }
.lahza-preference-controls button,
.lahza-tracking-desktop,
.lahza-tracking-mobile {
  min-height:2.25rem; padding:.38rem .72rem; border:1px solid #9aabb3; border-radius:999px;
  background:#fff; color:#27495b; font:inherit; font-size:.9rem; font-weight:800; line-height:1.2;
  cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center;
  white-space:nowrap; transition:background-color 160ms ease,color 160ms ease,border-color 160ms ease,transform 140ms ease;
}
.lahza-preference-controls button:hover,
.lahza-tracking-desktop:hover,
.lahza-tracking-mobile:hover { border-color:#f08b25; background:#fff7ed; }
.lahza-preference-controls button:active,
.lahza-tracking-desktop:active,
.lahza-tracking-mobile:active { transform:scale(.97); }
.lahza-preference-controls button:focus-visible,
.lahza-tracking-desktop:focus-visible,
.lahza-tracking-mobile:focus-visible { outline:3px solid #b85808; outline-offset:3px; }
.lahza-preference-controls-desktop { flex:0 0 auto; }
.lahza-preference-controls-mobile { display:none; }
.lahza-tracking-mobile { display:none; }
html[data-theme="dark"] .lahza-preference-controls button,
html[data-theme="dark"] .lahza-tracking-desktop,
html[data-theme="dark"] .lahza-tracking-mobile { color:var(--text); background:var(--surface-muted); border-color:var(--border); }
html[data-theme="dark"] .lahza-preference-controls button:hover,
html[data-theme="dark"] .lahza-tracking-desktop:hover,
html[data-theme="dark"] .lahza-tracking-mobile:hover { background:#344e5c; border-color:#f08b25; }

/* English direction: convert physical utility alignment/spacing to logical equivalents. */
html[lang="en"] body { direction:ltr; text-align:left; }
html[lang="en"] [dir="rtl"] { direction:ltr !important; }
html[lang="en"] .text-right { text-align:left !important; }
html[lang="en"] .text-left { text-align:right !important; }
html[lang="en"] [class~="ml-1"] { margin-left:0 !important; margin-right:.25rem !important; }
html[lang="en"] [class~="ml-2"] { margin-left:0 !important; margin-right:.5rem !important; }
html[lang="en"] [class~="ml-3"] { margin-left:0 !important; margin-right:.75rem !important; }
html[lang="en"] [class~="ml-4"] { margin-left:0 !important; margin-right:1rem !important; }
html[lang="en"] [class~="mr-1"] { margin-right:0 !important; margin-left:.25rem !important; }
html[lang="en"] [class~="mr-2"] { margin-right:0 !important; margin-left:.5rem !important; }
html[lang="en"] [class~="mr-3"] { margin-right:0 !important; margin-left:.75rem !important; }
html[lang="en"] [class~="mr-4"] { margin-right:0 !important; margin-left:1rem !important; }
html[lang="en"] input, html[lang="en"] textarea, html[lang="en"] select { text-align:left; }
html[lang="en"] :is(#trackingOrderIdInput,#trackingSecretInput,[inputmode="tel"],[type="tel"],[type="email"]) { direction:ltr; }
html[lang="en"] .breadcrumbs li+li:before { content:'→'; }

/* More neutral dark surfaces for modals, cards, navigation and generated content. */
html[data-theme="dark"] .public-home :is(.bg-blue-50,.bg-blue-100,.bg-orange-50,.bg-orange-50\/50,.bg-orange-50\/70,.bg-emerald-50,.bg-green-50,.bg-amber-50,.bg-red-50) { background-color:var(--surface-muted) !important; }
html[data-theme="dark"] .public-home :is(.text-lahza-blue,.text-blue-900,.text-blue-800,.text-blue-700,.text-emerald-800,.text-green-800,.text-amber-900) { color:#d9eaf1 !important; }
html[data-theme="dark"] .public-home :is(.border-blue-100,.border-blue-200,.border-orange-100,.border-orange-200,.border-emerald-100,.border-amber-100) { border-color:var(--border) !important; }
html[data-theme="dark"] .public-home :is(.bg-blue-600,.bg-lahza-blue,.bg-emerald-600,.bg-green-600) { color:#fff !important; }
html[data-theme="dark"] .public-home :is(.modal-panel,#mobileMenu,#mobileMenu nav,.booking-modal,.tracking-modal) { background-color:var(--surface) !important; color:var(--text) !important; border-color:var(--border) !important; }
html[data-theme="dark"] .public-home :is(.bg-gray-50,.bg-gray-100,.bg-white) { background-color:var(--surface) !important; }
html[data-theme="dark"] .public-home :is(.bg-orange-50\/70,#site-offers) { background-color:var(--surface-muted) !important; }
html[data-theme="dark"] .public-home :is(.bg-green-100,.bg-emerald-100) { background-color:#23483d !important; }
html[data-theme="dark"] .public-home :is(.text-green-600,.text-emerald-600) { color:#76d6a7 !important; }
html[data-theme="dark"] .public-home :is(input,select,textarea) { color-scheme:dark; }
html[data-theme="dark"] .site-header .lahza-tracking-desktop { color:var(--text) !important; }

@media (max-width: 1120px) and (min-width: 768px) {
  .lahza-preference-controls-desktop { flex-basis:100%; justify-content:flex-end; }
  .nav-inner { flex-wrap:wrap; padding-block:.45rem; }
  .nav-inner > .lahza-preference-controls-desktop { order:5; }
  .main-nav { gap:14px !important; }
  .lahza-preference-controls button,.lahza-tracking-desktop { min-height:2rem; padding:.32rem .55rem; font-size:.84rem; }
}
@media (max-width: 767px) {
  .lahza-preference-controls-desktop,.lahza-tracking-desktop { display:none !important; }
  .lahza-preference-controls-mobile { display:flex; }
  .lahza-tracking-mobile { display:flex; width:100%; }
  .lahza-home-actions { flex-wrap:wrap; }
  .lahza-home-actions .lahza-preference-controls-mobile { flex:0 0 100%; justify-content:flex-end; order:3; }
  .mobile-nav .lahza-preference-controls-mobile { padding:.5rem .75rem .75rem; justify-content:flex-start; }
  .mobile-nav .lahza-tracking-mobile { margin:.4rem 0; }
  .mobile-nav[open] { background:transparent; }
  .lahza-preference-controls { gap:.3rem; }
  .lahza-preference-controls button,.lahza-tracking-mobile { min-height:2.125rem; padding:.36rem .62rem; font-size:.86rem; }
  html[lang="en"] .lahza-preference-controls-mobile { direction:ltr; }
}
@media (prefers-reduced-motion: reduce) {
  .lahza-preference-controls button,.lahza-tracking-desktop,.lahza-tracking-mobile { transition:none; }
}
.lahza-subpage-mobile-actions { display:none; }
@media (max-width: 767px) {
  .lahza-subpage-mobile-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:.35rem; max-width:58%; }
  .lahza-subpage-mobile-actions .lahza-tracking-mobile { width:auto; }
  .lahza-subpage-mobile-actions .lahza-preference-controls-mobile { flex:0 0 auto; }
  .lahza-subpage-mobile-actions .lahza-preference-controls button { min-width:2.25rem; }
  .nav-inner { gap:8px !important; }
  .brand img { max-width:34vw; }
}
@media (max-width: 380px) {
  .lahza-subpage-mobile-actions { max-width:62%; gap:.25rem; }
  .lahza-subpage-mobile-actions .lahza-preference-controls button { padding-inline:.48rem; }
  .nav-inner { gap:5px !important; }
}
