/* Martins Studio TV — mobile interface v2 (solid tab bar + full layout shift) */

:root {
    --mobile-bottom-height: 68px;
    --touch-min: 48px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --tab-bg: #0c1222;
    --tab-border: #d4af37;
}

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

body.public-mobile-ready {
    padding-bottom: calc(var(--mobile-bottom-height) + var(--safe-bottom) + 8px);
}

/* ——— Solid bottom tab bar (no transparency) ——— */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    min-height: var(--mobile-bottom-height);
    padding: 6px 8px calc(6px + var(--safe-bottom));
    background: var(--tab-bg);
    border-top: 2px solid var(--tab-border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.55);
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    align-items: stretch;
    opacity: 1;
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    color: #e2e8f0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 14px;
    min-height: 52px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.mobile-bottom-nav a i {
    font-size: 1.35rem;
    color: #f8fafc;
}

.mobile-bottom-nav a.active {
    color: #111827;
    background: linear-gradient(135deg, #e8c547, #d4af37);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.mobile-bottom-nav a.active i {
    color: #111827;
}

.mobile-bottom-nav a:active {
    transform: scale(0.96);
}

/* ——— Nav drawer ——— */
.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1098;
    background: #020617;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.nav-backdrop.is-open {
    opacity: 0.88;
    visibility: visible;
}

body.nav-open {
    overflow: hidden;
}

.nav-toggle {
    z-index: 1101;
    background: #1e293b !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
}

