/* ═══════════════════════════════════════════════════════════════════
   WooMax — Universal Responsive Layer
   Covers: ALL phones, tablets, desktops
   Fixes:  hero phones not displaying (data-reveal bug)
   Loaded AFTER style.css — overrides and enhances
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   01. CRITICAL FIX — Hero phones always visible on ALL devices
   Problem: data-reveal sets opacity:0 + transform. On phones and
            small tablets the phones sit below the fold, so
            IntersectionObserver never fires and they stay hidden.
   Solution: force visible via CSS-only one-shot animation, fully
            independent of the JS observer.
   ═══════════════════════════════════════════════════════════════════ */

.hero__phones [data-reveal],
.iphone-wrap[data-reveal],
.iphone-wrap {
    opacity: 1 !important;
    filter: none !important;
    visibility: visible !important;
    transition: none !important;
    will-change: auto !important;
    animation: heroPhoneIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.hero__phones > .iphone-wrap:nth-child(1) { animation-delay: 0.25s; }
.hero__phones > .iphone-wrap:nth-child(2) { animation-delay: 0.40s; }

@keyframes heroPhoneIn {
    from { opacity: 0; transform: translateY(24px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Hero text: same safety treatment — never stays hidden */
.hero__text > [data-reveal] {
    opacity: 1 !important;
    filter: none !important;
    transition: none !important;
    will-change: auto !important;
    animation: heroTextIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.hero__text > .hero__title[data-reveal] { animation-delay: 0.05s; }
.hero__text > .hero__desc[data-reveal]  { animation-delay: 0.15s; }

@keyframes heroTextIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ═══════════════════════════════════════════════════════════════════
   02. GLOBAL FALLBACKS — Old browsers / old Android WebView
   ═══════════════════════════════════════════════════════════════════ */

/* aspect-ratio missing */
@supports not (aspect-ratio: 9 / 19.5) {
    .iphone {
        height: calc(var(--phone-width, 180px) * 19.5 / 9);
    }
    .mockup--card {
        min-height: 240px;
    }
}

/* container-type / cqi missing */
@supports not (container-type: inline-size) {
    .mockup__number-text   { font-size: clamp(14px, 4vw, 22px); letter-spacing: 2px; }
    .mockup__bank-logo     { width: 56px; height: 38px; }
    .mockup__bank-name     { font-size: 12px; }
    .mockup__footer small  { font-size: 9px; }
    .mockup__footer strong { font-size: 12px; }
}

/* dvh / svh missing (very old browsers) */
@supports not (height: 100dvh) {
    .hero { min-block-size: 100vh; }
}

/* Phone-image 404 fallback gradient */
.iphone--no-image .iphone__screen {
    background: linear-gradient(135deg, #FF6B00 0%, #FF8C33 50%, #FFB27A 100%);
}
.iphone--no-image .iphone__screenshot { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   03. MOBILE — max-width: 899px
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 899px) {

    /* Non-hero reveals: keep animations but faster + safer threshold */
    .section [data-reveal] {
        transition-duration: 0.55s !important;
    }

    /* ── Hero ── */
    .hero {
        min-block-size: auto;
        padding-block: clamp(40px, 8dvh, 72px) clamp(36px, 6dvh, 56px);
        padding-inline: clamp(14px, 4vw, 20px);
    }

    .hero__inner      { gap: 26px; }
    .hero__title      { font-size: clamp(22px, 6.5vw, 34px); line-height: 1.3; }
    .hero__desc       { font-size: clamp(13px, 3.6vw, 15px); line-height: 1.8; }
    .hero__phones     { margin-top: 6px; gap: 12px; padding-inline: 6px; }
    .iphone           { --phone-width: clamp(120px, 34vw, 170px); }
    .hero__phones::before { inset: -10% -6% -4%; filter: blur(50px); }

    /* ── Trust marquee ── */
    .trust            { padding-block: 16px; }
    .trust__track     { animation-duration: 26s; }
    .trust__item      { margin-inline-end: 32px; font-size: 12px; gap: 7px; }
    .trust__item i    { font-size: 1.25em; }

    /* ── Sections ── */
    .section          { padding-block: clamp(36px, 8vw, 64px); }
    .section__title   { font-size: clamp(19px, 5.4vw, 26px); line-height: 1.35; }
    .section__desc    { font-size: clamp(13px, 3.5vw, 15px); line-height: 1.8; }

    /* ── Features ── */
    .features         { gap: 12px; }
    .feature          { padding: 18px 16px; border-top-width: 3px; }
    .feature__icon    { inline-size: 44px; font-size: 19px; margin-block-end: 12px; border-radius: 10px; }
    .feature h3       { font-size: 15.5px; margin-block-end: 6px; }
    .feature p        { font-size: 13px; line-height: 1.78; }

    /* ── Deep / C2C ── */
    .deep             { gap: 26px; }
    .deep__visual     { order: -1; }
    .deep__lead       { font-size: 14px; line-height: 1.85; margin-block: 12px 20px; }
    .deep__list       { gap: 10px; }
    .deep__list li    { font-size: 13.5px; gap: 8px; line-height: 1.65; }
    .deep__list li i  { font-size: 1.15em; }

    /* ── Card mockup ── */
    .mockup--card       { padding: 18px 16px; border-radius: 18px; }
    .mockup__number     { margin-block: 12px; }
    .mockup__number-text{ font-size: clamp(14px, 5.5cqi, 22px); }

    /* ── Notify ── */
    .notify-grid         { gap: 12px; }
    .notify-card         { padding: 20px 16px; }
    .notify-card__icon   { inline-size: 46px; font-size: 21px; margin-block-end: 12px; }
    .notify-card h4      { font-size: 15.5px; }
    .notify-card p       { font-size: 13px; line-height: 1.75; }

    /* ── Compare ── */
    .compare-wrap {
        position: relative;
        border-radius: 16px;
    }
    .compare-wrap::after {
        content: '→  Swipe to see more columns  ←';
        display: block;
        text-align: center;
        font-size: 11px;
        font-weight: 700;
        color: var(--r-text-light);
        padding: 10px 0 2px;
        transition: opacity 0.35s ease;
    }
    .compare-wrap.has-scrolled::after { opacity: 0; }

    .compare               { grid-template-columns: 1.15fr 1.55fr 1fr 1fr; min-inline-size: 560px; }
    .compare__cell         { padding: 10px 6px; font-size: 11px; gap: 4px; }
    .compare__cell--feature{ padding-inline: 10px; font-size: 11px; gap: 4px; }
    .compare__cell--woomax { padding-left: 22px; }
    .compare__row--head .compare__cell          { padding-block: 12px; }
    .compare__row--head .compare__cell--woomax  { padding-block-start: 26px; padding-left: 6px; }
    .compare__brand         { font-size: 13px; }
    .compare__sub           { font-size: 9px; }
    .compare__val           { font-size: 10.5px; gap: 3px; }
    .compare__val--none     { font-size: 9.5px; }
    .compare__val--premium i{ left: 6px; font-size: 0.95em; }
    .compare__crown         { font-size: 8px; padding: 2px 7px; }

    /* ── FAQ ── */
    .faq               { min-height: auto; gap: 8px; }
    .faq__question     { font-size: 14px; padding: 15px 14px; min-block-size: 52px; line-height: 1.55; }
    .faq__answer p     { font-size: 13px; padding: 0 14px 15px; line-height: 1.85; }

    /* ── CTA ── */
    .cta          { margin-block: 16px 24px; padding: 26px 18px; border-radius: 20px; }
    .cta__inner   { gap: 18px; }
    .cta__inner h2{ font-size: clamp(18px, 5vw, 22px); line-height: 1.42; }
    .btn-cta      { padding: 12px 22px; font-size: 15px; width: 100%; max-inline-size: 280px; }
    .btn-cta__logo{ width: 24px; height: 24px; }

    /* ── Back to top ── */
    .back-to-top      { inset-block-end: max(18px, calc(18px + env(safe-area-inset-bottom))); inset-inline-start: max(18px, calc(18px + env(safe-area-inset-left))); inline-size: 46px; block-size: 46px; }
    .back-to-top i    { font-size: 20px; }

    /* ── Scroll nav hard-hidden ── */
    .scroll-nav { display: none !important; }

    /* ── Overflow safety ── */
    html, body  { max-inline-size: 100vw; overflow-x: clip; }

    /* ── Touch behavior ── */
    .faq__question,
    .btn-cta,
    .back-to-top { -webkit-tap-highlight-color: transparent; }
}

/* ═══════════════════════════════════════════════════════════════════
   04. SMALL PHONES — max-width: 480px
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .hero__title     { font-size: clamp(20px, 6.2vw, 28px); }
    .hero__desc      { font-size: 13px; line-height: 1.75; }
    .iphone          { --phone-width: clamp(112px, 33vw, 148px); }
    .hero__phones    { gap: 8px; }
    .section__title  { font-size: clamp(18px, 5.6vw, 24px); }
    .compare__crown span { display: none; }
    .feature         { padding: 16px 14px; }
    .btn-cta         { max-inline-size: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════
   05. TINY PHONES — max-width: 360px
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 360px) {
    .iphone          { --phone-width: clamp(96px, 30vw, 118px); }
    .hero__inner     { gap: 20px; }
    .hero__title     { font-size: 19px; }
    .hero__desc      { font-size: 12.5px; }
    .section         { padding-block: 32px; }
}

/* ═══════════════════════════════════════════════════════════════════
   06. TABLET — 900px to 1366px (portrait + landscape)
   Applies to iPads, Galaxy Tabs, Surface, etc.
   ═══════════════════════════════════════════════════════════════════ */

@media (min-width: 900px) and (max-width: 1366px) {

    /* Reveal system: still allow animation, but reveal quickly */
    [data-reveal] {
        transition-duration: 0.5s !important;
    }

    /* ── Hero ── */
    .hero        { padding-block: clamp(60px, 9dvh, 100px) clamp(50px, 8dvh, 80px); }
    .hero__inner { gap: clamp(28px, 4vw, 56px); }
    .iphone      { --phone-width: clamp(140px, 12vw, 190px); }

    /* ── Features ── */
    .features       { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
    .feature        { padding: 24px 20px; }
    .feature__icon  { inline-size: 50px; font-size: 22px; }
    .feature h3     { font-size: 17px; }
    .feature p      { font-size: 14px; line-height: 1.85; }

    /* ── Notify ── */
    .notify-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .notify-card__icon { inline-size: 54px; font-size: 24px; }

    /* ── Deep / C2C ── */
    .deep            { gap: clamp(36px, 5vw, 60px); }
    .deep__list li   { font-size: 14.5px; }

    /* ── Card mockup ── */
    .mockup--card    { max-inline-size: min(440px, 90vw); padding: 26px 24px; }

    /* ── FAQ ── */
    .faq__question   { min-block-size: 56px; font-size: 15px; padding: 18px 20px; }
    .faq__answer p   { font-size: 14px; padding: 0 20px 20px; }

    /* ── Compare: tablet also shows swipe hint (touch) ── */
    .compare-wrap    { position: relative; }
    .compare-wrap::after {
        content: '→  Swipe to see more columns  ←';
        display: block;
        text-align: center;
        font-size: 11.5px;
        font-weight: 700;
        color: var(--r-text-light);
        padding: 12px 0 4px;
        transition: opacity 0.35s ease;
    }
    .compare-wrap.has-scrolled::after { opacity: 0; }

    /* ── CTA ── */
    .btn-cta { padding: 14px 30px; font-size: 16px; }

    /* ── Back to top ── */
    .back-to-top {
        inline-size: 54px;
        block-size: 54px;
        inset-block-end: max(24px, calc(24px + env(safe-area-inset-bottom)));
    }

    /* ── Scroll nav: only show on non-touch large screens ── */
    @media (pointer: coarse) {
        .scroll-nav { display: none !important; }
    }
}

/* ═══════════════════════════════════════════════════════════════════
   07. LANDSCAPE — short viewports (phones and small tablets)
   ═══════════════════════════════════════════════════════════════════ */

@media (max-height: 560px) and (orientation: landscape) {

    .hero {
        min-block-size: auto;
        padding-block: 48px 32px;
    }

    .hero__title { font-size: clamp(18px, 3.5vw, 26px); }
    .hero__desc  { font-size: 13px; line-height: 1.7; }
    .iphone      { --phone-width: clamp(90px, 14vw, 130px); }
    .hero__blob  { opacity: 0.22; }

    /* Prevent hero grid from overflowing */
    .hero__inner { gap: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════
   08. LARGE DESKTOP — 1800px+
   ═══════════════════════════════════════════════════════════════════ */

@media (min-width: 1800px) {
    :root { --content-max: min(1320px, 88vw); }
}

@media (min-width: 2400px) {
    :root { --content-max: min(1520px, 82vw); }
}

/* ═══════════════════════════════════════════════════════════════════
   09. REDUCED MOTION — battery / accessibility
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    /* Kill the hero CSS animations we added */
    .iphone-wrap,
    .hero__text > [data-reveal] {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .trust__track,
    .iphone,
    .hero__blob,
    .back-to-top::after {
        animation: none !important;
    }

    .iphone--left  { transform: rotate(-2deg); }
    .iphone--right { transform: rotate(2deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   10. HIGH CONTRAST MODE
   ═══════════════════════════════════════════════════════════════════ */

@media (forced-colors: active) {
    .feature__icon,
    .notify-card__icon,
    .back-to-top {
        border: 2px solid currentColor;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   11. PRINT
   ═══════════════════════════════════════════════════════════════════ */

@media print {
    .hero__phones,
    .hero__bg,
    .scroll-nav,
    .back-to-top,
    .trust,
    .cta {
        display: none !important;
    }

    body { background: #fff; color: #000; }
    .section { break-inside: avoid; padding-block: 20px; }
}
