/* Lead-generation components created by assets/js/main.js.
   Loaded after arabic.css so these rules win; selectors stay low-specificity where page CSS may refine them. */

/* ---------- hidden things stay hidden even when a component sets display ---------- */
.lead-nudge[hidden],
.lead-nudge__btn[hidden],
.lead-result[hidden],
.lightbox__cta[hidden],
.lightbox__actions[hidden],
[data-proof][hidden] {
  display: none !important;
}

/* ---------- non-blocking nudge (phones and search visitors): no backdrop, no scroll lock ---------- */
.lead-nudge {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 96;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(178, 138, 72, 0.45);
  background: var(--bone, #f5f0e7);
  color: var(--ink, #171410);
  box-shadow: 0 18px 40px rgba(10, 8, 6, 0.22);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lead-nudge.is-visible {
  opacity: 1;
  transform: none;
}

.lead-nudge__text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.lead-nudge__btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 12px 16px;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
}

.lead-nudge__close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-inline-end: -8px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
}

.lead-nudge__close:hover,
.lead-nudge__close:focus-visible {
  opacity: 1;
}

@media (max-width: 1080px) {
  /* above the fixed bottom bar; main.js lifts it further if anything else is in the way */
  .lead-nudge {
    bottom: calc(58px + 12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 520px) {
  .lead-nudge {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 14px 14px 12px;
  }

  .lead-nudge__text {
    flex-basis: calc(100% - 52px);
  }

  .lead-nudge__btn {
    order: 3;
    flex: 1 1 100%;
  }

  .lead-nudge__close {
    order: 2;
    margin-inline-end: -10px;
    margin-top: -10px;
  }
}

@media (min-width: 1081px) {
  .lead-nudge {
    inset-inline-start: 24px;
    inset-inline-end: auto;
    width: min(520px, calc(100vw - 120px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-nudge {
    transition: none;
  }
}

/* ---------- floating "Call me back" button ---------- */
.lead-fab {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  transition: transform 0.3s ease, background 0.3s ease, opacity 0.25s ease;
}

html[lang="ar"] .lead-fab {
  font-size: 13px;
  letter-spacing: 0;
}

.lead-fab.is-away {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* the bottom bar already carries the callback button, but only up to 900px (components.css shows it there);
   between 901px and 1080px the button stays so that tablets in landscape keep a way to ask for a call */
@media (max-width: 900px) {
  .lead-fab {
    display: none;
  }
}

/* nothing floats over the keyboard while someone types */
body.is-typing .mobile-actions,
body.is-typing .lead-fab,
body.is-typing .lead-nudge {
  display: none;
}

/* ---------- callback popup refinements ---------- */
.lead-popup__close {
  width: 44px;
  height: 44px;
}

html[dir="rtl"] .lead-popup__close {
  right: auto;
  left: 10px;
}

.lead-popup h2:focus {
  outline: none;
}

/* after sending, only the confirmation stays on screen */
.lead-popup__panel.is-success .lead-popup__kicker,
.lead-popup__panel.is-success #lead-popup-title,
.lead-popup__panel.is-success .lead-popup__intro,
.lead-popup__panel.is-success .lead-popup__trust,
.lead-popup__panel.is-success .lead-popup__proof,
.lead-popup__panel.is-success .lead-popup__quick,
.lead-popup__panel.is-success .lead-popup__or {
  display: none;
}

.lead-popup input[type="tel"],
.enquiry-form input[type="tel"] {
  font-variant-numeric: lining-nums;
}

html[dir="rtl"] input[type="tel"] {
  text-align: right;
}

.lead-popup__helper:empty {
  display: none;
}

.lead-popup__proof {
  margin: 0 0 12px;
  color: #6b6052;
  font-size: 12px;
}

.lead-popup__proof a {
  color: inherit;
}

.lead-popup__status.is-error {
  color: #9b4238;
}

.lead-success__ref {
  margin: 0 auto 6px;
  color: var(--gold-3, #8c6a3b);
  font-size: 13px;
  font-weight: 700;
}

.lead-success__save,
.lead-result__save {
  display: inline-block;
  margin-top: 14px;
  color: var(--gold-3, #8c6a3b);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #9b4238 !important;
  box-shadow: 0 0 0 1px #9b4238;
}

button[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.form-status.is-error,
.lead-popup__status.is-error {
  font-size: 12px;
}

@media (max-width: 560px) {
  html[dir="rtl"] .lead-popup__close {
    left: 6px;
  }
}

/* short phones: keep the number field and button above the keyboard */
@media (max-width: 560px) and (max-height: 700px) {
  .lead-popup__brand,
  .lead-popup__trust,
  .lead-popup__or {
    display: none;
  }

  .lead-popup__panel {
    padding-top: 22px;
  }
}

@supports (height: 100dvh) {
  @media (max-width: 560px) {
    .lead-popup__panel {
      max-height: 92dvh;
    }
  }
}

/* ---------- result panel that replaces an enquiry form after sending ---------- */
.lead-result {
  padding: 28px 22px;
  border: 1px solid rgba(178, 138, 72, 0.45);
  background: var(--paper, #fbf8f2);
  color: var(--ink, #171410);
  text-align: center;
}

.lead-result:focus {
  outline: none;
}

.lead-result__mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border: 1px solid var(--gold, #b18a52);
  border-radius: 50%;
  color: var(--gold-3, #8c6a3b);
  font-size: 24px;
}

.lead-result__title {
  margin: 0 0 8px;
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 400;
  line-height: 1.2;
}

.lead-result__ref {
  margin: 0 0 8px;
  color: var(--gold-3, #8c6a3b);
  font-size: 14px;
  font-weight: 700;
}

.lead-result__text {
  max-width: 420px;
  margin: 0 auto 20px;
  color: #6b6052;
  font-size: 14px;
  line-height: 1.7;
}

.lead-result__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.lead-result__actions .btn {
  min-height: 48px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
}

@media (max-width: 520px) {
  .lead-result__actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- lightbox call to action ---------- */
.lightbox__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.lightbox__cta .btn {
  min-height: 46px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
}

@media (max-width: 720px) {
  .lightbox__figure img {
    max-height: 62vh;
  }

  .lightbox__cta .btn {
    flex: 1 1 140px;
  }
}

/* arrows follow the reading direction */
html[dir="rtl"] .lightbox__close {
  right: auto;
  left: 22px;
}

html[dir="rtl"] .lightbox__prev {
  left: auto;
  right: 22px;
}

html[dir="rtl"] .lightbox__next {
  right: auto;
  left: 22px;
}

@media (max-width: 720px) {
  html[dir="rtl"] .lightbox__close {
    left: 12px;
  }

  html[dir="rtl"] .lightbox__prev {
    right: 10px;
  }

  html[dir="rtl"] .lightbox__next {
    left: 10px;
  }
}

/* ---------- header and menu calls to action ---------- */
.mobile-menu__cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.mobile-menu__cta .btn {
  min-height: 50px;
  padding-inline: 12px;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: center;
}

@media (max-width: 1080px) {
  .btn--header {
    display: inline-flex;
    min-height: 38px;
    padding: 10px 14px;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: none;
  }

  .header-actions {
    gap: 12px;
  }

  .header-actions .lang-switch {
    display: none;
  }
}

.lang-switch {
  min-width: 40px;
  height: 40px;
  font-size: 11px;
}

/* ---------- live opening-hours lines ---------- */
[data-open-status],
[data-hours-status] {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

[data-open-status]:empty,
[data-hours-status]:empty {
  display: none;
}

[data-open-status]::before,
[data-hours-status]::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--muted-2, #a29686);
  vertical-align: middle;
}

[data-open-status][data-state="open"]::before,
[data-hours-status][data-state="open"]::before {
  background: #2f8f5b;
}

[data-open-status][data-state="break"]::before,
[data-hours-status][data-state="break"]::before {
  background: var(--gold, #b18a52);
}

/* ---------- forms ---------- */
.enquiry-form .cf-turnstile,
.lead-form .cf-turnstile {
  min-height: 0;
  margin: 8px 0 0;
}

.enquiry-form .cf-turnstile:empty {
  display: none;
}

/* ---------- proof (only visible once real data is supplied) ---------- */
.proof-quote {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line, rgba(23, 20, 16, 0.14));
  background: var(--paper, #fbf8f2);
}

.proof-quote p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
}

.proof-quote footer {
  color: var(--muted, #7d7163);
  font-size: 12px;
}

/* ------------------------------------------------------------------
   Site-pages review: legibility floors
   English micro labels were 7-9px (uppercase, tracked). 10px keeps the
   editorial look and stays readable on phones. Arabic has its own
   11-12px floor at the end of arabic.css.
   ------------------------------------------------------------------ */
html[lang="en"] .trust-strip__grid span,
html[lang="en"] .trust-strip__grid a,
html[lang="en"] .collection-card__content span,
html[lang="en"] .piece-card__num,
html[lang="en"] .piece-card__category,
html[lang="en"] .piece-card__foot span,
html[lang="en"] .intro__meta dt,
html[lang="en"] .service-card__num,
html[lang="en"] .lookbook-strip span,
html[lang="en"] .craft-list span,
html[lang="en"] .material-card span,
html[lang="en"] .palette__item,
html[lang="en"] .visit__map,
html[lang="en"] .piece-tile__index,
html[lang="en"] .category-tile small,
html[lang="en"] .crumbs a,
html[lang="en"] .crumbs span,
html[lang="en"] .trust-row span,
html[lang="en"] .consult-option__label,
html[lang="en"] .page-hero__meta span,
html[lang="en"] .page-hero__meta a,
html[lang="en"] .contact-detail dt,
html[lang="en"] .contact-socials a,
html[lang="en"] .package__label,
html[lang="en"] .package__tag,
html[lang="en"] .package__price > span,
html[lang="en"] .project-gallery figcaption,
html[lang="en"] .production-media__caption span,
html[lang="en"] .production-item__num,
html[lang="en"] .video-feature__meta,
html[lang="en"] .material-tab,
html[lang="en"] .material-swatch__label,
html[lang="en"] .colour__name,
html[lang="en"] .colour__hex,
html[lang="en"] .contract-list span,
html[lang="en"] .chair-card__type,
html[lang="en"] .customise-card__num {
  font-size: 10px;
}

/* Long CTA labels wrap to two lines on phones: line-height 1 made the lines touch. */
main .btn {
  line-height: 1.3;
}

/* Premium calm: one primary action everywhere, no extra chrome. */
.header-phone,
.lead-fab,
.lead-nudge,
.marquee {
  display: none !important;
}
.mobile-actions {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) !important;
}
.mobile-actions .mobile-actions__cb,
html[lang] .mobile-actions > button.mobile-actions__cb {
  display: none !important;
}
