/* ============================================================
   SaudiOne Tourism Theme - Layout & Components
   Brand Identity: Deep Navy + Saudi Green + Desert Gold
   All colors controlled via admin theme settings.
   ============================================================ */

/* ---- ISLAMIC GEOMETRIC PATTERN (subtle background for dark sections) ---- */
.so-pattern-bg {
  position: relative;
}
.so-pattern-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23FF725E' stroke-width='0.5'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z'/%3E%3Cpath d='M20 0L40 20L20 40L0 20Z'/%3E%3Cpath d='M60 0L80 20L60 40L40 20Z'/%3E%3Cpath d='M20 40L40 60L20 80L0 60Z'/%3E%3Cpath d='M60 40L80 60L60 80L40 60Z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3Ccircle cx='0' cy='0' r='8'/%3E%3Ccircle cx='80' cy='0' r='8'/%3E%3Ccircle cx='0' cy='80' r='8'/%3E%3Ccircle cx='80' cy='80' r='8'/%3E%3Cpath d='M40 28L52 40L40 52L28 40Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ---- FIELD TEMPLATE OVERRIDES ---- */
.so-field {
  margin-bottom: 0;
}
.so-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--so-stone);
  margin-bottom: 0.375rem;
}
.so-field--single {
  display: block;
}
/* Simple multi-value fields (text, string, chips) — horizontal flex wrap */
.so-field--simple .so-field__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ---- PARAGRAPH FIELD LAYOUT ----
 * DEFAULT: Paragraph fields stack vertically (for top-level sections).
 * OVERRIDE: Inside grid containers, they become transparent via display:contents.
 */

/* 1) Default: ALL paragraph fields stack vertically */
.so-field--paragraphs {
  display: block;
  width: 100%;
}
.so-field--paragraphs > .so-field__items {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}
.so-field--paragraphs > .so-field__items > .so-field__item {
  display: block;
  width: 100%;
}

/* 2) OVERRIDE: Inside grid/flex containers, make field wrappers transparent.
 * display:contents removes the element from the layout tree so the
 * parent grid controls the card elements directly.
 * These rules are MORE SPECIFIC (2+ classes) so they win over the defaults above.
 */
.so-services-grid__items .so-field--paragraphs,
.so-services-grid__items .so-field__items,
.so-services-grid__items .so-field__item,
.so-destinations-grid__items .so-field--paragraphs,
.so-destinations-grid__items .so-field__items,
.so-destinations-grid__items .so-field__item,
.so-trust-features__grid .so-field--paragraphs,
.so-trust-features__grid .so-field__items,
.so-trust-features__grid .so-field__item,
.so-how-it-works__steps .so-field--paragraphs,
.so-how-it-works__steps .so-field__items,
.so-how-it-works__steps .so-field__item,
.so-portal-links__grid .so-field--paragraphs,
.so-portal-links__grid .so-field__items,
.so-portal-links__grid .so-field__item,
.so-featured-content__cards .so-field--paragraphs,
.so-featured-content__cards .so-field__items,
.so-featured-content__cards .so-field__item {
  display: contents !important;
}

/* OVERRIDE: Nested paragraph fields inside grid/flex containers
 * become transparent so the PARENT controls the card layout.
 * These selectors are more specific than the defaults above.
 */

/* ---- MENU TEMPLATE OVERRIDES ---- */
.so-menu {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.so-menu__item {
  margin: 0;
  padding: 0;
}
.so-menu__link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--so-radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.so-menu__link:hover,
.so-menu__link.is-active {
  background: rgba(8,127,114, 0.15);
  color: var(--so-primary-light);
}
.so-menu--sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  min-width: 12rem;
  padding: 0.375rem;
  background: var(--so-deep-navy);
  border: 1px solid var(--so-royal-navy);
  border-radius: var(--so-radius-md);
  box-shadow: var(--so-shadow-lg);
  flex-direction: column;
  gap: 0;
}
.so-menu__item--expanded {
  position: relative;
}
.so-menu__item--expanded:hover > .so-menu--sub,
.so-menu__item--expanded:focus-within > .so-menu--sub {
  display: flex;
}
.so-menu--sub .so-menu__link {
  padding: 0.5rem 0.75rem;
  border-radius: var(--so-radius-sm);
  width: 100%;
}
.so-menu--sub .so-menu__link:hover {
  background: rgba(8,127,114, 0.2);
  color: #fff;
}
[dir="rtl"] .so-menu--sub {
  left: auto;
  right: 0;
}

/* ---- TABS (local tasks) ---- */
.so-tabs {
  margin-bottom: var(--so-spacing-lg);
}
.so-tabs__list {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0;
  list-style: none;
  background: var(--so-cloud);
  border: 1px solid var(--so-ash);
  border-radius: var(--so-radius-md);
  overflow-x: auto;
  scrollbar-width: none;
}
.so-tabs__list::-webkit-scrollbar {
  display: none;
}
.so-tabs__item {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
.so-tabs__link {
  display: block;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--so-charcoal);
  border-radius: var(--so-radius-sm);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.so-tabs__link:hover {
  background: var(--so-ash);
  color: var(--so-near-black);
}
.so-tabs__item--active .so-tabs__link,
.so-tabs__link.is-active {
  background: var(--so-white);
  color: var(--so-primary);
  box-shadow: var(--so-shadow-sm);
  font-weight: 600;
}
.so-tabs--secondary .so-tabs__list {
  background: transparent;
  border: none;
  gap: 0.5rem;
  padding: 0;
}
.so-tabs--secondary .so-tabs__link {
  border-bottom: 2px solid transparent;
  border-radius: 0;
  min-width: 44px;
  padding: 0.5rem 0.25rem;
  text-align: center;
}
.so-tabs--secondary .so-tabs__item--active .so-tabs__link {
  border-bottom-color: var(--so-primary);
  background: transparent;
  box-shadow: none;
}

/* ---- HEADER ---- */
/* ---- Top Bar ---- */
.so-topbar {
  background: #087F72;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.375rem 0;
}

.so-topbar__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.so-topbar__hotline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.so-topbar__hotline:hover {
  color: #fefce8;
}

.so-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.so-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
}

