/*=============================================
            AMBIENTAL SECTION - CSS INDEPENDIENTE (ACTUALIZADO)
=============================================*/

/* Variables de color específicas del módulo */
.ambiental-section {
    --ambiental-primary: #2e7d32;
    --ambiental-secondary: #4caf50;
    --ambiental-light: #e8f5e9;
    --ambiental-dark: #1b5e20;
    --ambiental-text: #333333;
    --ambiental-overlay: rgba(46, 125, 50, 0.1);
}

/* Contenedor principal */
.ambiental-section {
    background-color: var(--ambiental-light);
    position: relative;
    overflow: hidden;
    font-family: 'Ubuntu', sans-serif;
}

/* Columnas */
.ambiental-content-column {
    background: linear-gradient(135deg, var(--ambiental-light) 0%, #ffffff 100%);
    position: relative;
    overflow: hidden; /* Para contener las hojas */
}

.ambiental-content-column::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(to left, var(--ambiental-light) 0%, transparent 100%);
    z-index: 2;
}

.ambiental-image-column {
    position: relative;
}

/* Contenido */
.ambiental-content {
    min-height: 600px;
    position: relative;
    z-index: 1;
}

/* Logo */
.ambiental-logo {
    filter: drop-shadow(0 4px 8px rgba(46, 125, 50, 0.2));
    transition: all 0.5s ease;
    max-width: 189px;
    height: auto;
}

.ambiental-logo:hover {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 8px 16px rgba(46, 125, 50, 0.3));
}

/* Texto principal */
.ambiental-text {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--ambiental-text);
    max-width: 400px;
}

.ambiental-text p {
    margin: 0;
}

.ambiental-text strong {
    color: var(--ambiental-primary);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.ambiental-text strong::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--ambiental-primary), var(--ambiental-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.ambiental-section:hover .ambiental-text strong::after {
    transform: scaleX(1);
}

/* Botón */
.ambiental-btn {
    background: linear-gradient(135deg, var(--ambiental-primary) 0%, var(--ambiental-secondary) 100%);
    border: none;
    color: white !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.2);
}

.ambiental-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ambiental-secondary) 0%, var(--ambiental-primary) 100%);
    transition: left 0.4s ease;
    z-index: -1;
    border-radius: 50px;
}

.ambiental-btn:hover::before {
    left: 0;
}

.ambiental-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.3);
    color: white;
}

.ambiental-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.2);
}

/* Imagen principal */
.ambiental-main-image {
    transition: transform 0.8s ease;
    min-height: 400px;
}

.ambiental-image-container:hover .ambiental-main-image {
    transform: scale(1.05);
}

.ambiental-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--ambiental-overlay) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.ambiental-image-container:hover .ambiental-image-overlay {
    opacity: 1;
}

/* HOJAS FLOTANTES */
.ambiental-leaves {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambiental-leaf {
    position: absolute;
    opacity: 0;
    transform: translateY(100vh);
    transition-timing-function: linear;
    will-change: transform, opacity;
}

/* Espaciadores */
.ambiental-spacer-top,
.ambiental-spacer-bottom {
    transition: height 0.3s ease;
}

/* Animaciones de entrada */
@keyframes ambiental-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ambiental-content {
    animation: ambiental-fade-in 0.8s ease forwards;
}

.ambiental-main-image {
    animation: ambiental-fade-in 1s ease forwards 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Efectos de hover para toda la sección */
.ambiental-section:hover .ambiental-logo {
    animation: logo-pulse 2s infinite;
}

@keyframes logo-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Estados de carga */
.ambiental-main-image.loading {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: ambiental-loading 1.5s infinite;
}

@keyframes ambiental-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.ambiental-main-image.loaded {
    background: none;
    animation: none;
}

/* Mejoras de accesibilidad */
.ambiental-btn:focus {
    outline: 3px solid var(--ambiental-primary);
    outline-offset: 3px;
}

.ambiental-section:focus-within {
    outline: 2px solid var(--ambiental-primary);
    outline-offset: -2px;
}

/* Responsive */
@media (max-width: 992px) {
    .ambiental-content-column,
    .ambiental-image-column {
        width: 100%;
    }
    
    .ambiental-content-column {
        order: 2;
    }
    
    .ambiental-image-column {
        order: 1;
        height: 400px;
    }
    
    .ambiental-content-column::before {
        display: none;
    }
    
    .ambiental-content {
        min-height: 500px;
        padding: 3rem 1rem;
    }
    
    .ambiental-text {
        font-size: 1.3rem;
    }
    
    /* Ocultar hojas en móvil */
    .ambiental-leaves {
        display: none;
    }
}

@media (max-width: 768px) {
    .ambiental-content {
        min-height: 400px;
        padding: 2rem 1rem;
    }
    
    .ambiental-logo {
        width: 150px;
        height: 150px;
    }
    
    .ambiental-text {
        font-size: 1.2rem;
    }
    
    .ambiental-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .ambiental-image-column {
        height: 350px;
    }
}

@media (max-width: 576px) {
    .ambiental-section {
        padding: 2rem 0 !important;
    }
    
    .ambiental-content {
        min-height: 350px;
        padding: 1.5rem 1rem;
    }
    
    .ambiental-logo {
        width: 120px;
        height: 120px;
    }
    
    .ambiental-text {
        font-size: 1.1rem;
    }
    
    .ambiental-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
    
    .ambiental-image-column {
        height: 300px;
    }
}

/* Modo oscuro opcional */
@media (prefers-color-scheme: dark) {
    .ambiental-section {
        --ambiental-light: #1a1a1a;
        --ambiental-text: #ffffff;
        --ambiental-overlay: rgba(76, 175, 80, 0.2);
    }
    
    .ambiental-content-column {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
}