.nav-toggle[aria-expanded="true"] {
    background: linear-gradient(135deg, #d4af37, #b8941f) !important;
    color: #111827 !important;
}

/* ——— Mobile layout transformation ——— */
@media (max-width: 900px) {
    :root {
        --public-container: calc(100% - 20px);
        --public-section-space: 40px;
        --public-card-padding: 20px;
        --public-card-radius: 20px;
        --public-navbar: 60px;
    }

    .mobile-bottom-nav {
        display: grid;
    }

    .public-navbar {
        background: #0c1222 !important;
        border-bottom: 2px solid rgba(212, 175, 55, 0.25) !important;
        backdrop-filter: none !important;
    }

    .navbar-container {
        min-height: 60px !important;
    }

    .rent-btn {
        display: none !important;
    }

    .public-content {
        padding-top: 4px;
    }

    .public-page-shell {
        width: calc(100% - 16px);
        margin-inline: auto;
        padding-top: 12px !important;
        padding-bottom: 20px !important;
    }

    /* Card system refresh */
    .public-card,
    .public-item-card,
    .home-hub-card,
    .home-stat,
    .home-client-cta,
    .public-sidebar-panel,
    .public-panel,
    .public-page-hero,
    .public-empty-state,
    .production-service-card,
    .public-video-card {
        border-radius: 20px !important;
        border: 1px solid rgba(212, 175, 55, 0.12) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28) !important;
    }

    .public-page-hero,
    .home-hero-inner {
        border-radius: 20px;
    }

    .home-hero {
        padding: 16px 0 24px !important;
    }

    .home-hero-inner {
        background: linear-gradient(160deg, #111827 0%, #0f172a 55%, #1a1f35 100%);
        border: 1px solid rgba(212, 175, 55, 0.2);
        padding: 24px 18px !important;
        margin: 0 10px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }

    .home-hero.has-banner .home-hero-inner {
        background: linear-gradient(160deg, rgba(3, 7, 18, 0.92), rgba(15, 23, 42, 0.95));
    }

    .hero-headline {
        font-size: clamp(1.65rem, 7vw, 2.15rem) !important;
        line-height: 1.15 !important;
    }

    .hero-lead {
        font-size: 0.95rem !important;
        margin-bottom: 20px !important;
    }

    .hero-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .hero-actions .hero-btn-primary {
        grid-column: 1 / -1;
    }

    .hero-btn-primary,
    .hero-btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 50px !important;
        font-size: 14px !important;
    }

    .home-hub-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .home-hub-card {
        padding: 16px 14px !important;
    }

    .home-hub-card h3 {
        font-size: 14px !important;
    }

    .home-hub-card p {
        font-size: 12px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .home-stats-bar {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .home-stat {
        padding: 14px 12px !important;
    }

    .home-stat strong {
        font-size: 1.35rem !important;
    }

    .home-section {
        padding: 32px 10px !important;
    }

    .home-section.alt {
        margin: 0 10px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .section-heading {
        font-size: 1.35rem !important;
        padding-left: 12px;
        border-left: 4px solid var(--accent);
        margin-bottom: 16px !important;
    }

    .home-client-cta {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center;
    }

    /* Inner pages */
    .public-page-hero {
        padding: 22px 18px !important;
        margin: 0 0 16px !important;
        background: linear-gradient(145deg, #111827, #0f172a) !important;
    }

    .public-page-title {
        font-size: clamp(1.45rem, 6vw, 1.9rem) !important;
    }

    .public-page-kicker {
        font-size: 10px !important;
    }

    .public-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .public-search-form {
        width: 100% !important;
        min-width: 0 !important;
    }

    .public-card-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .public-item-card {
        overflow: hidden;
    }

    .public-item-body {
        padding: 16px !important;
    }

    .public-item-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .public-item-actions > *,
    .public-item-actions form {
        width: 100% !important;
    }

    .public-btn-gold,
    .public-btn-outline {
        width: 100% !important;
        min-height: 50px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
    }

    .public-sidebar-panel.desktop-only-sidebar {
        display: none !important;
    }

    .mobile-category-rail {
        display: flex;
        padding: 0 2px 14px;
    }

    .mobile-category-chip {
        padding: 11px 18px;
        font-size: 14px;
        background: #1e293b;
        border-color: rgba(212, 175, 55, 0.2);
        color: #f1f5f9;
    }

    .mobile-category-chip.active {
        background: linear-gradient(135deg, #d4af37, #b8941f);
        color: #111827;
        border-color: transparent;
        font-weight: 800;
    }

    .public-video-grid,
    .production-services-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Drawer nav */
    .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(86vw, 300px) !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        padding: calc(60px + var(--safe-top)) 14px 24px !important;
        background: #0c1222 !important;
        border-left: 2px solid rgba(212, 175, 55, 0.35) !important;
        transform: translateX(105%);
        transition: transform 0.26s ease;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5) !important;
        overflow-y: auto !important;
    }

    .nav-links.open {
        transform: translateX(0) !important;
    }

    .nav-links a,
    .nav-more-links a {
        min-height: 50px !important;
        font-size: 15px !important;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.06);
        margin-bottom: 6px;
    }

    .nav-links a.active {
        background: rgba(212, 175, 55, 0.15) !important;
        border-color: rgba(212, 175, 55, 0.35) !important;
        color: var(--accent) !important;
    }

    /* Footer compact */
    .public-footer {
        padding: 28px 0 calc(20px + var(--mobile-bottom-height)) !important;
        background: #080d18 !important;
    }

    .footer-brand h3 {
        font-size: 1.15rem !important;
    }

    .whatsapp-float {
        bottom: calc(var(--mobile-bottom-height) + var(--safe-bottom) + 16px) !important;
        right: 14px !important;
        width: 52px !important;
        height: 52px !important;
        z-index: 1099;
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5) !important;
    }

    input,
    select,
    textarea,
    .public-search-form input {
        font-size: 16px !important;
        min-height: 50px !important;
    }
}

@media (max-width: 640px) {
    .hero-actions {
        grid-template-columns: 1fr !important;
    }

    .home-hub-grid {
        grid-template-columns: 1fr !important;
    }

    .brand-text span {
        display: none;
    }

    .brand-text h2 {
        font-size: 14px !important;
    }

    .mobile-bottom-nav a span {
        font-size: 9px;
    }
}

@media (min-width: 901px) {
    .mobile-bottom-nav,
    .mobile-category-rail,
    .nav-backdrop {
        display: none !important;
    }

    body.public-mobile-ready {
        padding-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-links,
    .nav-backdrop,
    .mobile-bottom-nav a {
        transition: none !important;
    }
}
