/* ============================================
   BarberShop — Mobile App Shell
   ============================================ */
:root {
    --app-topbar-h: 56px;
    --app-tabbar-h: 64px;
    --app-safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-safe-top: env(safe-area-inset-top, 0px);
    --booking-mobile-footer-h: 56px;
}

@media (max-width: 991px) {

    body.landing-page {
        -webkit-tap-highlight-color: transparent;
        overscroll-behavior-y: none;
    }

    body.landing-page.app-menu-open {
        overflow: hidden;
    }

    /* Hide desktop chrome */
    .site-header .main-nav,
    .site-header #header-cta-desktop,
    .site-header .menu-toggle,
    .mobile-nav,
    .scroll-top {
        display: none !important;
    }

    /* App top bar */
    .site-header {
        padding: 0;
        background: rgba(13, 13, 13, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--gold-a15);
        height: calc(var(--app-topbar-h) + var(--app-safe-top));
        padding-top: var(--app-safe-top);
        width: 100%;
        max-width: 100vw;
        overflow: visible;
        box-sizing: border-box;
    }

    .site-header.scrolled {
        padding-top: var(--app-safe-top);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    }

    .header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.5rem;
        height: var(--app-topbar-h);
        padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .header-inner .nav-desktop-wrap {
        display: none !important;
    }

    .site-logo {
        font-size: clamp(0.88rem, 3.6vw, 1.15rem);
        flex-shrink: 1;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }

    .site-logo span {
        display: inline;
    }

    .app-topbar-actions {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        position: relative;
        z-index: 3;
        flex-shrink: 0;
        margin-left: auto;
    }

    .app-topbar-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        flex-shrink: 0;
        border: none;
        background: rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        color: var(--white);
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s, transform 0.15s;
    }

    .app-topbar-btn:active {
        transform: scale(0.92);
        background: var(--gold-a20);
    }

    .app-topbar-btn.gold {
        background: var(--gold);
        color: var(--dark);
    }

    /* Main content area */
    .app-main {
        padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom) + 12px);
    }

    /* Bottom tab bar */
    .app-tabbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        height: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
        padding-bottom: var(--app-safe-bottom);
        background: rgba(18, 18, 18, 0.96);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    }

    .app-tabbar-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.6rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        border: none;
        background: none;
        cursor: pointer;
        padding: 6px 4px 8px;
        transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .app-tabbar-item i {
        font-size: 1.25rem;
        transition: transform 0.2s, color 0.2s;
    }

    .app-tabbar-item.active {
        color: var(--gold);
    }

    .app-tabbar-item.active i {
        transform: translateY(-2px);
    }

    .app-tabbar-item:active i {
        transform: scale(0.88);
    }

    .app-tabbar-item[data-open-app-menu].active {
        color: var(--gold);
    }

    .app-tabbar-item[data-open-app-menu].active i {
        transform: translateY(-2px);
    }

    /* Center FAB — Reservar */
    .app-tabbar-fab-wrap {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        max-width: 72px;
    }

    .app-tabbar-fab {
        position: absolute;
        top: -22px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(145deg, var(--gold-light), var(--gold-dark));
        color: var(--dark);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        text-decoration: none;
        box-shadow: 0 6px 24px var(--gold-a45);
        border: 3px solid var(--dark-2);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .app-tabbar-fab:active,
    .app-tabbar-fab.active-fab {
        transform: scale(0.92);
        box-shadow: 0 0 0 3px var(--gold-a50);
    }

    .app-tabbar-fab span {
        position: absolute;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.55rem;
        font-weight: 700;
        color: var(--gold);
        white-space: nowrap;
        letter-spacing: 0.05em;
    }

    /* Bottom sheet menu */
    .app-sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1200;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .app-sheet-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

    .app-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1300;
        background: var(--dark-2);
        border-radius: 20px 20px 0 0;
        padding: 0 0 calc(var(--app-tabbar-h) + var(--app-safe-bottom));
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: none;
        visibility: hidden;
    }

    .app-sheet.open {
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }

    .app-sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
        margin: 12px auto 8px;
    }

    .app-sheet-header {
        padding: 0.5rem 1.25rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .app-sheet-header h3 {
        font-family: var(--font-display);
        font-size: 1.35rem;
        margin: 0;
    }

    .app-sheet-header p {
        color: var(--text-muted);
        font-size: 0.85rem;
        margin: 0.25rem 0 0;
    }

    .app-menu-list {
        list-style: none;
        margin: 0;
        padding: 0.5rem 0;
    }

    .app-menu-list li a,
    .app-menu-list li button {
        display: flex;
        align-items: center;
        gap: 1rem;
        width: 100%;
        padding: 1rem 1.25rem;
        color: var(--white);
        text-decoration: none;
        font-size: 1rem;
        font-weight: 500;
        background: none;
        border: none;
        cursor: pointer;
        text-align: left;
        font-family: var(--font-body);
        transition: background 0.2s;
    }

    .app-menu-list li a:active,
    .app-menu-list li button:active {
        background: var(--gold-a12);
    }

    .app-menu-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: var(--gold-a12);
        color: var(--gold);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .app-menu-list .menu-chevron {
        margin-left: auto;
        color: var(--text-muted);
        font-size: 0.75rem;
    }

    .app-sheet-quick {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .app-quick-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        padding: 0.75rem 0.25rem;
        background: var(--dark-3);
        border-radius: 14px;
        text-decoration: none;
        color: var(--white);
        font-size: 0.65rem;
        font-weight: 600;
        border: 1px solid rgba(255, 255, 255, 0.05);
        transition: transform 0.15s, border-color 0.2s;
    }

    .app-quick-btn:active {
        transform: scale(0.95);
        border-color: var(--gold);
    }

    .app-quick-btn i {
        font-size: 1.25rem;
        color: var(--gold);
    }

    /* Sections mobile cards */
    .section {
        padding: 3.5rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.65rem;
    }

    /* About mobile */
    .about-image::before {
        display: none;
    }

    .about-badge {
        right: 1rem;
        bottom: 1rem;
        padding: 1rem 1.25rem;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    /* Appointment form */
    .appointment-form {
        padding: 1.5rem;
        border-radius: 16px;
        margin-top: 1.5rem;
    }

    .form-row.cols-2 {
        grid-template-columns: 1fr;
    }

    .appointment-form input,
    .appointment-form select,
    .appointment-form textarea {
        padding: 1rem;
        border-radius: 12px;
        font-size: 16px; /* evita zoom iOS */
    }

    .appointment-form .btn-gold {
        border-radius: 14px;
        padding: 1rem;
        font-size: 0.85rem;
    }

    /* Pricing tabs scroll */
    .pricing-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin: 1.5rem -1rem 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .pricing-tabs::-webkit-scrollbar {
        display: none;
    }

    .pricing-tab {
        flex-shrink: 0;
        border-radius: 20px;
        padding: 0.6rem 1.25rem;
    }

    .pricing-item {
        flex-wrap: wrap;
    }

    .pricing-dots {
        display: none;
    }

    .pricing-item-price {
        width: 100%;
        text-align: right;
        margin-top: 0.25rem;
    }

    /* CTA */
    .cta-banner {
        padding: 4rem 0;
        background-attachment: scroll;
    }

    /* Footer mobile — compact */
    .site-footer {
        padding: 2.5rem 0 0;
        margin-bottom: 0;
    }

    .footer-grid {
        gap: 2rem;
    }

    .footer-brand .site-logo {
        font-size: 1.5rem;
    }

    /* Testimonial mobile: ver landing-responsive.css */

    /* Page booking */
    .booking-app-page {
        padding-top: calc(var(--app-topbar-h) + var(--app-safe-top) + 1rem) !important;
        min-height: calc(100svh - var(--app-topbar-h) - var(--app-tabbar-h)) !important;
    }
}

/* Desktop: hide app-only UI */
@media (min-width: 992px) {
    .app-tabbar,
    .app-sheet,
    .app-sheet-backdrop,
    .app-topbar-actions {
        display: none !important;
    }
}
