/**
 * Invernadero Pro - Barra de Navegación Global Unificada
 * Compatible con escritorio, tablets y smartphones.
 */

:root {
    --nav-bg: rgba(10, 14, 26, 0.94);
    --nav-border: rgba(42, 54, 80, 0.85);
    --nav-accent: #10b981;
    --nav-accent-glow: rgba(16, 185, 129, 0.35);
    --nav-text: #e8edf9;
    --nav-text-muted: #8e9bb2;
    --nav-hover: rgba(255, 255, 255, 0.08);
}

/* Espaciado del body para no tapar contenido */
body.has-inv-nav {
    padding-top: 64px !important;
}

@media (max-width: 768px) {
    body.has-inv-nav {
        padding-bottom: 74px !important;
    }
}

/* ===== NAVBAR SUPERIOR ===== */
.inv-top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, sans-serif;
}

.inv-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--nav-text);
}

.inv-brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.inv-brand-text {
    display: flex;
    flex-direction: column;
}

.inv-brand-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inv-brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.inv-brand-sub {
    font-size: 0.72rem;
    color: var(--nav-text-muted);
}

/* Enlaces centrales (Escritorio) */
.inv-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.inv-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--nav-text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.inv-nav-item i {
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.inv-nav-item:hover {
    color: #fff;
    background: var(--nav-hover);
}

.inv-nav-item:hover i {
    transform: translateY(-1px);
}

.inv-nav-item.active {
    color: #fff;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.inv-nav-item.active i {
    color: var(--nav-accent);
}

.inv-badge-cortes {
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Lado derecho */
.inv-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inv-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--nav-text-muted);
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--nav-border);
    border-radius: 8px;
}

.inv-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: invPulse 2s infinite;
}

@keyframes invPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.inv-btn-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--nav-border);
    color: var(--nav-text);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ===== NAVBAR INFERIOR (MÓVIL) ===== */
.inv-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--nav-border);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
}

.inv-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--nav-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 10px;
    position: relative;
    flex: 1;
    text-align: center;
}

.inv-bottom-item i {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.inv-bottom-item.active {
    color: var(--nav-accent);
}

.inv-bottom-item.active i {
    transform: translateY(-2px);
    color: var(--nav-accent);
    filter: drop-shadow(0 2px 6px var(--nav-accent-glow));
}

.inv-bottom-item .inv-badge-cortes {
    position: absolute;
    top: 3px;
    right: calc(50% - 18px);
}

/* ===== DRAWER / MENÚ LATERAL MÓVIL ===== */
.inv-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: invFadeIn 0.25s ease;
}

.inv-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    background: #0f1624;
    border-left: 1px solid var(--nav-border);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', -apple-system, sans-serif;
}

.inv-drawer.open {
    right: 0;
}

.inv-drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inv-drawer-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--nav-text);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.inv-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inv-drawer-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--nav-text-muted);
    margin: 12px 0 6px 10px;
}

.inv-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--nav-text);
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.inv-drawer-item i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.inv-drawer-item:hover {
    background: var(--nav-hover);
}

.inv-drawer-item.active {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #fff;
}

.inv-drawer-item.active i {
    color: var(--nav-accent);
}

.inv-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--nav-border);
    font-size: 0.75rem;
    color: var(--nav-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@keyframes invFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive switches */
@media (max-width: 992px) {
    .inv-nav-links {
        display: none;
    }
    .inv-btn-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .inv-bottom-nav {
        display: flex;
    }
    .inv-live-indicator {
        display: none;
    }
}

/* ===== ACCIONES RÁPIDAS MODO CAMPO ===== */
.inv-nav-btn-campo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.inv-nav-btn-campo:hover {
    background: rgba(239, 68, 68, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.inv-nav-btn-campo.venta {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.inv-nav-btn-campo.venta:hover {
    background: rgba(16, 185, 129, 0.28);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.inv-bottom-item.campo-special {
    color: #34d399;
    font-weight: 800;
}
.inv-bottom-item.campo-special i {
    color: #10b981;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}

@media (max-width: 992px) {
    .inv-nav-btn-campo {
        display: none;
    }
}