.so-topbar__link:hover {
  color: #fff;
}

.so-topbar__sep {
  color: rgba(255, 255, 255, 0.3);
}

.so-topbar__text {
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 640px) {
  .so-topbar__right { display: none; }
  .so-topbar__inner { justify-content: center; }
}

/* ---- Header Hotline ---- */
.so-header__hotline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  color: #10A899;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
  border: 1px solid rgba(16,168,153, 0.3);
  border-radius: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}

.so-header__hotline:hover {
  background: rgba(16,168,153, 0.1);
  border-color: #10A899;
  color: #10A899;
}

.so-header__hotline svg {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .so-header__hotline-text { display: none; }
  .so-header__hotline { border: none; padding: 0.375rem; }
}

/* ---- Search Popup ---- */
.so-search-popup {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.so-search-popup.is-open {
  display: flex;
}

.so-search-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22,43,58, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.so-search-popup__content {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 1.5rem;
  background: var(--lbayk-theme-surface, #fff);
  border-radius: 20px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 2rem;
  animation: soSearchPopupIn 0.25s ease;
}

@keyframes soSearchPopupIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.so-search-popup__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.so-search-popup__input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--lbayk-dk-line, #e5e7eb);
  border-radius: 14px;
  background: var(--lbayk-dk-raised, #f9fafb);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.so-search-popup__input-wrap:focus-within {
  border-color: #087F72;
  background: var(--lbayk-theme-surface, #fff);
  box-shadow: 0 0 0 4px rgba(8,127,114, 0.08);
}

.so-search-popup__input-wrap > svg {
  flex-shrink: 0;
}

.so-search-popup__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.125rem;
  color: var(--lbayk-theme-ink, #1f2937);
  outline: none;
  font-family: inherit;
}

.so-search-popup__input::placeholder {
  color: #9ca3af;
}

.so-search-popup__close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--lbayk-dk-raised, #f3f4f6);
  border: none;
  color: var(--lbayk-theme-muted, #6b7280);
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.so-search-popup__close-btn:hover {
  color: var(--lbayk-theme-ink, #1f2937);
  background: var(--lbayk-dk-sunken, #e5e7eb);
}

/* Keyboard shortcut hint */
.so-search-popup__hint {
  text-align: center;
  font-size: 0.6875rem;
  color: #9ca3af;
}

.so-search-popup__hint kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: var(--lbayk-dk-raised, #f3f4f6);
  border: 1px solid var(--lbayk-dk-line, #d1d5db);
  border-radius: 4px;
  font-size: 0.625rem;
  font-family: inherit;
  color: var(--lbayk-theme-muted, #6b7280);
}

/* Quick links */
.so-search-popup__quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.so-search-popup__label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.so-search-popup__tag {
  display: inline-flex;
  padding: 0.4375rem 1rem;
  background: var(--lbayk-dk-raised, #f3f4f6);
  color: var(--lbayk-dk-ink, #374151);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 24px;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.12s;
}

.so-search-popup__tag:hover {
  background: var(--lbayk-dk-tint-green, #f0fdf4);
  border-color: #087F72;
  color: var(--lbayk-dk-text-teal, #087F72);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .so-search-popup {
    align-items: flex-start;
    padding-top: 3rem;
  }
  .so-search-popup__content {
    margin: 0 0.75rem;
    padding: 1.5rem;
    border-radius: 16px;
  }
  .so-search-popup__input {
    font-size: 1rem;
  }
}

/* ---- Floating Action Buttons ---- */
.so-floating-actions {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

[dir="rtl"] .so-floating-actions {
  right: auto;
  left: 1.5rem;
}

.so-floating-actions__btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.so-floating-actions__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.so-floating-actions__btn--top {
  background: #162b3a;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.so-floating-actions__btn--top.so-back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .so-floating-actions {
    bottom: 1rem;
    right: 1rem;
  }
  [dir="rtl"] .so-floating-actions {
    left: 1rem;
  }
  .so-floating-actions__btn {
    width: 46px;
    height: 46px;
  }
}

.so-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--so-header-bg, #162B3A);
  border-bottom: 1px solid rgba(255,114,94, 0.12);
  /* No backdrop-filter: the header background is fully opaque (#162B3A) with no
     translucent/scrolled state, so blurring behind it is invisible — it was pure
     GPU paint cost on a sticky element repainted every scroll frame. */
}
/* Islamic geometric pattern on header */
.so-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23FF725E' stroke-width='0.5'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z'/%3E%3Cpath d='M20 0L40 20L20 40L0 20Z'/%3E%3Cpath d='M60 0L80 20L60 40L40 20Z'/%3E%3Cpath d='M20 40L40 60L20 80L0 60Z'/%3E%3Cpath d='M60 40L80 60L60 80L40 60Z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3Cpath d='M40 28L52 40L40 52L28 40Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}
.so-header--static {
  position: relative;
}
.so-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
}

/* Branding: remove empty wrapper divs from region output */
.so-header__inner > .so-branding {
  flex-shrink: 0;
}
.so-header__inner > .so-branding > div {
  display: contents;
}

/* Header action icons */
.so-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.so-header__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.15s;
  background: none;
  border: none;
  cursor: pointer;
}

.so-header__icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Search button — styled differently from other icon buttons */
#search-popup-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  width: auto;
  height: auto;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-family: inherit;
}

#search-popup-trigger::after {
  content: 'Search...';
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
}

#search-popup-trigger:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

#search-popup-trigger:hover::after {
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  #search-popup-trigger::after {
    display: none;
  }
  #search-popup-trigger {
    padding: 0.375rem;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
  }
}

/* Cart badge */
.so-header__cart {
  position: relative;
  flex: 0 0 2.25rem;
}

.so-cart-badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -4px;
  right: auto;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #10A899;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  border-radius: 10px;
  padding: 0 4px;
  line-height: 1;
}

/* Mobile toggle */
.so-header__mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
}

