/* Options and blocks the admin panel's site editor can turn on. Every rule here is scoped to a
   class or variable the renderer (js/site.js) only adds when that option is used, so the default
   site looks exactly like style.css alone. */

/* ---------- «رسالتنا» options ---------- */
.message-section .message-box { border-top-color: var(--msg-accent, var(--yellow)); }
.message-section .section-title::after { background: var(--msg-accent, var(--yellow)); }
.message-section.is-centered .message-box { text-align: center; }
.no-underline .section-title::after { display: none; }
.no-top-border .message-box { border-top: none; }
.message-box p + p { margin-top: 1em; }

.message-section--plain .message-box {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding-inline: 0;
}
.message-section--image .message-box { display: grid; gap: 22px; }
.message-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
@media (min-width: 720px) {
  .message-section--image .message-box { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; }
}

/* ---------- hero ---------- */
.hero--compact { min-height: 0; padding-top: max(48px, env(safe-area-inset-top)); padding-bottom: 56px; }
.hero--compact .scroll-hint { display: none; }
.hero--compact .hero-logo { width: min(220px, 60vw); }

/* ---------- contact links as labelled buttons ---------- */
.social-links--buttons { gap: 12px; }
.social-links--buttons .social-link {
  width: auto;
  height: var(--tap);
  padding: 0 20px 0 18px;
  border-radius: 999px;
  gap: 10px;
  font-weight: 700;
}
.social-links--buttons .social-link svg { width: 22px; height: 22px; }
.social-link.whatsapp:active { background: #25d366; color: #fff; }
.social-link.youtube:active { background: #ff0000; color: #fff; }
.social-link.snapchat:active { background: #fffc00; color: #000; }
.social-link.x:active { background: #000; color: #fff; }
.social-link.phone:active, .social-link.email:active, .social-link.map:active { background: var(--red); color: #fff; }

/* ---------- menu with several pages ---------- */
.menu-gallery--many { display: grid; gap: 18px; justify-items: center; }

/* ---------- branches ---------- */
.branches-grid--list { grid-template-columns: minmax(0, 1fr) !important; max-width: 720px !important; }
@media (min-width: 720px) {
  .branches-grid--list .branch-card { display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: 4px 20px; text-align: start; }
  .branches-grid--list .branch-card h3 { margin: 0; }
  .branches-grid--list .branch-card .branch-status,
  .branches-grid--list .branch-card .branch-status + * { grid-column: 1; }
  .branches-grid--list .contact-list { grid-column: 2; grid-row: 1 / span 3; }
}
.map-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed rgba(229, 64, 42, 0.35);
  font-weight: 700;
  color: var(--red-dark);
}
.map-link svg { width: 20px; height: 20px; }

/* ---------- gallery ---------- */
.gallery { margin-top: 32px; }
.gallery--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery--strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.gallery--strip .gallery-item { flex: 0 0 min(78%, 320px); scroll-snap-align: start; }
.gallery-item { margin: 0; }
.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.gallery-open img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery--strip .gallery-open img { aspect-ratio: 4 / 3; }
.gallery-item figcaption { font-size: 0.92rem; color: var(--muted); text-align: center; margin-top: 6px; }

/* ---------- testimonials (entered by the owner) ---------- */
.testimonials { margin-top: 32px; display: grid; gap: 16px; }
@media (min-width: 720px) { .testimonials--cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.testimonial { margin: 0; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 22px 18px; }
.testimonial p { margin: 0 0 10px; }
.testimonial footer { font-weight: 700; color: var(--red-dark); }
.testimonials--quotes .testimonial { background: none; box-shadow: none; border-inline-start: 4px solid var(--yellow); border-radius: 0; padding: 6px 18px; }
.testimonials--quotes .testimonial p { font-size: 1.12rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 32px auto 0; display: grid; gap: 10px; }
.faq-item { background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0 18px; }
.faq-item summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; color: var(--red); font-size: 1.4rem; margin-inline-end: 12px; width: 1ch; }
.faq-item[open] summary::before { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--ink); }

/* ---------- video ---------- */
.video-frame { max-width: 860px; margin: 32px auto 0; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-frame iframe, .video-poster { width: 100%; height: 100%; border: 0; display: block; }
.video-poster { position: relative; padding: 0; background: #000; cursor: pointer; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ff0000; }
.video-play svg { width: 76px; height: 76px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4)); }
.video-empty { color: #fff; display: flex; align-items: center; justify-content: center; height: 100%; }
.video-caption { text-align: center; color: var(--muted); margin: 12px 0 0; }

/* ---------- seasonal ribbon ---------- */
.season-ribbon {
  background: var(--red-dark);
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px;
  font-size: 0.98rem;
}
.season-ribbon span { color: var(--yellow); }

/* ---------- dark mode ---------- */
body.theme-dark {
  --ink: #f4ebe3;
  --cream: #17120f;
  --cream-2: #1f1915;
  --white: #251e1a;
  --muted: #b9aa9e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 14px 34px rgba(0, 0, 0, 0.5);
}
html:has(body.theme-dark) { background: #17120f !important; }
body.theme-dark .hero {
  background:
    radial-gradient(circle at 30% 20%, rgba(246, 201, 21, 0.1), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(229, 64, 42, 0.12), transparent 55%),
    var(--cream);
}
body.theme-dark .section-title, body.theme-dark .branch-card h3, body.theme-dark .testimonial footer, body.theme-dark .map-link { color: #ff7a62; }
body.theme-dark .hero-cta, body.theme-dark .wa-btn { color: #fff; }
body.theme-dark .site-footer { background: #0e0b09; }
body.theme-dark .phone-link { background: #1d1714; }

/* ---------- whole-site maintenance ---------- */
body.site-maintenance .p1chat-launcher, body.site-maintenance .p1chat-panel { display: none !important; }
.maintenance-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px var(--gutter);
  gap: 6px;
}
.maint-logo { width: min(240px, 64vw); margin-bottom: 14px; }
.maintenance-page h1 { margin: 0; font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--red-dark); }
.maintenance-page p { margin: 0 0 18px; max-width: 520px; color: var(--muted); font-size: 1.08rem; }
.maint-phones { display: grid; gap: 4px; width: min(100%, 320px); }
.maint-branch { color: var(--muted); margin-bottom: 8px; }

/* ---------- preview inside the admin panel ---------- */
.site-preview [data-edit] { outline: 1.5px dashed transparent; outline-offset: 4px; border-radius: 4px; cursor: text; transition: outline-color 0.15s; }
.site-preview [data-edit]:hover { outline-color: rgba(229, 64, 42, 0.45); }
.site-preview [data-edit]:focus { outline: 2px solid var(--red); }
.site-preview .is-editable-image { cursor: pointer; outline: 2px dashed rgba(229, 64, 42, 0.5); outline-offset: -2px; }
.site-preview .fade-section, .site-preview .menu-item, .site-preview .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .site-preview [data-edit] { transition: none; }
}

/* ---------- announcement bar ---------- */
.announce { text-align: center; font-weight: 700; font-size: 0.98rem; line-height: 1.5; }
.announce a, .announce span { display: block; padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px; }
.announce .announce-more { display: inline; padding: 0; margin-inline-start: 6px; }
.announce--brand { background: var(--red); color: #fff; }
.announce--accent { background: var(--yellow); color: #2a221e; }
.announce--dark { background: #2a221e; color: #fff; }
.announce a:hover, .announce a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- popup offer ---------- */
.offer { position: fixed; inset: 0; z-index: 90; background: rgba(20, 15, 12, 0.6); display: grid; place-items: center; padding: 20px; animation: offer-fade 0.25s ease; }
.offer-card { position: relative; width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--white); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-strong); padding: 26px 22px 22px; text-align: center; animation: offer-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.offer-card h2 { margin: 0 0 8px; color: var(--red-dark); font-size: 1.4rem; line-height: 1.4; }
.offer-card p { margin: 0 0 18px; color: var(--muted); }
.offer-img { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; }
.offer-close { position: absolute; top: 8px; left: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cream); color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.offer-cta { width: 100%; }
@keyframes offer-fade { from { opacity: 0; } }
@keyframes offer-in { from { opacity: 0; transform: scale(0.9); } }

/* ---------- branch reached from its QR code ---------- */
.branch-card.is-landing { box-shadow: 0 0 0 3px var(--yellow), var(--shadow-strong); }

@media (prefers-reduced-motion: reduce) {
  .offer, .offer-card { animation: none; }
}
