.language-gate {
  --gate-ink: #16150f;
  --gate-gold: #b58a43;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: clamp(24px, 6vw, 72px) 20px;
  color: var(--gate-ink);
  background:
    radial-gradient(circle at 51% 42%, #fff 0, #fcf8f1 39%, #f3ede3 100%);
  isolation: isolate;
  transition: opacity .5s ease, visibility .5s ease;
}

.language-gate.is-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.language-gate-content {
  position: relative;
  z-index: 4;
  width: min(680px, 100%);
  text-align: center;
}

.language-brand {
  margin: 0 0 clamp(42px, 9vh, 88px);
  color: #171611;
  font: 400 clamp(3.2rem, 9vw, 7.2rem)/.86 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
}

.language-panel {
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid #cdbb99;
  border-radius: 30px;
  background: #fffcf7e8;
  box-shadow: 0 25px 70px #6249271f, inset 0 0 0 5px #fff8;
  backdrop-filter: blur(12px);
}

.language-panel h1 {
  margin: 0;
  font: 650 clamp(1.6rem, 4vw, 2.45rem)/1.2 Arial, sans-serif;
  letter-spacing: -.035em;
}

.language-panel > p {
  margin: 9px 0 30px;
  font: 700 clamp(1.45rem, 4vw, 2.2rem)/1.3 Tahoma, Arial, sans-serif;
}

.language-options {
  display: grid;
  gap: 16px;
}

.language-options button {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  width: 100%;
  min-height: 96px;
  padding: 14px 20px;
  border: 1.5px solid var(--gate-gold);
  border-radius: 18px;
  color: var(--gate-ink);
  background: #fffaf3c7;
  cursor: pointer;
  transition: transform .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}

.language-options button::after {
  content: "→";
  justify-self: end;
  font: 400 22px/1 Arial, sans-serif;
  opacity: .55;
}

.language-options button[dir="rtl"]::after {
  content: "←";
  justify-self: start;
}

.language-options button:hover,
.language-options button:focus-visible {
  color: #fff;
  background: #1b1a13;
  box-shadow: 0 14px 35px #1b1a1324;
  outline: none;
  transform: translateY(-2px);
}

.language-options button span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  justify-self: start;
  border: 1px solid currentColor;
  border-radius: 13px;
  color: var(--gate-gold);
  font: 700 19px/1 Arial, sans-serif;
}

.language-options button strong {
  justify-self: center;
  font: 650 clamp(1.25rem, 3.5vw, 1.75rem)/1.25 Arial, sans-serif;
}

.language-options button[lang="ar-MA"] strong {
  font-family: Tahoma, Arial, sans-serif;
}

.language-orbit {
  position: absolute;
  z-index: 0;
  width: min(90vw, 920px);
  aspect-ratio: 1;
  border: 1px solid #bd955242;
  border-radius: 50%;
  pointer-events: none;
}

.language-orbit::before,
.language-orbit::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #bc8d3d;
  box-shadow: 0 0 15px #bc8d3d38;
}

.language-orbit::before { top: 16%; right: 12%; }
.language-orbit::after { bottom: 13%; left: 18%; }
.language-orbit-one { transform: rotate(-8deg) scaleY(.78); }
.language-orbit-two { width: min(78vw, 800px); transform: rotate(31deg) scaleY(.68); opacity: .6; }

.language-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: #b98533;
  pointer-events: none;
}

