/* 2. Cabecera (Sticky Header) */
.main-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    z-index: 999999;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    overflow: visible;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.logo span {
    color: var(--primary);
}

/* Selector de Ubicación */
.location-selector {
    position: relative;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    user-select: none;
    flex-shrink: 0;
}

.location-selector:hover {
    background: var(--primary);
    color: #fff;
}

.location-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    width: 220px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.location-selector:hover .location-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.location-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.location-dropdown a:hover,
.location-dropdown a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Barra de Navegación */
.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.btn-login {
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 18px !important;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-login:hover {
    background: var(--primary);
    color: #fff !important;
}

.btn-register {
    background: var(--primary);
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-register:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

.btn-logout {
    color: #EF4444 !important;
}

.btn-logout:hover {
    background: #FEF2F2 !important;
}

/* Nav link modifiers */
.nav-link--highlight {
    color: #60A5FA;
    font-weight: 700;
}

.nav-link--highlight:hover {
    color: #3B82F6 !important;
}

.nav-link--admin {
    color: #C084FC;
    font-weight: 700;
}

.nav-link--admin:hover {
    color: #A855F7 !important;
}

.nav-link--panel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Badge de notificaciones en el nav */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.nav-publish-mobile {
    display: none;
}

/* Botón Hamburguesa */
.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* PÍLDORA MINIMALISTA DE CABECERA (ESTILO APPLE) */
.location-pill-clean {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #DBEAFE;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
    flex-shrink: 0;
}
.location-pill-clean:hover {
    background: #2563EB;
    color: #ffffff;
    border-color: #2563EB;
}

/* POPOVER / SHEET MINIMALISTA */
.location-popover-minimal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200000;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.location-popover-minimal.active {
    display: flex !important;
}
.location-sheet-clean {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: sheetPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetPop {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
.location-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.location-sheet-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}
.location-sheet-close {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.btn-gps-minimal {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0284c7;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}
.btn-gps-minimal:hover {
    background: #e0f2fe;
}
.btn-gps-minimal:active {
    transform: scale(0.96);
}
.location-muni-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.location-muni-tabs::-webkit-scrollbar {
    display: none;
}
.muni-tab-btn {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: transform 0.1s ease, background 0.2s ease, color 0.2s ease;
}
.muni-tab-btn:active {
    transform: scale(0.95);
}
.muni-tab-btn.active {
    background: #2563EB;
    color: #ffffff;
}
.location-sub-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-top: 4px;
    -webkit-overflow-scrolling: touch;
}
.location-sub-grid::-webkit-scrollbar {
    width: 4px;
}
.location-sub-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.location-sub-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}
.sub-select-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.2s ease;
}
.sub-select-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.sub-select-btn:active {
    transform: scale(0.96);
}
.sub-select-btn.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 700;
}

/* PREMIUM INNOVATION EFFECTS */
@keyframes premiumGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px 12px rgba(245, 158, 11, 0.4);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
        transform: scale(1);
    }
}
.premium-pulse-active {
    animation: premiumGlow 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}