.so-header__mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Mobile panel */
.so-header__mobile-panel {
  padding: 1rem 1.5rem 1.5rem;
  background: #162B3A;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Force vertical stacking for ALL menu classes in mobile panel */
.so-header__mobile-panel .menu,
.so-header__mobile-panel .so-menu,
.so-header__mobile-panel ul {
  display: flex !important;
  flex-direction: column !important;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.so-header__mobile-panel .menu li,
.so-header__mobile-panel .so-menu li,
.so-header__mobile-panel .so-menu__item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.so-header__mobile-panel .menu a,
.so-header__mobile-panel .so-menu__link {
  display: block;
  padding: 0.75rem 0;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
  white-space: normal;
}

.so-header__mobile-panel .menu a:hover,
.so-header__mobile-panel .menu a.is-active,
.so-header__mobile-panel .so-menu__link:hover,
.so-header__mobile-panel .so-menu__link.is-active {
  color: #10A899;
}

/* Parent items with children: show toggle chevron */
.so-header__mobile-panel .so-menu__item--expanded > a,
.so-header__mobile-panel .menu-item--expanded > a,
.so-header__mobile-panel li.so-menu__item--expanded > .so-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.so-header__mobile-panel .so-menu__item--expanded > a::after,
.so-header__mobile-panel .menu-item--expanded > a::after {
  content: '';
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

[dir="rtl"] .so-header__mobile-panel .so-menu__item--expanded > a::after,
[dir="rtl"] .so-header__mobile-panel .menu-item--expanded > a::after {
  margin-left: 0;
}

.so-header__mobile-panel .so-menu__item--expanded.is-open > a::after,
.so-header__mobile-panel .menu-item--expanded.is-open > a::after {
  transform: rotate(180deg);
}

/* Submenus: hidden by default in mobile, shown when parent toggled */
.so-header__mobile-panel .so-menu--sub,
.so-header__mobile-panel .so-menu__item--expanded > ul,
.so-header__mobile-panel .menu-item--expanded > ul {
  display: none !important;
  padding-inline-start: 1rem;
  border: none;
  background: transparent;
  box-shadow: none;
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  min-width: 0;
}

.so-header__mobile-panel .so-menu__item--expanded.is-open > .so-menu--sub,
.so-header__mobile-panel .so-menu__item--expanded.is-open > ul,
.so-header__mobile-panel .menu-item--expanded.is-open > ul,
.so-header__mobile-panel .menu-item--expanded.is-open > .menu {
  display: flex !important;
  flex-direction: column !important;
}

/* Submenu items styling */
.so-header__mobile-panel .so-menu--sub a,
.so-header__mobile-panel .so-menu--sub .so-menu__link {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8125rem;
  padding: 0.5rem 0;
}

.so-header__mobile-panel .so-menu--sub a:hover,
.so-header__mobile-panel .so-menu--sub .so-menu__link:hover {
  color: #10A899;
  background: transparent;
}

.so-header__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Nav fills center */
.so-header__inner > .so-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.so-header__inner > .so-nav > div {
  display: contents;
}

/* ---- Mobile Responsive: hide nav, show toggle ---- */
@media (max-width: 1024px) {
  .so-header__inner > .so-nav {
    display: none;
  }
  .so-header__mobile-toggle {
    display: flex;
  }
  .so-account__name {
    display: none;
  }
  .so-account__chevron {
    display: none;
  }
}

@media (max-width: 640px) {
  .so-header__inner {
    padding: 0 0.75rem;
    gap: 0.375rem;
    height: 3.5rem;
  }
  .so-header__icon-btn {
    width: 2rem;
    height: 2rem;
  }
  .so-header__icon-btn svg {
    width: 18px;
    height: 18px;
  }
  .so-header__mobile-toggle {
    width: 2rem;
    height: 2rem;
  }
  .so-floating-actions {
    bottom: 1rem;
    right: 0.75rem;
  }
  [dir="rtl"] .so-floating-actions {
    right: auto;
    left: 0.75rem;
  }
  .so-floating-actions__btn {
    width: 44px;
    height: 44px;
  }
  .so-topbar__inner {
    padding: 0 0.75rem;
    font-size: 0.6875rem;
  }
}

/* ---- BRANDING ---- */
.so-branding {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}
.so-branding__logo {
  height: 2rem;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.so-branding__emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.so-branding__emblem svg {
  display: block;
}
.so-branding__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.so-branding__name {
  font-size: 1.375rem;
  font-weight: 800;
  font-family: var(--so-font-heading);
  letter-spacing: -0.02em;
}
.so-branding__name a {
  color: inherit;
  text-decoration: none;
}
.so-branding__hola {
  color: #fff;
}
.so-branding__arabic { font-family: "IBM Plex Sans Arabic", Tajawal, sans-serif; letter-spacing: 0; }
.lb-wordmark-ar { font-family: "IBM Plex Sans Arabic", Tajawal, sans-serif; font-weight: 900; letter-spacing: 0; }
.lb-wordmark-diacritic { color: #FF725E; }
.so-branding__arabic .lb-wordmark-diacritic { color: #FF725E; }
.so-branding__latin { color: #8FE0CE; font-size: .78em; font-weight: 700; margin-inline-start: .35rem; }
.so-branding__all {
  color: var(--so-secondary, #FF725E);
}
.so-branding__slogan {
  font-size: 0.5625rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
  margin-top: 0.125rem;
  white-space: nowrap;
}

/* ---- SEARCH FORM IN HEADER ---- */
.so-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
/* Remove empty region wrapper divs */
.so-actions > div {
  display: contents;
}
.so-actions form {
  display: flex;
  align-items: center;
}
.so-actions .search-block-form {
  display: flex;
  align-items: center;
}
.so-actions .search-block-form .form-item {
  margin: 0;
}
.so-actions .search-block-form .form-search {
  width: 10rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid var(--so-royal-navy);
  border-radius: var(--so-radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: width 0.3s, border-color 0.2s;
}
.so-actions .search-block-form .form-search::placeholder {
  color: var(--so-stone);
}
.so-actions .search-block-form .form-search:focus {
  width: 14rem;
  border-color: var(--so-primary);
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(8,127,114, 0.15);
}
.so-actions .search-block-form .form-actions {
  display: none; /* Hide submit button, search on enter */
}
.so-actions .search-block-form label {
  display: none;
}

/* ---- MAIN CONTENT ---- */
main {
  min-height: calc(100vh - 4rem);
}
.region-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--so-spacing-xl) var(--so-spacing-lg);
}
/* Landing page: full-width sections, no padding on region */
.page-node-type-landing_page .region-content {
  max-width: none;
  padding: 0;
}
.page-node-type-landing_page .node {
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
/* Hide ALL title elements on landing pages — hero handles the heading */
.page-node-type-landing_page .node__title,
.page-node-type-landing_page .block-page-title-block,
.page-node-type-landing_page h1,
.page-node-type-landing_page article > div > span:first-child {
  display: none;
}
/* But allow h1 inside paragraph sections */
.page-node-type-landing_page .so-hero-banner h1,
.page-node-type-landing_page [class*="so-"] h1 {
  display: block;
}

/* ---- BREADCRUMB ---- */
.region-breadcrumb {
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--so-spacing-md) var(--so-spacing-lg) 0;
}
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--so-stone);
}
.breadcrumb a { color: var(--so-stone); }
.breadcrumb a:hover { color: var(--so-primary); }

/* ---- MESSAGES ---- */
.messages {
  max-width: 80rem;
  margin: var(--so-spacing-md) auto;
  padding: var(--so-spacing-md) var(--so-spacing-lg);
  border-radius: var(--so-radius-md);
  font-size: 0.875rem;
}
.messages--status {
  background: var(--so-pale-green);
  border: 1px solid var(--so-primary);
  color: var(--so-primary-dark);
}
.messages--warning {
  background: var(--so-sand-light);
  border: 1px solid var(--so-secondary);
  color: var(--so-secondary-dark);
}
.messages--error {
  background: var(--lbayk-dk-tint-red, #fef2f2);
  border: 1px solid #dc2626;
  color: var(--lbayk-dk-text-red, #991b1b);
}

/* ---- BUTTONS ---- */
.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--so-font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--so-primary);
  border: none;
  border-radius: var(--so-radius-md);
  cursor: pointer;
  /* 44px minimum touch target (spec: shared UI layer). */
  min-height: 44px;
  transition: background-color 0.2s, transform 0.1s;
}
.button:hover, .btn:hover {
  background: var(--so-primary-dark);
  color: #fff;
}
.button:active, .btn:active { transform: scale(0.98); }

/* Secondary button: Desert Gold */
.button--secondary {
  background: var(--so-secondary);
  color: var(--so-deep-navy);
}
.button--secondary:hover {
  /* White on the darker coral was 4.27:1; the navy label on a lighter coral is 6.6:1. */
  background: #ff8f7e;
  color: var(--so-deep-navy);
}

.button--outline {
  background: transparent;
  color: var(--so-primary);
  border: 1px solid var(--so-primary);
}
.button--outline:hover {
  background: var(--so-pale-green);
}

/* Gold outline button */
.button--outline-gold {
  background: transparent;
  color: var(--so-secondary);
  border: 1px solid var(--so-secondary);
}
.button--outline-gold:hover {
  background: var(--so-sand-light);
  color: var(--so-secondary-dark);
}

/* Core button variants that PHP already emits (button--small, button--danger)
   but had no CSS: destructive actions rendered as the default green button. */
.button.button--small, .btn.button--small {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}
.button.button--danger, .btn.button--danger {
  background: var(--lbayk-error);
  color: #fff;
}
.button.button--danger:hover, .btn.button--danger:hover {
  background: #912018;
  color: #fff;
}
.button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--lbayk-focus);
  outline-offset: 2px;
}
.button:disabled, .btn:disabled, .button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---- FORMS ---- */
.form-item {
  margin-bottom: var(--so-spacing-md);
}
.form-item label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--so-charcoal);
}
.form-text, .form-email, .form-tel, .form-select, .form-search, textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--so-body-text);
  background: var(--so-white);
  border: 1px solid var(--so-ash);
  border-radius: var(--so-radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-text:focus, .form-email:focus, .form-tel:focus, .form-select:focus, .form-search:focus, textarea:focus {
  outline: none;
  border-color: var(--so-primary);
  box-shadow: 0 0 0 3px rgba(8,127,114, 0.15);
}
/* The soft halo above is not a strong enough focus indicator on its own. */
.form-text:focus-visible, .form-email:focus-visible, .form-tel:focus-visible, .form-select:focus-visible, .form-search:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--lbayk-focus);
  outline-offset: 1px;
}

