/* Custom styles for HomeFront Realty (Tailwind-based) */

/* Header: fully transparent over hero; fixed so hero doesn’t drop on mobile */
nav.header-transparent,
nav.header-transparent > div,
body > nav.header-transparent,
body > nav.header-transparent > div {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* Mobile only: header scrolls with page (not sticky); hero full height, pulled up and behind nav so hero shows as header background. */
@media (max-width: 767px) {
    /* Eliminate white: body top = dark so header area never shows bg-slate-50 */
    body.page-with-hero {
        background: linear-gradient(180deg, #0f172a 0, #0f172a 100vh, #f8fafc 100vh) !important;
        background-color: #0f172a !important;
    }
    body.page-with-hero nav.header-transparent,
    body nav.header-solid {
        position: relative !important;
        z-index: 50;
    }
    /* Force header fully transparent – no background so hero/body dark shows through */
    body.page-with-hero nav.header-transparent,
    body.page-with-hero nav.header-transparent::before,
    body.page-with-hero nav.header-transparent::after,
    body.page-with-hero nav.header-transparent > div,
    body.page-with-hero nav.header-transparent > div::before,
    body.page-with-hero nav.header-transparent > div::after,
    body.page-with-hero nav.header-transparent > div > div {
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
    }
    /* Hero: 100vh, pulled up, behind nav. Exclude blog/about/contact/agents so they use their page CSS (same as blog). */
    body.page-with-hero nav + section:not(.blog-hero):not(.about-hero):not(.contact-hero):not(.agents-hero) {
        position: relative !important;
        z-index: 1 !important;
        margin-top: calc(-5rem - env(safe-area-inset-top, 0px)) !important;
        padding-top: calc(5rem + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
}


html {
    scroll-behavior: smooth;
}

/* ----- Page transition: entrance ----- */
.page-transition-wrap {
    animation: page-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.page-exit .page-transition-wrap {
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    opacity: 0;
    transform: translateY(-12px);
}
@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Submission loading overlay ----- */
.submit-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    animation: overlay-in 0.3s ease-out both;
}
.submit-loading-overlay--out {
    animation: overlay-out 0.2s ease-in forwards;
}
@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes overlay-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
.submit-loading-spinner {
    width: 56px;
    height: 56px;
    position: relative;
}
.submit-loading-spinner::before,
.submit-loading-spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: currentColor;
    animation: submit-spin 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.submit-loading-spinner::after {
    inset: 6px;
    border-top-color: rgba(0, 74, 173, 0.9);
    animation-duration: 1.2s;
    animation-direction: reverse;
}
.submit-loading-overlay .submit-loading-text {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #e2e8f0;
}
@keyframes submit-spin {
    to { transform: rotate(360deg); }
}

/* ----- Scroll-triggered animations ----- */
.scroll-animate {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.scroll-animate--fade {
    transform: none;
}
.scroll-animate--fade.is-visible {
    transform: none;
}
.scroll-animate--left {
    transform: translateX(-32px);
}
.scroll-animate--left.is-visible {
    transform: translateX(0);
}
.scroll-animate--right {
    transform: translateX(32px);
}
.scroll-animate--right.is-visible {
    transform: translateX(0);
}
.scroll-animate--scale {
    transform: scale(0.96);
}
.scroll-animate--scale.is-visible {
    transform: scale(1);
}
.scroll-animate--up {
    transform: translateY(32px);
}
.scroll-animate--up.is-visible {
    transform: translateY(0);
}
/* Stagger children (e.g. grid items) */
.scroll-animate-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-animate-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.scroll-animate-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.scroll-animate-stagger.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.scroll-animate-stagger.is-visible > *:nth-child(4) { transition-delay: 0.2s; }
.scroll-animate-stagger.is-visible > *:nth-child(5) { transition-delay: 0.25s; }
.scroll-animate-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; }
.scroll-animate-stagger.is-visible > *:nth-child(7) { transition-delay: 0.35s; }
.scroll-animate-stagger.is-visible > *:nth-child(8) { transition-delay: 0.4s; }
.scroll-animate-stagger.is-visible > *:nth-child(9) { transition-delay: 0.45s; }
.scroll-animate-stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy loading is set via HTML: <img loading="lazy"> */
img {
    max-width: 100%;
    height: auto;
}

/* Hide scrollbar for discover carousel (keep functionality) */
.scrollbar-hide {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Line clamp fallback for older browsers */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Inline button loading spinner (small) */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #fff;
    vertical-align: middle;
    margin-right: 0.5rem;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Modern popup modal */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: popup-overlay-in 0.25s ease-out;
}
.popup-overlay--out {
    animation: popup-overlay-out 0.2s ease-in forwards;
}
.popup-overlay--out .popup-card {
    animation: popup-card-out 0.2s ease-in forwards;
}

.popup-card {
    position: relative;
    width: 100%;
    max-width: 22rem;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: popup-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.popup-accent--success { border-top: 3px solid #004aad; }
.popup-accent--error   { border-top: 3px solid #ef4444; }
.popup-accent--warning { border-top: 3px solid #f59e0b; }

.popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.popup-close:hover {
    color: #64748b;
    background: #f1f5f9;
}

.popup-body {
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.popup-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    animation: popup-icon-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
.popup-icon--success { background: rgba(0, 74, 173, 0.12); color: #004aad; }
.popup-icon--error   { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.popup-icon--warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.popup-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.popup-message {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #64748b;
    margin-bottom: 1.5rem;
}
.popup-message a {
    color: #004aad;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.popup-message a:hover {
    color: #003d91;
}

.popup-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.popup-ok:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
.popup-ok:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}
.popup-btn--success { background: linear-gradient(180deg, #004aad 0%, #003d91 100%); box-shadow: 0 2px 8px rgba(0, 74, 173, 0.35); }
.popup-btn--error   { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35); }
.popup-btn--warning { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35); }

@keyframes popup-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes popup-overlay-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes popup-card-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
@keyframes popup-card-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.96) translateY(4px);
    }
}
@keyframes popup-icon-in {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- Confirm modal (replaces browser confirm) ----- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: popup-overlay-in 0.25s ease-out both;
}
.confirm-overlay--out {
    animation: popup-overlay-out 0.2s ease-in forwards;
}
.confirm-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.35);
    animation: popup-card-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
}
.confirm-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: color 0.15s, background 0.15s;
}
.confirm-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}
.confirm-body {
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}
.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}
.confirm-icon--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.confirm-icon--primary {
    background: rgba(0, 74, 173, 0.12);
    color: #004aad;
}
.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}
.confirm-message {
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}
.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.confirm-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, opacity 0.15s;
}
.confirm-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
.confirm-btn--cancel {
    background: #e2e8f0;
    color: #475569;
}
.confirm-btn--cancel:hover {
    background: #cbd5e1;
    color: #0f172a;
}
.confirm-btn--primary {
    background: linear-gradient(180deg, #004aad 0%, #003d91 100%);
    color: #fff;
}
.confirm-btn--danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

/* ----- Bulk action bar: only visibility toggle (layout via Tailwind) ----- */
.js-bulk-bar.hidden {
    display: none !important;
}

/* ----- Mobile menu (max-width: 1023px): Tailwind handles layout; only JS-driven states here ----- */
@media (max-width: 1023px) {
    .mobile-menu-overlay {
        pointer-events: none;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }
    .mobile-menu-overlay.mobile-menu-overlay--open {
        pointer-events: auto;
        visibility: visible;
        opacity: 1;
    }
    .mobile-menu-overlay.hidden {
        display: none !important;
    }
    .mobile-menu-card {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .mobile-menu-overlay.mobile-menu-overlay--open .mobile-menu-card {
        opacity: 1;
    }
    .mobile-menu-user-row--open .mobile-menu-user-chevron {
        transform: rotate(180deg);
    }
    .mobile-menu-user-options {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0.2s ease;
    }
    .mobile-menu-user-options.mobile-menu-user-options--open {
        max-height: 380px;
        opacity: 1;
        visibility: visible;
        display: block;
    }
    .mobile-menu-user-options[hidden] {
        display: none !important;
    }
    .mobile-menu-center {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .mobile-menu-overlay ::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
    .mobile-menu-close-btn,
    .mobile-menu-panel-link,
    .mobile-menu-close-on-nav {
        -webkit-tap-highlight-color: transparent;
    }
    html.mobile-menu-open,
    body.mobile-menu-open {
        overflow: hidden;
        height: 100%;
    }
}

/* Print: hide nav, footer, WhatsApp, popups */
@media print {
    nav, footer, .no-print, a[title="Chat on WhatsApp"], .popup-overlay, .confirm-overlay, .mobile-menu-overlay {
        display: none !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ========== Mobile only (max-width: 767px) – does not affect tablet/desktop ========== */
@media (max-width: 767px) {
    /* Smooth, fluid scrolling on mobile: momentum + GPU layer + touch optimizations */
    html {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        overflow-x: hidden;
    }
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        touch-action: pan-y;
    }
    #main-content {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* About, Agents, Contact: one viewport height (never exceed screen), content centered (mobile only) */
    body.page-with-hero nav + section.about-hero,
    body.page-with-hero nav + section.contact-hero,
    body.page-with-hero nav + section.agents-hero {
        margin-top: -4rem !important;
        margin-bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
        padding-top: 20vh !important;
        padding-bottom: 20vh !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        overflow: hidden !important;
    }
    body.page-with-hero nav + section.about-hero .about-hero-inner,
    body.page-with-hero nav + section.contact-hero .contact-hero-inner,
    body.page-with-hero nav + section.agents-hero .hero-content {
        margin: -2rem auto 0 auto !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        position: relative !important;
        z-index: 1 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 56rem !important;
        text-align: center !important;
    }
    /* Margins/paddings to match blog hero exactly (.blog-badge, .blog-hero-title, .blog-lead) */
    body.page-with-hero nav + section.about-hero .about-badge,
    body.page-with-hero nav + section.contact-hero .contact-badge,
    body.page-with-hero nav + section.agents-hero .hero-badge {
        padding: 0.5rem 1.25rem !important;
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body.page-with-hero nav + section.about-hero .about-title,
    body.page-with-hero nav + section.contact-hero .contact-hero-title,
    body.page-with-hero nav + section.agents-hero .hero-title {
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body.page-with-hero nav + section.about-hero .lead,
    body.page-with-hero nav + section.contact-hero .contact-lead {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        max-width: 26rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    body.page-with-hero nav + section.agents-hero .hero-content > p {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        max-width: 26rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    /* Agents hero: hide map overlay on mobile only (desktop/tablet unchanged) */
    body.page-with-hero nav + section.agents-hero .hero-map-overlay {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    /* Homepage search form: reduce height on mobile */
    .hero-search-card {
        padding: 1rem 1.25rem !important;
    }
    .hero-search-form {
        gap: 0.75rem !important;
    }
    .hero-search-form label {
        margin-bottom: 0.35rem !important;
    }
    .hero-search-form input,
    .hero-search-form select {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        min-height: 0 !important;
    }
    .hero-search-form button {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* ----- Header: safe areas, touch targets, no overflow ----- */
    .nav-mobile-friendly {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-top: env(safe-area-inset-top);
        min-height: 56px;
    }
    .nav-mobile-friendly .max-w-7xl {
        overflow-x: hidden;
    }
    /* Logo text: prevent overflow on very small screens */
    .nav-mobile-friendly .truncate.max-w-\[140px\] {
        max-width: min(140px, 45vw);
    }

    /* Mobile nav links: 44px+ touch targets, clear tap area */
    .mobile-nav-link {
        display: block;
        padding: 0.875rem 1rem;
        min-height: 44px;
        line-height: 1.4;
        font-size: 1rem;
        border-radius: 0.5rem;
        color: #fff;
        transition: background 0.2s, color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-nav-link:hover,
    .mobile-nav-link:focus {
        background: rgba(255, 255, 255, 0.1);
        color: #93c5fd;
    }
    .mobile-nav-link:active {
        background: rgba(255, 255, 255, 0.15);
    }
    .mobile-menu-user .mobile-nav-link--logout:hover,
    .mobile-menu-user .mobile-nav-link--logout:focus {
        color: #fca5a5;
        background: rgba(239, 68, 68, 0.15);
    }

    /* User dropdown on mobile: full width, doesn’t overflow */
    #userDropdownMobile {
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
        max-width: calc(100vw - 2rem);
        width: 18rem;
        border-radius: 1rem;
    }
    #userDropdownMobile a,
    #userDropdownMobile .px-4.py-2 {
        min-height: 44px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }

    /* Touch-friendly: no double-tap zoom on buttons */
    .touch-manual {
        touch-action: manipulation;
    }

    /* WhatsApp button: avoid notch/home indicator, larger tap target */
    a[title="Chat on WhatsApp"] {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
        width: 3.25rem;
        height: 3.25rem;
        min-width: 48px;
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Forms: 16px inputs to avoid iOS zoom on focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Tables: scroll horizontally if needed */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Cards and content: comfortable padding */
    main .px-4 {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Final mobile hero overrides (last in file so they win over Tailwind / inline) */
@media (max-width: 767px) {
    body.page-with-hero {
        background: linear-gradient(180deg, #0f172a 0, #0f172a 100vh, #f8fafc 100vh) !important;
        background-color: #0f172a !important;
    }
    body.page-with-hero nav.header-transparent,
    body.page-with-hero nav.header-transparent > div,
    body.page-with-hero nav.header-transparent > div > div {
        background: none !important;
        background-color: transparent !important;
        background-image: none !important;
    }
}
