/* حامل موبايل للسيارة — Landing Page styles
   Vanilla CSS. Mobile-first. System fonts only (no web-font download). */

:root {
    --bg: #ffffff;
    --tint: #f4f6f8;
    --ink: #1c2530;
    --muted: #5b6673;
    --border: #e2e6eb;
    --accent: #1f8a4c;
    --accent-dark: #166b3a;
    --accent-ink: #ffffff;
    --radius: 12px;
    --wrap: 960px;
    --font: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    /* room for the sticky CTA on small screens */
    padding-bottom: 76px;
}

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

a { color: var(--accent-dark); }

.skip-link {
    position: absolute;
    right: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    z-index: 200;
}
.skip-link:focus { right: 8px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 0;
    transition: background .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.btn--lg { width: 100%; padding: 16px 24px; font-size: 1.1rem; }
.btn--sm { padding: 8px 14px; font-size: .85rem; }

/* ---------- header ---------- */
.site-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}
.site-head__name { font-weight: 700; font-size: .95rem; }

/* ---------- layout ---------- */
main { display: block; }
.band {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 40px 16px;
}
.band--tint { max-width: none; background: var(--tint); }
.band--tint > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.band__title { text-align: center; margin-bottom: 1.4em; }

/* ---------- hero ---------- */
.hero {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 24px 16px 8px;
    display: grid;
    gap: 20px;
}
.hero__media img {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: var(--radius);
    background: var(--tint);
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.hero__sub { color: var(--muted); }
.hero__benefits {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 8px;
}
.hero__benefits li { position: relative; padding-inline-start: 26px; }
.hero__benefits li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ---------- price ---------- */
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.price--center { justify-content: center; }
.price__now { font-size: 1.7rem; font-weight: 800; color: var(--accent-dark); }
.price__old { text-decoration: line-through; color: var(--muted); font-size: 1.05rem; }
.price__badge {
    background: #fdecec;
    color: #b3261e;
    font-size: .8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.price__note { font-size: .85rem; color: var(--muted); margin: 0 0 16px; }

/* ---------- split (problem / solution) ---------- */
.split { display: grid; gap: 24px; }

/* ---------- features ---------- */
.features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}
.feature {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.feature__icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.feature h3 { margin-bottom: .25em; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- gallery ---------- */
.gallery {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}
.gallery figure { margin: 0; }
.gallery img {
    border-radius: var(--radius);
    background: var(--tint);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}

/* ---------- video ---------- */
.video video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
    aspect-ratio: 16 / 9;
}

/* ---------- steps ---------- */
.steps { list-style: none; counter-reset: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.step {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 14px;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.step img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; background: var(--tint); }
.step__num {
    display: inline-flex;
    width: 26px; height: 26px;
    align-items: center; justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 6px;
}
.step h3 { margin: 0 0 .2em; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq__item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
}
.faq__item summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    list-style: none;
    position: relative;
    padding-inline-end: 40px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
    content: "+";
    position: absolute;
    inset-inline-end: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--accent-dark);
}
.faq__item[open] summary::after { content: "–"; }
.faq__item summary:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: -3px; }
.faq__body { padding: 0 16px 14px; }
.faq__body p { margin: 0; color: var(--muted); }

/* ---------- final CTA ---------- */
.final-cta { text-align: center; }
.final-cta .btn--lg { max-width: 420px; margin: 0 auto; }

/* ---------- footer ---------- */
.site-foot {
    border-top: 1px solid var(--border);
    padding: 20px 16px;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}
.site-foot p { margin: 0; }

/* ---------- sticky mobile CTA ---------- */
.sticky-cta {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}
.sticky-cta__price { font-weight: 800; color: var(--accent-dark); white-space: nowrap; }
.sticky-cta .btn { flex: 1; }

/* ---------- WhatsApp phone sheet (OpenAI ad traffic only) ----------
   Default state: a normal in-flow section (works with no JS — the CTAs
   above are plain "#oa-wa-form" anchors, this is just where they scroll to).
   .wa-sheet--open (added by JS only) turns it into a fixed bottom overlay.
   The open state positions the panel with plain top/left/right/bottom
   (absolute), NOT flexbox — Safari has a known bug where a flex item that
   also has max-height + overflow:auto can collapse/mis-size, which is what
   was clipping everything below the title on iPhone. */
.wa-sheet {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 28px 16px;
    scroll-margin-top: 16px;
}
.wa-sheet__backdrop {
    display: none; /* only relevant once .wa-sheet--open makes .wa-sheet a fixed box */
}
.wa-sheet__panel {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 18px;
}
.wa-sheet__close {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 8px;
    cursor: pointer;
}
.wa-sheet__close:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 1px; }
.wa-sheet__title { margin: 0 0 12px; text-align: center; }
.wa-sheet__error {
    background: #fdecec;
    color: #b3261e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .9rem;
    margin: 0 0 14px;
}
.wa-sheet__form { display: grid; gap: 8px; }
.wa-sheet__label { font-weight: 700; font-size: .9rem; }
.wa-sheet__form input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    /* Explicit 16px, not "font: inherit" — iOS Safari auto-zooms the whole
       page on focus for any input below 16px, which is what was making the
       rest of the sheet look like it "disappeared" after the zoom-follow. */
    font-size: 16px;
    font-family: inherit;
    direction: ltr;
    text-align: right;
}
.wa-sheet__form input[type="tel"]:focus-visible {
    outline: 3px solid var(--accent-dark);
    outline-offset: 1px;
}
.wa-sheet__hint { margin: 0; font-size: .8rem; color: var(--muted); }
.wa-sheet__submit { width: 100%; margin-top: 6px; }

/* JS enhancement only — bottom-sheet overlay mode. No flexbox here on
   purpose (see note above) — .wa-sheet is just the fixed positioning
   context; .wa-sheet__backdrop and .wa-sheet__panel are each independently
   absolutely positioned inside it. */
.wa-sheet--open {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: none;
    margin: 0;
    padding: 0;
}
.wa-sheet--open .wa-sheet__backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 28, .5);
}
.wa-sheet--open .wa-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 16px 16px 0 0;
    animation: wa-sheet-up .18s ease-out;

    /* The actual fix: a real, generous cap instead of letting the box size
       against a flex/viewport computation, with scroll past that cap —
       the title, error, input, hint and button must never be clipped with
       no way to reach them.
       vh first as a fallback for browsers without dvh support; dvh (when
       supported) overrides it with the correct, toolbar-aware value. */
    height: auto;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    /* Keep the submit button clear of the iPhone home-indicator area. */
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}
@keyframes wa-sheet-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
body.wa-sheet-open-body { overflow: hidden; }

@media (min-width: 720px) {
    .wa-sheet--open .wa-sheet__panel {
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: auto;
        width: 100%;
        max-width: 420px;
        height: fit-content;
        max-height: 85vh;
        max-height: 85dvh;
        border-radius: 16px;
    }
}

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
    h1 { font-size: 2rem; }
    .hero {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        padding-top: 40px;
    }
    .hero__media { order: 2; }
    .split { grid-template-columns: 1fr 1fr; }
    .features { grid-template-columns: repeat(3, 1fr); }
    .btn--lg { width: auto; min-width: 280px; }
    .hero__benefits { margin-top: 22px; }
    /* enough vertical room; sticky CTA hidden on desktop */
    body { padding-bottom: 0; }
    .sticky-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