/* ---- TABLES ---- */
table { width: 100%; border-collapse: collapse; }
th {
  padding: 0.75rem;
  text-align: start;
  /* F22: was #9B9689 12px (2.8:1). Muted ink is >= 5.9:1 on the header fill; 13px floor. */
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lb-ui-text-muted);
  background: var(--so-cloud);
  border-bottom: 2px solid var(--so-ash);
}
/* Letter-spacing breaks Arabic letter joining and uppercase does not exist there. */
[dir="rtl"] th, :lang(ar) th, :lang(arz) th {
  letter-spacing: 0;
  text-transform: none;
}
td {
  padding: 0.75rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--so-cloud);
}

/* ---- NODE/CARDS ---- */
.node {
  padding: var(--so-spacing-xl);
  background: var(--so-white);
  border: 1px solid var(--so-ash);
  border-radius: var(--so-radius-xl);
  box-shadow: var(--so-shadow-sm);
}
.node__title {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--so-font-heading);
  margin-bottom: var(--so-spacing-md);
}

/* ---- FOOTER ---- */
.so-footer {
  position: relative;
  background: var(--so-footer-bg, #162B3A);
  color: var(--so-footer-text, #9B9689);
  margin-top: 0;
}
/* Islamic geometric pattern on footer */
.so-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23FF725E' stroke-width='0.5'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z'/%3E%3Cpath d='M20 0L40 20L20 40L0 20Z'/%3E%3Cpath d='M60 0L80 20L60 40L40 20Z'/%3E%3Cpath d='M20 40L40 60L20 80L0 60Z'/%3E%3Cpath d='M60 40L80 60L60 80L40 60Z'/%3E%3Ccircle cx='40' cy='40' r='12'/%3E%3Ccircle cx='0' cy='0' r='8'/%3E%3Ccircle cx='80' cy='0' r='8'/%3E%3Ccircle cx='0' cy='80' r='8'/%3E%3Ccircle cx='80' cy='80' r='8'/%3E%3Cpath d='M40 28L52 40L40 52L28 40Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}
.so-footer__inner {
  position: relative;
  max-width: 80rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
}
.so-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .so-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 768px) {
  .so-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .so-footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
  }
}
.so-footer__col h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--so-secondary);
  margin: 0 0 1rem;
}
.so-footer__about-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.so-footer__emblem {
  flex-shrink: 0;
}
.so-footer__about-name {
  font-size: 1.375rem;
  font-weight: 800;
  font-family: var(--so-font-heading);
  line-height: 1.2;
  margin: 0;
}
.so-footer__about-slogan {
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin: 0.125rem 0 0;
  letter-spacing: 0.01em;
}
.so-footer__about-desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--so-stone);
  margin: 0;
}
.so-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.so-footer__links a {
  color: var(--so-stone);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.2s;
}
.so-footer__links a:hover {
  color: var(--so-primary-light);
}
.so-footer__social {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.so-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--so-radius-md);
  background: rgba(255,255,255,0.06);
  color: var(--so-stone);
  transition: background 0.2s, color 0.2s;
}
.so-footer__social a:hover {
  background: var(--so-primary);
  color: #fff;
}
.so-footer__social svg {
  width: 1rem;
  height: 1rem;
}

