/* SOLUCIONES.CSS */
body {
    background-color: var(--bg-white);
    padding-top: 5rem; /* Space for fixed header */
    min-height: 100vh;
}

/* =========================================
   SOLUCIONES CONTENT IMAGES
   ========================================= */
.soluciones-main-container {
    width: 100%;
    overflow: hidden;
    /* Height = 100vh - Header (5rem) - Desktop Nav (60px) */
    height: calc(100vh - 5rem - 60px); 
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fefefe; /* Neutral background for letterboxing if needed */
}

/* Mobile Adjustment: Stacked Navs take more space */
@media (max-width: 768px) {
    .soluciones-main-container {
        /* 
           Header: 5rem (80px) -> Ignored by user request (overlap)
           Mobile Nav: ~80px (bottom)
           Thematic Nav: 50px (stacked on top of mobile nav)
           Total Bottom Space: 130px
           Total Top Space: 0 
           Total Reduction: 130px (Nav + Thematic only)
        */
        height: calc(100vh - 130px);
        margin-top: 0; 
        
        /* ALINEACIÓN SUPERIOR (Top Alignment) */
        justify-content: flex-start; /* Start from top */
        align-items: center; /* Center horizontally */
        padding-bottom: 0px; 
        padding-top: 0px; /* Flush */
    }
    
    /* Remove previous margin hacks */
    .soluciones-section {
        margin-bottom: 0; 
        height: auto; 
        flex: 1; /* Fill remaining space */
        display: flex;
        align-items: flex-start; /* Image starts at top of section */
        justify-content: center;
    }

    .soluciones-full-img {
        object-position: top center; 
    }

    /* === REGLAS ESPECÍFICAS PARA M1, M2, M3, M4 (Imágenes más pequeñas) === */
    #commercial .soluciones-full-img {
        width: 85%; /* M1 se mantiene igual */
        height: auto;
        object-fit: contain;
        margin-top: 2rem;
    }

    #industrial .soluciones-full-img,
    #power .soluciones-full-img,
    #solar .soluciones-full-img {
        width: 95%; /* M2, M3, M4 un poco más grandes */
        height: auto;
        object-fit: contain;
        margin-top: 2rem;
    }
}

/* Hide all sections by default */
.soluciones-section {
    width: 100%;
    height: auto; /* Allow it to fill remaining space */
    flex: 1; 
    margin-bottom: 0px;
    display: none; 
    justify-content: center;
    align-items: flex-start; /* Default top for all views if desired, or center for desktop */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    overflow: hidden;
}

/* Show active section */
.soluciones-section.active {
    display: flex; /* Use flex to center image */
    opacity: 1;
}

.soluciones-full-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* Ensure full image is visible within the space */
    object-position: center; /* Default center for M1-M4 */
}

/* =========================================
   DESKTOP ADJUSTMENTS (M1, M2, M3, M4)
   ========================================= */
@media (min-width: 769px) {
    #commercial .soluciones-full-img,
    #industrial .soluciones-full-img,
    #power .soluciones-full-img,
    #solar .soluciones-full-img {
        /* Reduce size, ensure they don't fill the entire screen */
        width: auto; 
        height: auto;
        
        /* 
           CAMBIAR ESTOS VALORES PARA REDUCIR TAMAÑO EN PC:
           - max-width: % del ancho de la pantalla (ej: 60% las hace más angostas)
           - max-height: % del alto de la pantalla (ej: 70% las hace más bajas)
        */
        max-width: 40%; 
        max-height: 40%; 
        
        object-fit: contain;
    }

    /* Override specifically for M2, M4 to make them larger */
    #industrial .soluciones-full-img,
    #solar .soluciones-full-img {
        max-width: 55%; 
        max-height: 55%; 
    }

    /* M3 Potencia - ligeramente más pequeña */
    #power .soluciones-full-img {
        max-width: 42%;
        max-height: 42%;
    }
}

/* Highlight Active Nav Block */
.nav-block.active {
    background-color: #F1F5F9;
}

.nav-block.active::before {
    height: 6px;
    opacity: 1;
}

/* =========================================
   THEMATIC NAVIGATION MODULE (LEGEND BAR)
   ========================================= */
.thematic-nav-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 900; /* Behind mobile menu (1000) but above content */
    background: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.thematic-nav-container {
    display: flex;
    width: 100%;
    height: 60px; /* Fixed height for the bar */
    overflow-x: auto; /* Allow scrolling on very small screens */
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE */
}

.thematic-nav-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.nav-block {
    flex: 1;
    min-width: 100px; /* Minimum width for readability */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0 0.5rem;
    position: relative;
    border-right: 1px solid rgba(0,0,0,0.03);
    background: white;
}

.nav-block:last-child {
    border-right: none;
}

.nav-block:hover {
    background: #F1F5F9;
}

/* Indicators (Color Bars) */
.nav-block::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: currentColor;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.nav-block:hover::before {
    height: 100%; /* Fill effect on hover? Or just thicker? Let's go with thicker line + glowing bg */
    height: 6px;
    opacity: 1;
}

/* Active State styling logic would go here if we tracked scroll position */

/* Typography */
.nav-block-code {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--theme-color);
}

.nav-block-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
}

/* THEME COLORS */
.nav-block.theme-start { --theme-color: #64748B; } /* Slate */
.nav-block.theme-m1 { --theme-color: #F97316; } /* Orange */
.nav-block.theme-m2 { --theme-color: #2563EB; } /* Blue */
.nav-block.theme-m3 { --theme-color: #DC2626; } /* Red */
.nav-block.theme-m4 { --theme-color: #16A34A; } /* Green */

.nav-block.theme-start .nav-block-code { color: #64748B; }
.nav-block.theme-m1 .nav-block-code { color: #F97316; }
.nav-block.theme-m2 .nav-block-code { color: #2563EB; }
.nav-block.theme-m3 .nav-block-code { color: #DC2626; }
.nav-block.theme-m4 .nav-block-code { color: #16A34A; }

/* Icon for Start */
.nav-block-icon {
    font-size: 1.5rem;
    color: #64748B;
    margin-bottom: 0;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .thematic-nav-wrapper {
        bottom: 80px; /* Stack ABOVE the existing mobile bottom nav */
        height: 50px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }

    .thematic-nav-container {
        height: 50px;
    }

    .nav-block {
        min-width: auto; /* Allow shrinking */
        flex: 1;
        padding: 0 0.25rem;
    }

    .nav-block-code {
        font-size: 0.8rem;
    }

    .nav-block-label {
        font-size: 0.55rem; /* Smaller on mobile */
        display: block; /* Ensure visibility */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Hide label on very small screens if needed, or truncate */
    @media (max-width: 360px) {
        .nav-block-label {
            display: none;
        }
        .nav-block-code {
            margin-bottom: 0;
            font-size: 0.9rem;
        }
    }
}
