/* =========================================================
   mobile.css — Secret Maps | Experiencia móvil tipo App
   Breakpoint principal: 768px
   ========================================================= */

/* ─── Utility: ocultar en móvil / mostrar solo en móvil ── */
.desktop-only {
    display: revert;
}

.bottom-nav {
    display: none;
}

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

/* ─── Bottom Navigation ────────────────────────────────── */
@media (max-width: 768px) {
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: rgba(20, 48, 40, .96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, .12);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 9000;
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: rgba(255, 255, 255, .45);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .3px;
        padding: 6px 12px;
        border-radius: 12px;
        transition: color .2s, background .2s;
        -webkit-tap-highlight-color: transparent;
        min-width: 52px;
        min-height: 44px;
        position: relative;
    }

    .bottom-nav-item svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
        flex-shrink: 0;
        transition: transform .2s;
    }

    .bottom-nav-item:active {
        background: rgba(255, 255, 255, .06);
    }

    .bottom-nav-item:active svg {
        transform: scale(.9);
    }

    /* ─── Active tab indicator ─── */
    body[data-page="home"] .bottom-nav-item[data-nav="home"],
    body[data-page="login"] .bottom-nav-item[data-nav="home"],
    body[data-page="registro"] .bottom-nav-item[data-nav="home"],
    body[data-page="mapa"] .bottom-nav-item[data-nav="mapa"],
    body[data-page="favoritos"] .bottom-nav-item[data-nav="favoritos"],
    body[data-page="perfil"] .bottom-nav-item[data-nav="perfil"] {
        color: var(--accent, #f9d423);
    }

    body[data-page="home"] .bottom-nav-item[data-nav="home"]::before,
    body[data-page="mapa"] .bottom-nav-item[data-nav="mapa"]::before,
    body[data-page="favoritos"] .bottom-nav-item[data-nav="favoritos"]::before,
    body[data-page="perfil"] .bottom-nav-item[data-nav="perfil"]::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--accent, #f9d423);
    }

    /* ─── Body padding for bottom nav ─── */
    body:not([data-page="mapa"]) {
        padding-bottom: 64px !important;
    }
}

/* ─── Navbar simplification on mobile ──────────────────── */
@media (max-width: 768px) {
    /* En index: ocultar acciones duplicadas (bottom nav las cubre) */
    body[data-page="home"] .navbar-actions {
        display: none !important;
    }

    /* En perfil: solo mostrar "Cerrar sesión", ocultar el resto */
    body[data-page="perfil"] .navbar-actions .btn-ghost,
    body[data-page="perfil"] .navbar-actions .user-menu {
        display: none !important;
    }

    /* En login y registro: ocultar "← Inicio" (bottom nav) */
    body[data-page="login"] .navbar-actions .btn-ghost,
    body[data-page="registro"] .navbar-actions .btn-ghost {
        display: none !important;
    }

    /* En favoritos: ocultar navbar-actions (bottom nav cubre la navegación) */
    body[data-page="favoritos"] .navbar-actions {
        display: none !important;
    }

    /* Navbar más compacta */
    .navbar-inner {
        padding: 10px 0;
    }
}

/* ─── Mobile Quick Access (index) ──────────────────────── */
.mobile-quick-access {
    display: none;
}