/* App Store badges */
.so-footer__apps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  /* Force LTR so store badges render correctly in RTL pages */
  direction: ltr;
}
.so-footer__app-badge {
  display: inline-block;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  direction: ltr;
}
.so-footer__app-badge:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.so-footer__app-badge svg {
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  direction: ltr;
  unicode-bidi: embed;
}

.so-footer__bottom {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  border-top: 1px solid rgba(255,114,94, 0.12);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--so-stone);
  text-align: center;
}
@media (min-width: 640px) {
  .so-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: start;
  }
}
.so-footer__badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.so-footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: rgba(255,114,94, 0.08);
  border-radius: var(--so-radius-full);
  font-size: 0.6875rem;
  color: var(--so-secondary);
}

/* ---- PAGER ---- */
.pager__items {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: var(--so-spacing-xl);
  list-style: none;
  padding: 0;
}
.pager__item a, .pager__item--active span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--so-radius-md);
  border: 1px solid var(--so-ash);
  transition: all 0.2s;
}
.pager__item a:hover {
  background: var(--so-pale-green);
  border-color: var(--so-primary);
  color: var(--so-primary);
}
.pager__item--active span {
  background: var(--so-primary);
  color: #fff;
  border-color: var(--so-primary);
}

/* ---- BACK-TO-TOP BUTTON ---- */
.so-back-to-top {
  position: fixed;
  bottom: 7rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--so-primary, #087F72);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(8,127,114, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s;
}
.so-back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.so-back-to-top:hover {
  background: var(--so-primary-dark, #05635A);
  box-shadow: 0 6px 20px rgba(8,127,114, 0.45);
}
.so-back-to-top:active {
  transform: scale(0.95);
}
.so-back-to-top svg {
  width: 1.25rem;
  height: 1.25rem;
}
/* RTL: mirror to left side */
[dir="rtl"] .so-back-to-top {
  right: auto;
  left: 1.5rem;
}

/* ---- LIVE CHAT WIDGET (Left Side) ---- */
.so-chat {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
}
[dir="rtl"] .so-chat {
  left: auto;
  right: 1.5rem;
}

/* Trigger Button */
.so-chat__trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  background: var(--so-primary, #087F72);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(8,127,114, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.so-chat__trigger:hover {
  background: var(--so-primary-dark, #05635A);
  box-shadow: 0 6px 24px rgba(8,127,114, 0.5);
  transform: scale(1.05);
}
.so-chat__trigger-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: opacity 0.2s, transform 0.2s;
}
.so-chat__trigger-icon--close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg);
}
.so-chat[data-open="true"] .so-chat__trigger-icon--chat {
  opacity: 0;
  transform: rotate(90deg);
}
.so-chat[data-open="true"] .so-chat__trigger-icon--close {
  opacity: 1;
  transform: rotate(0);
}
.so-chat__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--so-primary, #087F72);
  animation: so-chat-pulse 2.5s ease-out infinite;
}
.so-chat[data-open="true"] .so-chat__pulse {
  animation: none;
  opacity: 0;
}
@keyframes so-chat-pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Chat Panel */
.so-chat__panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 0;
  width: 22rem;
  height: 32rem;
  background: var(--so-white, #fff);
  border: 1px solid var(--so-ash, #E8E6E1);
  border-radius: 1rem;
  box-shadow: 0 16px 48px rgba(22,43,58, 0.2), 0 0 0 1px rgba(22,43,58, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem) scale(0.95);
  transform-origin: bottom left;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}
[dir="rtl"] .so-chat__panel {
  left: auto;
  right: 0;
  transform-origin: bottom right;
}
.so-chat[data-open="true"] .so-chat__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.so-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--so-deep-navy, #162B3A);
  color: #fff;
  flex-shrink: 0;
}
.so-chat__header-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.so-chat__header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--so-primary, #087F72);
  border-radius: 0.5rem;
  font-weight: 800;
  font-size: 0.75rem;
  font-family: var(--so-font-heading);
  flex-shrink: 0;
}
.so-chat__header-title {
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--so-font-heading);
}
.so-chat__header-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.6);
}
.so-chat__status-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.so-chat__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 0.375rem;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 0.2s;
}
.so-chat__close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.so-chat__close svg { width: 1rem; height: 1rem; }