.language-stars i {
  position: absolute;
  font-style: normal;
  filter: drop-shadow(0 0 8px #c99b4f42);
  animation: languageTwinkle 2.8s ease-in-out infinite;
}

.language-stars i:nth-child(1) { top: 5%; left: 19%; font-size: 23px; }
.language-stars i:nth-child(2) { top: 8%; right: 14%; font-size: 27px; animation-delay: .8s; }
.language-stars i:nth-child(3) { top: 31%; left: 9%; font-size: 17px; animation-delay: 1.3s; }
.language-stars i:nth-child(4) { top: 25%; right: 8%; font-size: 24px; animation-delay: .4s; }
.language-stars i:nth-child(5) { top: 62%; left: 7%; font-size: 19px; }
.language-stars i:nth-child(6) { bottom: 8%; left: 48%; font-size: 26px; animation-delay: 1.6s; }
.language-stars i:nth-child(7) { bottom: 14%; right: 17%; font-size: 15px; }

.language-hat {
  position: absolute;
  z-index: 2;
  width: clamp(220px, 31vw, 500px);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 28px 26px #2b1d152d);
}

.language-hat-camel {
  top: -7%;
  left: -10%;
  transform: rotate(12deg);
  animation: languageHatFloatTop 6s ease-in-out infinite;
}

.language-hat-white {
  right: -9%;
  bottom: -8%;
  transform: rotate(-8deg);
  animation: languageHatFloatBottom 6.8s ease-in-out infinite;
}

.language-switcher {
  position: fixed;
  z-index: 490;
  right: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #ffffff4a;
  border-radius: 999px;
  color: #fff;
  background: #15150fd9;
  box-shadow: 0 9px 28px #0004;
  backdrop-filter: blur(12px);
  cursor: pointer;
  font: 800 10px/1 Arial, sans-serif;
  letter-spacing: .08em;
}

.language-switcher::before { content: "◎"; font-size: 16px; }

/* Darija keeps the original LTR component layout; only Arabic copy flows RTL. */
body.language-darija { direction: ltr; }
body.language-darija .immersive-page,
body.language-darija .review-modal,
body.language-darija .site-legal-links,
body.language-darija > main { font-family: Tahoma, Arial, sans-serif; }
body.language-darija :where(h1, h2, h3, h4, h5, p, blockquote, legend, summary),
body.language-darija .showcase-meta > *,
body.language-darija .order-color-head,
body.language-darija .color-picker-trigger > span,
body.language-darija .color-option-copy,
body.language-darija .campaign-form label,
body.language-darija .form-offer-card,
body.language-darija .order-summary-item,
body.language-darija .offer-summary > small,
body.language-darija .review-card footer > span,
body.language-darija .review-card footer > small,
body.language-darija .privacy-consent > span,
body.language-darija .cookie-consent,
body.language-darija > main,
body.language-darija > footer {
  direction: rtl;
  unicode-bidi: plaintext;
}
body.language-darija .immersive-page h1,
body.language-darija .immersive-page h2,
body.language-darija .immersive-page h3,
body.language-darija .review-dialog h3,
body.language-darija .review-card blockquote,
body.language-darija .campaign-form-head h3,
body.language-darija .form-offer-card h5 { font-family: Tahoma, Arial, sans-serif !important; }
body.language-darija .campaign-form,
body.language-darija .order-color-grid,
body.language-darija .form-offer-track,
body.language-darija .order-summary-grid,
body.language-darija .reviews-track,
body.language-darija .privacy-consent { direction: ltr; }
body.language-darija .site-legal-links { direction: ltr; text-align: center; }
body.language-darija .campaign-form label,
body.language-darija .form-offer-card,
body.language-darija .order-live-summary,
body.language-darija .review-card,
body.language-darija .review-dialog { text-align: right; }
body.language-darija .privacy-consent > span { flex: 1; text-align: right; }
body.language-darija input:not([type="tel"]),
body.language-darija textarea,
body.language-darija select { direction: rtl; text-align: right; }
body.language-darija input[type="tel"],
body.language-darija .showcase-price,
body.language-darija .product-price-line,
body.language-darija .builder-price,
body.language-darija .form-offer-card > strong,
body.language-darija [data-summary="total"] { direction: ltr; unicode-bidi: isolate; }
body.language-darija .review-person {
  display: flex !important;
  direction: ltr;
  align-items: baseline;
  gap: .45em;
  unicode-bidi: isolate;
}
body.language-darija .review-person bdi { min-width: 0; unicode-bidi: isolate; }
body.language-darija .review-person i { font-style: normal; }
body.language-darija .review-card { overflow: hidden; }
body.language-darija .review-card blockquote,
body.language-darija .review-card footer { overflow-wrap: anywhere; }
body.language-darija .language-switcher { right: 14px; left: auto; }
body.language-darija .delivery,
body.language-darija .highlight { border-right: 0; border-left: 4px solid var(--gold); }

@keyframes languageTwinkle { 0%, 100% { opacity: .38; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes languageHatFloatTop { 0%, 100% { translate: 0 0; } 50% { translate: 0 13px; } }
@keyframes languageHatFloatBottom { 0%, 100% { translate: 0 0; } 50% { translate: 0 -13px; } }

@media (max-width: 720px) {
  .language-gate { align-items: center; padding: 40px 18px; }
  .language-gate-content { width: min(520px, 100%); }
  .language-brand { margin-bottom: 42px; font-size: clamp(3.1rem, 17vw, 5.7rem); }
  .language-panel { padding: 25px 18px; border-radius: 25px; }
  .language-panel > p { margin-bottom: 24px; }
  .language-options button { grid-template-columns: 60px 1fr 34px; min-height: 86px; padding: 12px 15px; }
  .language-options button span { width: 50px; height: 50px; }
  .language-hat { width: clamp(190px, 55vw, 320px); }
  .language-hat-camel { top: -3%; left: -21%; }
  .language-hat-white { right: -21%; bottom: -3%; }
  .language-orbit { width: 125vw; }
  .language-orbit-two { width: 105vw; }
}

@media (max-height: 720px) {
  .language-brand { margin-bottom: 24px; font-size: clamp(2.8rem, 9vw, 5rem); }
  .language-panel { padding-top: 22px; padding-bottom: 22px; }
  .language-options button { min-height: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .language-hat,
  .language-stars i { animation: none; }
  .language-gate,
  .language-options button { transition: none; }
}
