/* layouts.css - Estructura y Distribución iGarden */

/* 1. HEADER Y NAVEGACIÓN (Sticky) */
.main-header {
    background-color: var(--verde-bosque);
    color: white;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 15px; /* Ajuste para móviles */
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1; /* Ocupa el espacio necesario para empujar el resto */
}

.logo-main {
    width: 60px;          /* Antes 42px */
    height: 60px;         /* Antes 42px */
    object-fit: contain;
    margin-right: 15px;   /* Un poco más de aire */
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    transition: all 0.3s ease; /* Para que el cambio a PC sea suave */
}

.brand-title {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 1.4rem; /* Tamaño base móvil */
    margin: 0;
    letter-spacing: -1px;
    white-space: nowrap;
}

.header-right {
    flex-shrink: 0;
    margin-left: 10px;
}

/* TABS DE NAVEGACIÓN (Sistema Anti-Amontonamiento) */
.nav-tabs {
    display: flex;
    justify-content: flex-start; /* Empiezan a la izquierda para poder deslizar */
    gap: 5px;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.03);
    overflow-x: auto; /* Permite scroll lateral con el dedo */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
    scrollbar-width: none; /* Oculta scrollbar Firefox */
}

.nav-tabs::-webkit-scrollbar { display: none; } /* Oculta scrollbar Chrome/Safari */

.tab-btn {
    padding: 15px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap; /* Evita que el texto salte de línea */
    flex-shrink: 0; /* Evita que las pestañas se estrechen */
}

.tab-btn.active {
    color: white;
    border-bottom: 3px solid var(--terracota);
}

/* 2. CONTENEDOR PRINCIPAL */
.container {
    width: 92%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
    flex: 1;
}

/* 3. SECCIONES Y ANIMACIONES */
.tab-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-section.active {
    display: block;
}

/* 4. GRID INTELIGENTE (Home y Botiquín) */
.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
}

#diagnosis-result {
    width: 100%;
    min-height: 120px;
    margin-top: 10px;
}

/* 5. RESPONSIVE DESKTOP (PC y Tablets grandes) */
@media (min-width: 768px) {
    .header-top {
        padding: 15px 20px;
    }

    .logo-main {
            width: 85px;      /* Tamaño imponente en escritorio */
            height: 85px;
        }

    .brand-title {
        font-size: 1.8rem;
    }

    .nav-tabs {
        justify-content: center; /* En PC se centran */
        overflow: hidden; /* No hace falta scroll lateral */
    }

    .container {
        padding: 40px 0;
    }

    .home-grid {
        grid-template-columns: 1.5fr 1fr; /* Proporción áurea para PC */
        gap: 40px;
        align-items: start;
    }

    .card.full-width,
    #btn-diagnosticar {
        grid-column: span 2;
    }

    #diagnosis-result {
        margin-top: 0;
    }
}

/* Animación global */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}