/* Tabs */
.so-chat__tabs {
  display: flex;
  background: var(--so-cloud, #F8F9FA);
  border-bottom: 1px solid var(--so-ash, #E8E6E1);
  flex-shrink: 0;
}
.so-chat__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 0;
  min-height: 2.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--so-stone, #9B9689);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.so-chat__tab:hover {
  color: var(--so-charcoal, #3A3A38);
}
.so-chat__tab--active {
  color: var(--so-primary, #087F72);
  border-bottom-color: var(--so-primary, #087F72);
  font-weight: 600;
}

/* Chat Body */
.so-chat__body {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.so-chat__body--active {
  display: flex;
}

/* Messages */
.so-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.so-chat__msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  max-width: 90%;
}
.so-chat__msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.so-chat__msg--system {
  align-self: center;
  max-width: 100%;
}
.so-chat__msg-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--so-primary, #087F72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  font-family: var(--so-font-heading);
  flex-shrink: 0;
}
.so-chat__msg-bubble {
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  background: var(--so-cloud, #F8F9FA);
  color: var(--so-near-black, #1A1A18);
  border-bottom-left-radius: 0.25rem;
}
.so-chat__msg--user .so-chat__msg-bubble {
  background: var(--so-primary, #087F72);
  color: #fff;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 0.25rem;
}
.so-chat__msg-bubble--system {
  background: var(--so-sand-light, #FFF7ED);
  color: var(--so-charcoal, #3A3A38);
  font-size: 0.75rem;
  text-align: center;
  border-radius: 0.75rem;
  border: 1px solid var(--so-secondary-light, #FFD9D2);
}

/* Quick pick buttons inside chat */
.so-chat__picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.so-chat__pick-btn {
  padding: 0.3125rem 0.75rem;
  min-height: 2.75rem;
  border: 1.5px solid var(--so-ash, #E8E6E1);
  border-radius: 22px;
  background: var(--lbayk-theme-surface, #fff);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--so-charcoal, #3A3A38);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.so-chat__pick-btn:hover {
  border-color: var(--so-primary, #087F72);
  background: var(--so-pale-green, #E6F4F2);
  color: var(--so-primary, #087F72);
}

/* Service results inside chat bubble */
.so-chat__msg-bubble a {
  color: var(--so-primary, #087F72);
  text-decoration: none;
  font-weight: 600;
}

.so-chat__msg-bubble a:hover {
  text-decoration: underline;
}

/* Input Area */
.so-chat__input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--so-ash, #E8E6E1);
  background: var(--so-white, #fff);
  flex-shrink: 0;
}

.so-chat__inline-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.65rem 0.8rem 0.8rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 0.75rem;
  background: rgba(37, 211, 102, 0.08);
  color: var(--lbayk-dk-text-green, #168348);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.so-chat__inline-contact:hover,
.so-chat__inline-contact:focus-visible {
  border-color: rgba(37, 211, 102, 0.55);
  background: rgba(37, 211, 102, 0.15);
  color: var(--lbayk-dk-text-green, #116b3a);
}

.so-chat__inline-contact svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  flex: 0 0 auto;
}
.so-chat__input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--so-ash, #E8E6E1);
  border-radius: var(--so-radius-full, 9999px);
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--so-near-black, #1A1A18);
  background: var(--so-cloud, #F8F9FA);
  outline: none;
  transition: border-color 0.2s;
}
.so-chat__input:focus {
  border-color: var(--so-primary, #087F72);
}
.so-chat__input::placeholder {
  color: var(--so-stone, #9B9689);
}
.so-chat__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--so-primary, #087F72);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.so-chat__send:hover {
  background: var(--so-primary-dark, #05635A);
}
.so-chat__send svg { width: 1rem; height: 1rem; }

/* Human Agent Form */
.so-chat__human-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1rem;
  border-top: 1px solid var(--so-ash, #E8E6E1);
  flex-shrink: 0;
}
.so-chat__human-form .so-chat__input {
  border-radius: 0.5rem;
}
.so-chat__connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem;
  background: var(--so-primary, #087F72);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.so-chat__connect-btn:hover {
  background: var(--so-primary-dark, #05635A);
}

/* WhatsApp Panel Body */
.so-chat__whatsapp-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  gap: 0.75rem;
}
.so-chat__whatsapp-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--lbayk-dk-tint-teal, #E6F4F2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.so-chat__whatsapp-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--so-near-black, #1A1A18);
  margin: 0;
}
.so-chat__whatsapp-desc {
  font-size: 0.8125rem;
  color: var(--so-stone, #9B9689);
  line-height: 1.5;
  margin: 0;
}
.so-chat__whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--so-radius-full, 9999px);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.so-chat__whatsapp-btn:hover {
  background: #1ebe57;
  color: #fff;
  transform: translateY(-1px);
}
.so-chat__whatsapp-number {
  font-size: 0.75rem;
  color: var(--so-stone, #9B9689);
  margin: 0;
  direction: ltr;
}

/* Typing indicator */
.so-chat__typing {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--so-cloud, #F8F9FA);
  border-radius: 1rem;
  width: fit-content;
}
.so-chat__typing-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--so-stone, #9B9689);
  animation: so-chat-typing 1.4s infinite ease-in-out;
}
.so-chat__typing-dot:nth-child(2) { animation-delay: 0.2s; }
.so-chat__typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes so-chat-typing {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .so-chat__pulse, .so-chat__typing-dot { animation: none; }
  .so-chat__panel { transition: none; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .so-header__inner {
    height: 3.5rem;
    padding: 0 1rem;
    gap: 0.5rem;
  }
  .so-header__inner > .so-nav {
    display: none;
  }
  .so-header__mobile-toggle {
    display: flex;
  }
  .so-branding__name {
    font-size: 1.125rem;
  }
  /* Hide search form on mobile, keep language switcher */
  .so-actions form,
  .so-actions .search-block-form {
    display: none !important;
  }
  /* Language switcher: hide name, show only flag + code */
  .so-lang__name {
    display: none;
  }
  .region-content { padding: var(--so-spacing-lg) var(--so-spacing-md); }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }

  /* Floating buttons: adjust for mobile */
  .so-back-to-top {
    bottom: 6rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  [dir="rtl"] .so-back-to-top {
    right: auto;
    left: 1rem;
  }
  /* Chat widget: full width on mobile */
  .so-chat {
    bottom: 1rem;
    left: 1rem;
  }
  [dir="rtl"] .so-chat {
    left: auto;
    right: 1rem;
  }
  .so-chat__trigger {
    width: 3rem;
    height: 3rem;
  }
  .so-chat__panel {
    width: calc(100vw - 2rem);
    height: calc(100dvh - 6rem);
    left: 0;
    max-height: 28rem;
  }
  [dir="rtl"] .so-chat__panel {
    left: auto;
    right: 0;
  }
}

/* ============================================================
   Status Messages — legacy centered modal.
   Messages are no longer a modal: errors/warnings are .lb-ui-alert and success is
   .lb-ui-toast (lbayk-ui.css, templates/misc/status-messages.html.twig). These
   rules only apply to .so-msg--modal, which a template must ask for explicitly.
   ============================================================ */
.so-msg--modal {
  position: fixed;
  inset: 0;
  /* Keep messages above floating accessibility and chat controls so the
   * backdrop remains clickable outside the message card. */
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: soMsgFadeIn 0.25s ease;
}

@keyframes soMsgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.so-msg__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22,43,58, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.so-msg__card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  padding: 1.5rem;
  background: var(--lbayk-theme-surface, #fff);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  animation: soMsgSlideIn 0.3s ease;
}

@keyframes soMsgSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.so-msg__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

/* Status (success) */
.so-msg--status .so-msg__icon {
  background: var(--lbayk-dk-tint-green, #f0fdf4);
  color: var(--lbayk-dk-text-teal, #087F72);
}

.so-msg--status .so-msg__card {
  border-left: 4px solid #087F72;
}

[dir="rtl"] .so-msg--status .so-msg__card {
  border-left: none;
  border-right: 4px solid #087F72;
}

/* Warning */
.so-msg--warning .so-msg__icon {
  background: var(--lbayk-dk-tint-amber, #fefce8);
  color: #ca8a04;
}

.so-msg--warning .so-msg__card {
  border-left: 4px solid #ca8a04;
}

[dir="rtl"] .so-msg--warning .so-msg__card {
  border-left: none;
  border-right: 4px solid #ca8a04;
}

/* Error */
.so-msg--error .so-msg__icon {
  background: var(--lbayk-dk-tint-red, #fef2f2);
  color: var(--lbayk-dk-text-red, #dc2626);
}

.so-msg--error .so-msg__card {
  border-left: 4px solid #dc2626;
}

[dir="rtl"] .so-msg--error .so-msg__card {
  border-left: none;
  border-right: 4px solid #dc2626;
}

.so-msg--modal .so-msg__body {
  flex: 1;
  min-width: 0;
}

.so-msg--modal .so-msg__body p {
  margin: 0 0 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--lbayk-theme-ink, #1f2937);
}

.so-msg--modal .so-msg__body p:last-child {
  margin-bottom: 0;
}

.so-msg--modal .so-msg__body a {
  color: var(--lbayk-dk-text-teal, #087F72);
  font-weight: 600;
}

.so-msg__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--lbayk-dk-raised, #f3f4f6);
  border: none;
  border-radius: 8px;
  color: var(--lbayk-theme-muted, #6b7280);
  cursor: pointer;
  transition: all 0.12s;
}

[dir="rtl"] .so-msg__close {
  right: auto;
  left: 0.75rem;
}

.so-msg__close:hover {
  background: var(--lbayk-dk-sunken, #e5e7eb);
  color: var(--lbayk-theme-ink, #1f2937);
}

/* Auto-dismiss after 5 seconds */
.so-msg--modal.is-dismissing {
  animation: soMsgFadeOut 0.3s ease forwards;
}

@keyframes soMsgFadeOut {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

@media (max-width: 640px) {
  .so-msg__card {
    margin: 0 0.5rem;
    padding: 1.25rem;
  }
}

/* ============================================================
   Mobile Fix — Pixel 6 and similar devices (~412px)
   Prevents horizontal overflow, ensures full header is visible,
   and guarantees the mobile menu toggle works correctly.
   ============================================================ */

/* Prevent horizontal scroll on any element */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Header inner: allow items to shrink on narrow screens */
@media (max-width: 768px) {
  .so-header__inner {
    min-width: 0;
  }

  .so-actions {
    flex: 0 0 auto;
    min-width: 0;
    gap: 0.125rem;
  }

  .so-actions > :is(a, button, .so-account, .so-notification-bell, .so-lang-switcher) {
    flex: 0 0 auto;
  }

  .so-branding {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }

  .so-branding__slogan {
    display: none;
  }
}

@media (max-width: 480px) {
  .so-header__inner {
    padding: 0 0.5rem;
    gap: 0.25rem;
    height: 3.25rem;
  }

  .so-branding__name {
    font-size: 1rem;
  }

  .so-branding__emblem svg {
    width: 28px;
    height: 28px;
  }

  .so-header__icon-btn {
    width: 1.875rem;
    height: 1.875rem;
  }

  .so-header__icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .so-header__mobile-toggle {
    width: 1.875rem;
    height: 1.875rem;
  }

  .so-header__mobile-toggle svg {
    width: 20px;
    height: 20px;
  }

  .so-account__btn {
    padding: 0.25rem;
  }

  .so-account__icon {
    width: 18px;
    height: 18px;
  }

  /* Hide account name and chevron at small sizes */
  .so-account__name,
  .so-account__chevron {
    display: none;
  }

  /* Footer grid: single column on small phones */
  .so-footer__grid {
    grid-template-columns: 1fr;
  }

  /* Footer app badges: stack vertically */
  .so-footer__apps {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Currency widget converter: stack */
  .so-currency-widget__converter-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .so-header__inner {
    padding-inline: 0.375rem;
    gap: 0.125rem;
  }

  .so-actions {
    gap: 0;
  }

  .so-header__cart {
    flex-basis: 1.875rem;
    width: 1.875rem;
    min-width: 1.875rem;
  }

  .so-header__mobile-toggle {
    flex: 0 0 1.875rem;
  }
}

/* Shared floating controls stay in one flow, including the scroll button. */
.so-floating-actions { flex-direction: column; gap: 12px; }
.so-floating-actions > .so-floating-actions__btn { position: static; inset: auto; order: 0; flex: 0 0 auto; }
.so-floating-actions > .so-floating-actions__btn--top { order: 1; visibility: hidden; }
.so-floating-actions > .so-floating-actions__btn--theme { order: 2; }
.so-floating-actions > .so-floating-actions__btn--a11y { order: 3; }
.so-floating-actions > .so-back-to-top--visible { visibility: visible; }
.so-floating-actions > .so-back-to-top {
  /* Keep the item inside the flex stack throughout its fade transition. */
  transform: none;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s;
}
.so-floating-actions > .so-back-to-top:active { transform: scale(0.95); }

/* Reserve space for the dismiss control in both text directions. */
.so-msg--modal .so-msg__card { padding-inline-end: 3.5rem; }
