
/* =========================================================
   UX enhancements  [2026-11-29]  (used by /sd-enhance.js)
   ========================================================= */
:root { --sd-red: #ec2635; --sd-red-text: #d01f2c; --sd-navy: #001845; --sd-section: 40px; }
@media (min-width: 768px) { :root { --sd-section: 56px; } }
@media (min-width: 1024px) { :root { --sd-section: 72px; } }

/* --- consistent spacing between sections (was 96px top + 96px bottom) --- */
html body:not(#sd) .page-content[class*="lg:py-24"] { padding-top: var(--sd-section) !important; padding-bottom: var(--sd-section) !important; }
html body:not(#sd) .page-content.no-padding { padding-top: 0 !important; padding-bottom: 0 !important; }
html body:not(#sd) .page-content.pt-0 { padding-top: 0 !important; }
html body:not(#sd) .page-content.pb-0 { padding-bottom: 0 !important; }

/* --- readable red text (brand red on white was 4.3:1, now 5:1) --- */
html body:not(#sd) .text-primary:not([class*="bg-"]), html body:not(#sd) .real-map-title { color: var(--sd-red-text) !important; }
html body:not(#sd) .real-map-note { color: #666 !important; }

/* --- buttons --- */
.sd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 999px;
  font-family: var(--sd-font); font-weight: 700; font-size: 1rem; line-height: 1; text-decoration: none !important; border: 2px solid transparent;
  transition: transform .15s ease, background-color .15s ease, color .15s ease; cursor: pointer; white-space: nowrap; }
.sd-btn:hover { transform: translateY(-1px); }
.sd-btn:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.sd-btn--primary { background: var(--sd-red); color: #fff !important; box-shadow: 0 8px 22px rgba(236, 38, 53, .35); }
.sd-btn--primary:hover { background: #c81d2a; }
.sd-btn--light { background: #fff; color: var(--sd-navy) !important; border-color: #fff; box-shadow: 0 8px 22px rgba(0, 24, 69, .18); }
.sd-btn--light:hover { background: var(--sd-navy); color: #fff !important; border-color: var(--sd-navy); }
.sd-btn svg { width: 20px; height: 20px; }
.sd-btn[disabled] { opacity: .6; cursor: progress; }

/* --- 1. hero buttons, placed under the text that is inside the banner image --- */
.sd-hero-cta { position: absolute; z-index: 20; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  left: 50%; transform: translateX(-50%); top: 41%; width: 92%; }
.sd-hero-cta .sd-btn { min-height: 44px; padding: 0 20px; font-size: .9375rem; }
@media (min-width: 481px) {
  .sd-hero-cta { left: 5.5%; transform: none; width: 27%; top: 44%; }
  .sd-hero-cta .sd-btn { min-height: 46px; }
}
@media (min-width: 1280px) { .sd-hero-cta .sd-btn { min-height: 52px; padding: 0 30px; font-size: 1.0625rem; } }

/* --- 2. stats bar --- */
.sd-stats { background: var(--sd-navy); color: #fff; padding: 22px 16px; }
.sd-stats:empty { min-height: 108px; }
.sd-stats__inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
@media (min-width: 768px) { .sd-stats { padding: 30px 24px; } .sd-stats__inner { grid-template-columns: repeat(4, 1fr); } }
.sd-stat { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.sd-stat + .sd-stat { border-inline-start: 1px solid rgba(255, 255, 255, .14); }
@media (max-width: 767px) { .sd-stat:nth-child(3) { border-inline-start: 0; } }
.sd-stat strong { font-family: var(--sd-font); font-size: 1.75rem; font-weight: 800; line-height: 1.2; color: #fff; }
@media (min-width: 1024px) { .sd-stat strong { font-size: 2.25rem; } }
.sd-stat span { font-family: var(--sd-font); font-size: var(--sd-body); color: rgba(255, 255, 255, .82); }

/* --- 3. one floating contact button (replaces the 3 separate ones) --- */
html.sd-enhanced .fixed-icon, html.sd-enhanced .sd-chat-open-btn { display: none !important; }
.sd-fab { position: fixed; right: 16px; bottom: 18px; z-index: 100001; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font-family: var(--sd-font); }
.sd-fab__toggle { width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--sd-red); color: #fff; cursor: pointer;
  box-shadow: 0 12px 28px rgba(236, 38, 53, .4); display: flex; align-items: center; justify-content: center; transition: transform .2s ease, background-color .2s ease; }
.sd-fab__toggle:hover { transform: scale(1.05); }
.sd-fab__toggle:focus-visible, .sd-fab__item:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.sd-fab__toggle svg { width: 28px; height: 28px; }
.sd-fab .sd-fab__icon-close { display: none; }
.sd-fab.is-open .sd-fab__icon-open { display: none; }
.sd-fab.is-open .sd-fab__icon-close { display: block; }
.sd-fab.is-open .sd-fab__toggle { background: var(--sd-navy); }
.sd-fab__menu { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.sd-fab__menu[hidden] { display: none; }
.sd-fab__item { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 999px; background: #fff; color: var(--sd-navy) !important;
  font-weight: 700; font-size: .9375rem; text-decoration: none !important; box-shadow: 0 8px 24px rgba(0, 24, 69, .18); animation: sdFabIn .18s ease both; }
html[dir="rtl"] .sd-fab__item { flex-direction: row-reverse; padding: 10px 14px 10px 18px; }
.sd-fab__item svg { width: 22px; height: 22px; flex: none; }
.sd-fab__item--wa svg { color: #1faa53; }
.sd-fab__item--call svg { color: var(--sd-red); }
.sd-fab__item--chat svg { color: var(--sd-navy); }
.sd-fab__item:hover { background: #f3f5f9; }
.sd-fab__item:nth-child(2) { animation-delay: .04s; } .sd-fab__item:nth-child(3) { animation-delay: .08s; }
@keyframes sdFabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .sd-fab { right: 12px; bottom: 14px; } .sd-fab__toggle { width: 56px; height: 56px; } }

/* --- 4. missing section title --- */
html body:not(#sd) .sd-section-title { font-family: var(--sd-font); font-size: var(--sd-title) !important; line-height: 1.35 !important; font-weight: 800 !important; color: #111 !important; margin: 6px 0 14px; }

/* --- 5. nearest branch --- */
.sd-nearest { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 14px auto 22px; text-align: center; font-family: var(--sd-font); }
.sd-nearest__result:empty { display: none; }
.sd-nearest__result { font-size: var(--sd-body); color: #444; }
.sd-nearest__card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: #fff; border: 1px solid #e6e8ee;
  border-radius: 18px; padding: 14px 18px; box-shadow: 0 10px 26px rgba(0, 24, 69, .08); min-width: min(100%, 420px); text-align: start; }
.sd-nearest__card .sd-btn--light { border-color: var(--sd-navy); }
.sd-nearest__label { display: block; font-size: var(--sd-small); color: #666; }
.sd-nearest__card strong { display: block; font-size: var(--sd-subtitle); color: var(--sd-navy); font-weight: 800; }
.sd-nearest__dist { display: block; font-size: var(--sd-small); color: #555; }

/* stats bar sits directly under the banner */
/* reserve the stats bar height from the first paint so nothing jumps when it appears */
:root { --sd-stats-h: 196px; }
@media (min-width: 768px) { :root { --sd-stats-h: 128px; } }
@media (min-width: 1024px) { :root { --sd-stats-h: 140px; } }
html body:not(#sd) header[data-v-132d6879] { margin-bottom: calc(var(--sd-stats-h) + var(--sd-section)) !important; }
html.sd-has-stats body:not(#sd) header[data-v-132d6879] { margin-bottom: 0 !important; }
html body:not(#sd) .sd-stats { height: var(--sd-stats-h); box-sizing: border-box; display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 0 0 var(--sd-section) !important; padding-top: 0 !important; padding-bottom: 0 !important; }
html body:not(#sd) .sd-stats__inner { width: 100%; }
@media (min-width: 1280px) { .sd-hero-cta .sd-btn { min-height: 56px; padding: 0 34px; font-size: 1.125rem; } }

@media (min-width: 481px) and (max-width: 1023px) { .sd-hero-cta { width: 36%; gap: 8px; } .sd-hero-cta .sd-btn { min-height: 40px; padding: 0 14px; font-size: .875rem; } }

html body:not(#sd) h2.real-map-title { font-size: calc(var(--sd-subtitle) + 4px) !important; line-height: 1.4 !important; }

/* banner keeps its height before the slider script starts (stops the page jumping) */
html body:not(#sd) header[data-v-132d6879] { aspect-ratio: 2350 / 1100; }
@media (max-width: 480px) { html body:not(#sd) header[data-v-132d6879] { aspect-ratio: 1090 / 1820; } }

/* Google Maps page link for the selected branch */
.sd-gmaps-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-family: var(--sd-font); font-weight: 700; font-size: var(--sd-small); color: var(--sd-navy) !important; text-decoration: underline !important; text-underline-offset: 3px; }
.sd-gmaps-link svg { width: 18px; height: 18px; color: var(--sd-red); flex: none; }
.sd-nearest__gmaps { display: block; margin-top: 4px; font-size: var(--sd-small); font-weight: 700; color: var(--sd-red-text) !important; text-decoration: underline !important; text-underline-offset: 3px; }

/* --- 8. branches map (only Saudi Doors branches) --- */
html.sd-enhanced .real-map-panel { display: flex; flex-direction: column; }
.sd-branch-map { flex: 1 1 auto; width: 100%; min-height: 520px; border-radius: 16px; overflow: hidden; z-index: 1; background: #e9eef2; }
@media (max-width: 767px) { .sd-branch-map { min-height: 420px; } }
.sd-branch-map.leaflet-container { font-family: var(--sd-font); }
.sd-pin-wrap { background: none !important; border: 0 !important; }
.sd-pin { position: relative; width: 40px; height: 48px; display: flex; flex-direction: column; align-items: center; }
.sd-pin__logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid var(--sd-red); box-shadow: 0 4px 12px rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center; position: relative; box-sizing: border-box; }
.sd-pin__logo::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--sd-red); }
.sd-pin__logo img { width: 22px !important; height: 22px !important; object-fit: contain !important; }
.sd-pin__label { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #fff; color: var(--sd-navy); font: 700 12px/1.2 var(--sd-font); padding: 4px 9px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,24,69,.22); pointer-events: none; }
.sd-pin-wrap:hover, .sd-pin-wrap:focus { z-index: 1000 !important; }
.sd-pin-wrap:hover .sd-pin__label, .sd-pin-wrap:focus .sd-pin__label { visibility: visible !important; }
.sd-pop { font-family: var(--sd-font); min-width: 190px; }
.sd-pop strong { display: block; font-size: 15px; font-weight: 800; color: var(--sd-navy); margin-bottom: 10px; }
.sd-pop__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-pop .sd-btn { min-height: 36px; padding: 0 14px; font-size: 13px; box-shadow: none; }
.sd-pop .sd-btn--light { border-color: var(--sd-navy); }

/* main factory pin: bigger, navy ring, always on top */
.sd-pin--factory { width: 48px; height: 56px; }
.sd-pin--factory .sd-pin__logo { width: 46px; height: 46px; border: 4px solid var(--sd-navy); }
.sd-pin--factory .sd-pin__logo::after { border-top-color: var(--sd-navy); bottom: -11px; }
.sd-pin--factory .sd-pin__logo img { width: 26px !important; height: 26px !important; }
.sd-pin--factory .sd-pin__label { top: 56px; background: var(--sd-navy); color: #fff; font-size: 13px; }
.sd-pop__tag { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: var(--sd-navy); color: #fff; font-size: 11px; font-weight: 700; }

/* --- 9. wide branches map section (desktop / tablet / mobile) --- */
html body:not(#sd) .real-showrooms-map {
  width: min(1760px, calc(100vw - 48px)) !important; max-width: none !important;
  margin-left: calc(50% - min(880px, 50vw - 24px)) !important; margin-right: calc(50% - min(880px, 50vw - 24px)) !important;
  grid-template-columns: 340px minmax(0, 1fr) !important; gap: 20px !important;
}
html body:not(#sd) .real-map-panel { min-height: 640px !important; }
.sd-branch-map { min-height: 640px; }
@media (min-width: 1600px) { html body:not(#sd) .real-map-panel, .sd-branch-map { min-height: 720px !important; } }

/* tablet: list on top as a grid of city buttons, map full width under it */
@media (max-width: 1023px) {
  html body:not(#sd) .real-showrooms-map { width: calc(100vw - 32px) !important; margin-left: calc(50% - (50vw - 16px)) !important; margin-right: calc(50% - (50vw - 16px)) !important; grid-template-columns: 1fr !important; gap: 16px !important; }
  html body:not(#sd) .real-map-sidebar { min-height: 0 !important; }
  html body:not(#sd) .real-city-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important; gap: 8px !important; }
  html body:not(#sd) .real-city-list .real-city-btn { margin: 0 !important; width: 100% !important; }
  html body:not(#sd) .real-map-panel, .sd-branch-map { min-height: 560px !important; }
}
/* mobile */
@media (max-width: 640px) {
  html body:not(#sd) .real-showrooms-map { width: calc(100vw - 20px) !important; margin-left: calc(50% - (50vw - 10px)) !important; margin-right: calc(50% - (50vw - 10px)) !important; gap: 12px !important; }
  html body:not(#sd) .real-map-sidebar { padding: 16px !important; }
  html body:not(#sd) .real-city-list { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
  html body:not(#sd) .real-city-list .real-city-btn { height: 40px !important; font-size: 13px !important; padding: 0 6px !important; }
  html body:not(#sd) .real-map-panel, .sd-branch-map { min-height: 460px !important; }
  .sd-pin__label { font-size: 11px; padding: 3px 7px; }
}
