/* HERO SECTION */
.hero-cards {
    min-height: 70vh;
    width: 100%;
    padding: var(--section-padding);
    display: flex;
    align-items: center;
}

.hero-cards--infra {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-infra-mant-vial.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--ingenieria-transito {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-ingenieria-transito.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--senalamiento-vial {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-senalamiento-vial.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--senalamiento-vertical {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-senalamiento-vertical.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--senalamiento-horizontal {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-senalamiento-horizontal.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--dispositivos-obra {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-dispositivos-obra.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--sistemas-contencion {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-sistemas-contencion.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--limpieza {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-limpieza-rehabilitacion-edificacion.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--semaforizacion {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-semaforizacion.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--its {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-sist-intel-transp.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--publicidad {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-publicidad.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--sistemas-transporte {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-sistemas-transporte.avif') 
                center / cover no-repeat fixed;
}

.hero-cards--energia-renovable {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-energia-renovable.avif') 
                center / cover no-repeat fixed;
}


.hero-cards-texts {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    color: var(--white);
}

.hero-cards-texts h1 {
    width: 100%;
    padding: 20px 0;
    position: relative;
    margin-bottom: 40px;
    color: inherit;
}

.hero-cards-texts h1::after{
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 2px;
    background: var(--primary-color);
}

.hero-cards-texts span {
    font-size: 1rem;
}

.hero-cards-texts p {
    width: 80%;
    font-family: var(--font-body);
    font-weight: 600;
}

/* SERVICE SECTION*/
.section-cards{
    padding: var(--section-padding);
}

/* Contenedor de las tarjetas */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 35px;
}

/* Tarjeta Base */
.cards-container .card {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    width: 100%;
    height: auto;
    min-height: 300px;
    background-color: var(--dark-color);
    border-radius: 0 15px 15px 15px;
    box-shadow: var(--shadow); 
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Imagen con Clip-Path animado */
.card-content {
    position: relative;
    height: 200px;
    /* Estado inicial inclinado */
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
    transition: clip-path 0.5s ease-in-out,
                scale 0.5s ease-in-out;
}

.card-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Animación del Clip-Path al hacer hover en la card */
.card:hover .card-content {
    /* Estado final recto (mismo número de puntos) */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    scale: 1.1;
}

/* Detalles y Textos */
.details {
    padding: 20px 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;    
}

.details h2, .details h3 {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--white);
    text-align: left;
    font-size: 1rem;
    margin: 10px 0 15px 0;
    position: relative;
    padding-bottom: 10px;
}

/* La Línea animada */
.details h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: var(--primary-color);
    width: 30px; 
    transition: width 0.4s ease-in-out, background-color 0.4s ease;
    border-radius: 2px;
}

/* Animación de la línea al hacer hover en la card */
.card:hover .details h2::after {
    width: 80px; /* La línea se expande */
}

.details p {
    color: var(--white);
    font-size: .9rem;
    line-height: 1.6;
    font-weight: 400;
    margin: 0;
    margin-bottom: 20px;
    flex: 1;
}

.details p span {
    font-weight: bold;
}

.details a {
    align-self: flex-end;
    margin-top: 0;
    font-size: .8rem;
    font-weight: 600;
    padding: 5px 15px;
    background-color: var(--primary-color);
    color: var(--dark-color);
    border-radius: 0 8px 8px 8px;
}

.details a:hover {
    box-shadow: var(--shadow);
    color: var(--white);
    text-shadow: var(--shadow);
}

/* NIVEL 1: Mega sección */
.section-large {
    width: 100%;
    background-color: #f5f5f5;
    padding: var(--section-padding);
}

/* Banner full-width en la parte superior de la mega sección */
.section-large__banner {
    width: 100%;
    min-height: 30vh;
    display: flex;
    align-items: center;
    background-color: var(--dark-color);
    margin-bottom: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

/* Overlay específico para mejorar legibilidad del texto */
.section-large__banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.55) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

.section-large__banner .container {
    padding: 30px 0;
    position: relative;
    z-index: 2;                         
}

.section-large__banner h2 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3); 
}

.section-large__banner p {
    text-align: center;
    max-width: 850px;
    font-family: var(--font-body);
    font-weight: 500;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

/* Área donde flotan las subsecciones */
.section-large__body {
    display: flex;
    flex-direction: column;
    gap: 0;                              
    padding: 0;                       
}

/* El .container dentro del body centra el ancho */
.section-large__body .container {
    display: flex;
    flex-direction: column;
    gap: 0;                         
}

/* NIVEL 2: SUBSECCIÓN — PADRE */         
.subsection {
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 3px;      
}

.subsection:hover {
    border-color: rgba(255,107,0,0.3);  
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
}


/* Header de la SUBSECCIÓN */
.subsection__header {
    display: flex;
    flex-direction: row;
    min-height: 240px;
    max-height: 280px;
    cursor: default;
    background-color: #333333;        
    transition: background-color 0.3s ease;
}

.subsection__header:hover {
    background-color: #3a3a3a;
}

.subsection__header-img {
    flex: 2;
    overflow: hidden;
    position: relative;
    max-height: auto;
    display: flex;
    justify-content: end;
}

.subsection__header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left;
    display: block;
    transition: scale 0.5s ease;
}

.subsection__header-img--center img {
    object-position: center;
}

.subsection__header-img--contain img {
    object-fit: contain;
    object-position: center;
}

.subsection__header:hover .subsection__header-img img {
    scale: 1.1;
}

/* Textos del header */
.subsection__header-texts {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 50px;
    background-color: var(--white);
}

.subsection__header-texts h3 {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    position: relative;
    padding-bottom: 10px;
    text-align: center;
}

.subsection__header-texts p {
    color: var(--dark-color);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    text-align: center;
}


/* NIVEL 3: Área de cards NIETAS */
.subsection__cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;                           
    padding: 35px 25px 40px;           
    background-color: #2a2a2a;
    margin-bottom: 15px          
}

/* Las cards hijas son NEGRAS para destacar como nivel más profundo */
.subsection__cards .card {
    background-color: #1a1a1a;          
    min-width: 280px;                   
    max-width: 380px;                  
    flex: 1 1 calc(33.333% - 20px);      
    min-height: 60px;                  
    transition: all 0.3s ease;
}

.subsection__cards .card--large {
    flex: content;
    max-width: 100%;
}

.subsection__cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 5px 5px var(--primary-color);
}

/* Las cards dentro de la caja no tienen imagen, solo .details */
.subsection__cards .details {
    padding: 15px 20px;             
}

.subsection__cards .details h2 {
    font-size: 1rem;
    color: var(--white);
    margin: 0 0 12px 0;
}

.subsection__cards .details p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0 0 10px;
    font-size: 0.9rem;
}

.subsection__cards .details img {
    display: block;
    width: 100%;
    min-height: 150px;
    max-height: 150px;
    object-fit: fill;
    margin-bottom: 12px;
}

 /* RESPONSIVE MONITORES MEDIANOS */

@media (min-width: 1800px) {
    .hero-cards .hero-cards-texts h1 {
        font-size: 3rem;
    }

    .hero-cards .hero-cards-texts p {
        font-size: 1.3rem;
    }

    .subsection__header .subsection__header-texts h3 {
        font-size: 2rem;
    }

    .subsection__header .subsection__header-texts p {
        font-size: 1.2rem;
    }

    .subsection__cards .card .details h2 {
        font-size: 1.2rem;
    }

    .subsection__cards .card .details p {
        font-size: 1rem;
    }
}


/* RESPONSIVE  */
@media (max-width: 1024px) {
    /* En tablets: 2 columnas */
    .subsection__cards .card {
        flex: 1 1 calc(50% - 20px);
    }

    .hero-cards-texts {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {

    .section-large__banner--vertical,
    .section-large__banner--horizontal {
        background-attachment: scroll;
    }

    /* Banner más compacto en móvil */
    .section-large__banner {
        min-height: 30vh;
    }

    .section-large__banner .container {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .section-large__banner h2 {
        font-size: 2rem;
    }

    /* Cabecera pasa a columna: imagen arriba, texto abajo */
    .subsection__header {
        flex-direction: column;
        min-height: 500px;
        max-height: 500px;
        width: 100%;
    }

    .subsection__header-img {
        flex: unset;
        max-height: 300px;
        height: 300px;
    }

    .subsection__header-img img {
        object-position: center; 
    }

    .subsection__header-texts {
        flex: unset;
        padding: 25px 20px 30px;
    }

    .subsection__header-texts h3 {
        font-size: 1.3rem;
    }

    /* Cards hijas: ancho completo en móvil */
    .subsection__cards .card {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .subsection__cards {
        padding: 25px 15px 30px;
        gap: 15px;
    }

    .subsection__cards .details {
        max-width: auto;
        display: flex;
    }

    .subsection__cards .details img {
        max-width: 350px;
        align-self: center;
    }

    /* Reducir gaps en móvil */
    .section-large {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .section-large__banner h2 {
        font-size: 1.6rem;
    }

    .section-large__banner p {
        font-size: 0.95rem;
    }

    .subsection__header-texts {
        padding: 20px 15px 25px;
    }
}


/* Responsive - Monitores de escritorio: 1440px, 1920px */
@media (min-width: 1400px) {

    .section-large__banner h2 {
        font-size: 2rem;
    }

    .section-large__banner p {
        font-size: 1.05rem;
        max-width: 1000px;
    }

    /* Header */
    .subsection__header {
        min-height: 320px;
    }

    .subsection__header-texts h3 {
        font-size: 1.6rem;
    }

    .subsection__header-texts p {
        font-size: 1rem;
    }

    /* Cards */
    .subsection__cards .card {
        flex: 1 1 calc(33.333% - 20px);
    }

    .subsection__cards .details h2 {
        font-size: 1.1rem;
    }

    .subsection__cards .details p {
        font-size: 0.95rem;
    }
}

@media (min-width: 1800px) {
    .section-large__banner p {
        max-width: 1200px;
    }

    .subsection__header {
        min-height: 360px;
    }

    .cards-container .card {
        min-width: 420px;
    }

    .details h2 {
        font-size: 1.2rem;
    }

    .details p {
        font-size: 1rem;
    }

    .details a {
        font-size: 1rem;
    }
}