/* ==========================================================================
   PREMIUM MOBILE UI – COMPLETE REDESIGN
   ========================================================================== */

/* ── VISIBILITY TOGGLES ── */
.mobile-only { display: none !important; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: block !important; }
}

/* ────────────────────────────────────────────────────────────────────────── */
/* MOBILE BREAKPOINT                                                          */
/* ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── GLOBAL RESETS ── */
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    body {
        font-size: 15px;
    }

    /* 
     * CRITICAL: Override non-scrollable for home page on mobile.
     * The .non-scrollable class uses overflow:hidden + touch-action:none
     * which prevents internal scrolling. We must beat it with !important.
     */
    #page-1.non-scrollable {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        touch-action: pan-y !important;   /* Allow vertical touch scroll */
        -webkit-overflow-scrolling: touch;
        display: block !important;        /* Override flex centering */
        align-items: flex-start !important;
    }

    /* Give every page bottom clearance so the dock never covers content */
    .page {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Prevent the generic padding override from conflicting */
    .page-2-container,
    .hero-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* ── HERO WRAPPER ── */
    .hero-content.luxury-hero {
        position: relative;
        z-index: 10;          /* Always above aurora / stars / clouds */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 100%;
        /* Small top padding – heart compass button is fixed so doesn’t affect flow */
        padding: 18px 0 30px 0 !important;
    }

    /* ── TITLE – fluid responsive sizing, maximum specificity to beat index.html inline rules ── */
    #page-1 h1.hero-title,
    h1.hero-title.premium-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-family: 'Playfair Display', serif;
        font-size: clamp(1.8rem, 9vw, 2.6rem) !important;
        letter-spacing: clamp(3px, 1.5vw, 8px) !important;
        line-height: 1.15;
        margin: 0 auto 16px auto !important;
        padding: 0 12px;
        text-align: center;
        color: #ffffff !important;   /* explicit white – never invisible */
        font-weight: 700;
        text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255,94,142,0.3);
        white-space: nowrap;
        width: 100%;
    }

    /* ── GLASSMORPHISM QUOTE CARD ── */
    .glass-quote-card {
        background: rgba(255, 255, 255, 0.07);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 14px;
        padding: 14px 18px;
        margin: 0 auto 28px auto;
        width: calc(100% - 40px);
        max-width: 360px;
        font-family: 'Inter', sans-serif;
        font-size: clamp(0.8rem, 3.5vw, 0.95rem);
        line-height: 1.55;
        font-weight: 300;
        font-style: italic;
        color: rgba(255, 255, 255, 0.88);
        text-align: center;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    }

    /* ── PREMIUM 2-COLUMN GRID ── */
    .premium-grid-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: calc(100% - 32px);
        max-width: 440px;
        margin: 0 auto;
        padding: 0;
    }

    .grid-card {
        position: relative;
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        padding: 16px 8px 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        aspect-ratio: 1 / 1;
        text-decoration: none;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
        transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                    background 0.22s ease,
                    box-shadow 0.22s ease;
        /* Prevent tap colour flash */
        -webkit-tap-highlight-color: transparent;
        overflow: hidden;
    }

    /* Subtle shimmer on top edge */
    .grid-card::before {
        content: '';
        position: absolute;
        top: 0; left: 20%; right: 20%;
        height: 1px;
        background: linear-gradient(90deg,
            transparent,
            rgba(255,255,255,0.3),
            transparent);
    }

    .grid-card:active {
        transform: scale(0.94);
        background: rgba(255, 255, 255, 0.11);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .grid-icon {
        font-size: clamp(1.5rem, 7vw, 1.9rem);
        line-height: 1;
        filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
    }

    .grid-label {
        font-family: 'Outfit', sans-serif;
        font-size: clamp(0.7rem, 3.2vw, 0.82rem);
        font-weight: 500;
        color: rgba(255, 255, 255, 0.82);
        letter-spacing: 0.4px;
        text-align: center;
        line-height: 1.2;
        /* No overflow for short words */
        word-break: break-word;
    }

    /* ── FLOATING WIDGETS (✨ & 🎁 buttons) ── */
    /* On mobile, shrink them and pin just above the dock, never over grid */
    .floating-widgets {
        position: fixed !important;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
        right: 14px !important;
        z-index: 9999 !important;
        flex-direction: column;
        gap: 10px;
    }

    .widget-btn {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.3rem !important;
        box-shadow: 0 0 12px rgba(255, 94, 142, 0.35) !important;
    }

    /* ── FLOATING HEART COMPASS (TOP-RIGHT) ── */
    .heart-compass {
        position: fixed;
        top: 18px;
        right: 16px;
        width: 46px;
        height: 46px;
        background: rgba(255, 255, 255, 0.09);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        box-shadow: 0 4px 14px rgba(255, 94, 142, 0.35);
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        -webkit-tap-highlight-color: transparent;
    }

    .heart-compass:active {
        transform: scale(0.88);
    }

    .heart-icon {
        font-size: 1.35rem;
    }

    /* ── CIRCULAR WHEEL NAVIGATION ── */
    .heart-wheel {
        position: fixed;
        top: 40px;
        right: 40px;
        width: 0;
        height: 0;
        z-index: 9999;
        pointer-events: none;
    }

    .heart-wheel.active {
        pointer-events: all;
    }

    .wheel-item {
        position: absolute;
        width: 42px;
        height: 42px;
        background: rgba(10, 6, 20, 0.92);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 94, 142, 0.45);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: white;
        text-decoration: none;
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
        transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .heart-wheel.active .wheel-item {
        opacity: 1;
        transform: translate(
            calc(-100px * cos(var(--i) * 90deg / 5)),
            calc( 100px * sin(var(--i) * 90deg / 5))
        ) scale(1);
    }

    .wheel-item::after {
        content: attr(data-label);
        position: absolute;
        top: 46px;
        font-size: 0.58rem;
        font-family: 'Outfit', sans-serif;
        background: rgba(0, 0, 0, 0.65);
        padding: 2px 6px;
        border-radius: 8px;
        white-space: nowrap;
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }

    .heart-wheel.active .wheel-item::after {
        opacity: 1;
        transition-delay: 0.28s;
    }

    /* ── BOTTOM DOCK ── */
    .mobile-bottom-dock {
        position: fixed;
        /* respect iPhone home bar */
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 28px);
        max-width: 420px;
        height: 56px;
        background: rgba(8, 4, 18, 0.72);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 28px;
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        z-index: 10000;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38),
                    inset 0 1px 0 rgba(255, 255, 255, 0.07);
    }

    .dock-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.5);
        text-decoration: none;
        transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
        width: 20%;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .dock-item.active {
        color: var(--accent-primary, #ff5e8e);
        transform: translateY(-4px);
    }

    .dock-icon {
        font-size: 1.15rem;
        line-height: 1;
        margin-bottom: 2px;
        transition: transform 0.28s ease;
    }

    .dock-item.active .dock-icon {
        transform: scale(1.18);
        filter: drop-shadow(0 0 8px var(--accent-primary, #ff5e8e));
    }

    .dock-label {
        font-family: 'Outfit', sans-serif;
        font-size: 0.58rem;
        font-weight: 500;
        letter-spacing: 0.2px;
    }

    /* ── MICRO ANIMATIONS ── */
    .glow-button {
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                    box-shadow 0.2s;
    }

    .glow-button:active {
        transform: scale(0.93) !important;
    }

    /* ── HERO PARTICLES (subtle, z-index safe) ── */
    .hero-particles {
        position: absolute;
        inset: 0;
        overflow: hidden;
        pointer-events: none;
        z-index: 0;          /* behind text, never on top */
    }

    .particle {
        position: absolute;
        width: 3px;
        height: 3px;
        background: rgba(255, 255, 255, 0.75);
        border-radius: 50%;
        box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.5);
        animation: float-particle 10s infinite ease-in-out;
    }

    .p1 { top: 15%; left:  8%; animation-duration:  8s; }
    .p2 { top: 65%; left: 82%; animation-duration: 13s; width: 5px; height: 5px; }
    .p3 { top: 38%; left: 48%; animation-duration:  9s; }
    .p4 { top: 82%; left: 18%; animation-duration: 11s; width: 2px; height: 2px; }
    .p5 { top:  8%; left: 72%; animation-duration: 15s; }

    @keyframes float-particle {
        0%,  100% { transform: translateY(0)     scale(1);   opacity: 0.25; }
        50%        { transform: translateY(-24px) scale(1.4); opacity: 0.9;  }
    }

    /* ── HERO TOP TEXT – remove on small mobile ── */
    .hero-top-text {
        display: none !important;
    }

    /* ── FLOATING HEARTS / DECORATIVE – behind content ── */
    .floating-heart-hero,
    .stars,
    .clouds,
    .aurora-bg {
        pointer-events: none !important;
        /* Only block interaction, do NOT force z-index –
           the hero content has z-index:10 which keeps it on top */
    }
}

/* ── TINY SCREEN: iPhone SE / 375 px width ── */
@media (max-width: 390px) {
    h1.hero-title.premium-title {
        font-size: clamp(1.4rem, 9vw, 1.8rem) !important;
        letter-spacing: 2px !important;
    }

    .glass-quote-card {
        font-size: 0.78rem;
        padding: 12px 14px;
    }

    .premium-grid-container {
        gap: 10px !important;
        width: calc(100% - 24px);
    }

    .grid-card {
        border-radius: 16px;
    }

    .grid-icon {
        font-size: 1.4rem;
    }

    .grid-label {
        font-size: 0.68rem;
    }

    .mobile-bottom-dock {
        height: 52px;
        border-radius: 26px;
    }

    .dock-icon { font-size: 1.05rem; }
    .dock-label { font-size: 0.55rem; }
}