@media (max-width: 768px) {
    .mobile-quick-access {
        display: block;
        padding: 0 0 32px;
        position: relative;
        z-index: 2;
    }

    .quick-section-title {
        text-align: center;
        font-size: 13px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--accent, #f9d423);
        margin-bottom: 16px;
    }

    .quick-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        background: rgba(255, 255, 255, .10);
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 16px;
        text-decoration: none;
        color: #fff;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transition: background .15s, transform .12s, border-color .15s;
        -webkit-tap-highlight-color: transparent;
    }

    .quick-card:active {
        transform: scale(.97);
        background: rgba(255, 255, 255, .16);
        border-color: rgba(249, 212, 35, .4);
    }

    .quick-card .quick-emoji {
        font-size: 28px;
        line-height: 1;
        flex-shrink: 0;
    }

    .quick-card .quick-text {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .quick-card .quick-text strong {
        font-size: 14px;
        font-weight: 800;
    }

    .quick-card .quick-text span {
        font-size: 11px;
        color: rgba(255, 255, 255, .55);
    }

    /* Card destacada (CTA principal) */
    .quick-card.quick-cta {
        grid-column: 1 / -1;
        background: rgba(249, 212, 35, .15);
        border-color: rgba(249, 212, 35, .35);
        justify-content: center;
        padding: 18px 16px;
    }

    .quick-card.quick-cta .quick-text strong {
        color: var(--accent, #f9d423);
        font-size: 15px;
    }
}

/* ─── Mobile Hero tweaks for index ─────────────────────── */
@media (max-width: 768px) {
    body[data-page="home"] .hero-area {
        min-height: auto;
        padding: 32px 0 20px;
    }

    body[data-page="home"] .hero-badge {
        margin-bottom: -8px;
    }

    body[data-page="home"] .hero-sub {
        font-size: 14px;
        max-width: 36ch;
    }

    /* Ocultar botones CTA del hero (bottom nav navega) */
    body[data-page="home"] .hero-cta {
        display: none !important;
    }
}

/* ─── Lugar del día (solo móvil) ───────────────────────── */
.lugar-del-dia {
    display: none;
}

@media (max-width: 768px) {
    .lugar-del-dia {
        display: block;
        padding: 0 0 24px;
        position: relative;
        z-index: 2;
    }

    .ldd-title {
        text-align: center;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        color: var(--accent, #f9d423);
        margin-bottom: 14px;
    }

    .ldd-card {
        background: rgba(255, 255, 255, .10);
        border: 1px solid rgba(255, 255, 255, .16);
        border-radius: 20px;
        overflow: hidden;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .ldd-img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        display: block;
    }

    .ldd-body {
        padding: 16px;
    }

    .ldd-cat {
        display: inline-block;
        padding: 3px 10px;
        background: rgba(249, 212, 35, .18);
        border: 1px solid rgba(249, 212, 35, .4);
        color: var(--accent, #f9d423);
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .3px;
        margin-bottom: 8px;
    }

    .ldd-body h3 {
        margin: 0 0 6px;
        font-size: 20px;
        font-weight: 900;
        color: #fff;
    }

    .ldd-body p {
        margin: 0 0 14px;
        font-size: 13px;
        color: rgba(255, 255, 255, .7);
        line-height: 1.5;
    }

    .ldd-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 11px 20px;
        background: var(--accent, #f9d423);
        color: #1f4037;
        border: none;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 800;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: filter .15s, transform .12s;
    }

    .ldd-btn:active {
        transform: scale(.97);
        filter: brightness(.95);
    }

    .ldd-btn svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }
}

/* ─── Touch & Accesibilidad ────────────────────────────── */
@media (max-width: 768px) {
    .btn,
    a.btn,
    button {
        min-height: 44px;
        touch-action: manipulation;
    }

    a,
    button,
    input,
    select,
    textarea {
        touch-action: manipulation;
    }

    /* Botones más anchos y con más padding en formularios */
    .form-card .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .cta-buttons .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ─── Form adjustments for mobile ──────────────────────── */
@media (max-width: 768px) {
    .form-container,
    .form-page {
        padding: 20px 0;
    }

    .form-card {
        margin: 12px;
        padding: 20px 16px;
        border-radius: 20px;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .form-group input,
    .form-group select {
        padding: 14px;
        font-size: 16px; /* evita zoom en iOS */
        border-radius: 12px;
    }

    .footer {
        display: none;
    }
}

/* ─── Perfil page mobile ───────────────────────────────── */
@media (max-width: 768px) {
    .profile-page {
        padding: 16px 0 32px;
    }

    .profile-intro h1 {
        font-size: clamp(28px, 7vw, 38px);
    }

    .profile-intro p {
        font-size: 14px;
    }

    .profile-card {
        border-radius: 20px;
        padding: 18px;
    }

    .profile-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-main-text h2 {
        text-align: center;
        font-size: clamp(24px, 6vw, 32px);
    }

    .profile-username {
        text-align: center;
    }

    /* Modal de edición más grande en móvil */
    .edit-modal {
        width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
    }

    .edit-modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .edit-field input,
    .edit-field textarea {
        font-size: 16px; /* evita zoom en iOS */
    }
}

/* ─── Mapa page mobile refinements ─────────────────────── */
@media (max-width: 768px) {
    .panel-info {
        width: 100%;
        right: -100%;
    }

    .panel-info.active {
        right: 0;
    }

    /* Toggle sidebar: arriba a la derecha */
    .btn-toggle-sidebar {
        top: 14px !important;
        right: 14px !important;
        left: auto !important;
        bottom: auto !important;
        z-index: 1600;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px !important;
        height: 44px !important;
        background: rgba(31, 64, 55, .92) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, .18) !important;
        border-radius: 14px !important;
        color: #fff;
        font-size: 20px !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    }

    /* Ocultar botón "Volver al inicio" (bottom nav lo reemplaza) */
    .btn-inicio {
        display: none !important;
    }

    /* Body del mapa: padding inferior para bottom nav */
    body[data-page="mapa"] {
        padding-bottom: 0 !important;
    }

    body[data-page="mapa"] #map {
        height: calc(100vh - 64px) !important;
    }

    body[data-page="mapa"] .mapa-container {
        height: calc(100vh - 64px);
    }

    body[data-page="mapa"] .bottom-nav {
        z-index: 1400;
    }

    /* Panel de info: ocupa toda la pantalla en móvil */
    body[data-page="mapa"] .panel-info {
        width: 100% !important;
        right: -100% !important;
    }

    body[data-page="mapa"] .panel-info.active {
        right: 0 !important;
    }

    body[data-page="mapa"] .info-hero {
        height: 220px;
    }

    body[data-page="mapa"] .info-hero-overlay h2 {
        font-size: 20px;
    }

    body[data-page="mapa"] #panel-info-content {
        padding: 18px 18px 100px;
    }
}
