/* ==========================================================
   RED COMERCIAL
========================================================== */

.representantes-section {
    padding: 100px 0;
    background: #fff;
}

.representante-card {
    background: #fff;
    border-radius: 22px;
    padding: 40px 30px;
    text-align: center;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    transition: .35s ease;
}

.representante-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .15);
}

.representante-card i {
    font-size: 2.8rem;
    color: var(--color-primary);
    margin-bottom: 18px;
}

.representante-card h3 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-dark);
}

.representante-card span {
    display: block;
    color: #7b7b7b;
    margin-bottom: 6px;
}

.representante-card strong {
    display: block;
    font-size: 1.45rem;
    color: var(--color-primary);
    margin-bottom: 25px;
}

.btn-representante {
    display: inline-block;
    text-decoration: none;
    background: var(--color-primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: .3s;
}

.btn-representante:hover {
    background: var(--color-secondary);
    color: #fff;
    transform: translateY(-2px);
}

/* ===================================
   REPRESENTANTES
=================================== */

.representantes-section {

    padding: 90px 0;

    background: #f7f9f5;

}


.representantes-grid {

    margin-top: 50px;

}


.representante-card {

    height: 100%;

    background: #ffffff;

    border-radius: 22px;

    padding: 35px 30px;

    text-align: center;

    position: relative;

    border: 1px solid rgba(25, 135, 84, .12);

    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);

    transition: all .35s ease;

    overflow: hidden;

}


/* línea superior */

.representante-card::before {

    content: "";

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 5px;

    background: var(--accent-green, #3c8d2f);

    transform: scaleX(0);

    transition: .35s;

}


.representante-card:hover::before {

    transform: scaleX(1);

}



.representante-card:hover {

    transform: translateY(-8px);

    box-shadow: 0 18px 40px rgba(0, 0, 0, .12);

}



/* Icono */

.representante-card i {

    width: 70px;

    height: 70px;

    display: flex;

    justify-content: center;

    align-items: center;

    margin: 0 auto 20px;

    border-radius: 50%;

    background: #e9f7ef;

    color: var(--accent-green, #3c8d2f);

    font-size: 32px;

    transition: .3s;

}


.representante-card:hover i {

    background: var(--accent-green, #3c8d2f);

    color: white;

    transform: scale(1.1) rotate(6deg);

}


/* Rotación de color por tarjeta: verde / dorado / turquesa */

.representante-card:nth-child(3n+2)::before {
    background: var(--accent-gold, #F9A825);
}

.representante-card:nth-child(3n+2) i {
    background: rgba(249, 168, 37, .16);
    color: var(--accent-gold-dark, #c97f0d);
}

.representante-card:nth-child(3n+2):hover i {
    background: var(--accent-gold, #F9A825);
    color: #fff;
}

.representante-card:nth-child(3n+2) strong {
    color: var(--accent-gold-dark, #c97f0d);
}

.representante-card:nth-child(3n+2) .btn-representante {
    background: var(--accent-gold, #F9A825);
    color: #1F2937;
}

.representante-card:nth-child(3n+3)::before {
    background: var(--accent-teal, #0f8b8d);
}

.representante-card:nth-child(3n+3) i {
    background: rgba(15, 139, 141, .14);
    color: var(--accent-teal-dark, #0a6567);
}

.representante-card:nth-child(3n+3):hover i {
    background: var(--accent-teal, #0f8b8d);
    color: #fff;
}

.representante-card:nth-child(3n+3) strong {
    color: var(--accent-teal-dark, #0a6567);
}

.representante-card:nth-child(3n+3) .btn-representante {
    background: var(--accent-teal, #0f8b8d);
}



/* Ciudad */

.representante-card h3 {

    font-size: 25px;

    font-weight: 700;

    color: #222;

    margin-bottom: 10px;

}



/* Operador */

.representante-card span {

    display: block;

    font-size: 14px;

    color: #777;

    text-transform: uppercase;

    letter-spacing: 1px;

    margin-bottom: 5px;

}



/* Número */

.representante-card strong {

    display: block;

    font-size: 25px;

    color: var(--accent-green, #3c8d2f);

    margin-bottom: 25px;

    letter-spacing: .5px;

}



/* Botón */

.btn-representante {

    display: inline-flex;

    justify-content: center;

    align-items: center;

    width: 100%;

    padding: 12px 20px;

    border-radius: 50px;

    background: var(--accent-green, #3c8d2f);

    color: white;

    text-decoration: none;

    font-weight: 600;

    transition: .3s;

}



.btn-representante:hover {

    filter: brightness(.9);

    color: white;

    transform: translateY(-2px);

}

/* BENEFICIOS */

.benefits-section {
    padding: 100px 0;
    background: #f8faf8;
}

.benefit-card {
    padding: 40px 35px;
    border-radius: 20px;
    text-align: center;
    height: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .10);
    transition: .35s;
    color: #fff;
}

.benefit-card:nth-child(3n+1) {
    background: linear-gradient(150deg, var(--accent-green, #3c8d2f) 0%, var(--accent-green-dark, #2a6a22) 100%);
}

.benefit-card:nth-child(3n+2) {
    background: linear-gradient(150deg, var(--accent-teal, #0f8b8d) 0%, var(--accent-teal-dark, #0a6567) 100%);
}

.benefit-card:nth-child(3n+3) {
    background: linear-gradient(150deg, #ffb238 0%, var(--accent-gold-dark, #c97f0d) 100%);
}

.benefit-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .20);
}

.benefit-card i {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 20px;
    display: inline-block;
    transition: .3s ease;
}

.benefit-card:hover i {
    transform: scale(1.12) rotate(-6deg);
}

.benefit-card h3 {
    font-size: 1.35rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: #fff;
}

.benefit-card p {
    color: rgba(255, 255, 255, .88);
    line-height: 1.7;
}


/*==========================================================
 CTA
==========================================================*/

.cta-section {
    padding: 110px 0;
}

.cta-box {

    position: relative;
    overflow: hidden;

    background: linear-gradient(135deg, #2f7d32 0%, #3d9440 100%);
    border-radius: 30px;

    padding: 80px 60px;

    text-align: center;

    box-shadow: 0 25px 60px rgba(47, 125, 50, .25);

}

/* Efectos decorativos */

.cta-box::before {

    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    background: rgba(255, 255, 255, .08);

    border-radius: 50%;

    top: -120px;
    right: -100px;

}

.cta-box::after {

    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    background: rgba(255, 255, 255, .06);

    border-radius: 50%;

    bottom: -70px;
    left: -60px;

}

.cta-box>* {

    position: relative;
    z-index: 2;

}

.cta-box .section-tag {

    display: inline-block;

    background: rgba(255, 255, 255, .18);

    color: #fff;

    padding: 8px 18px;

    border-radius: 50px;

    font-size: .9rem;

    font-weight: 600;

    margin-bottom: 18px;

}

.cta-box h2 {

    color: #fff;

    font-size: clamp(2rem, 4vw, 3rem);

    font-weight: 700;

    margin-bottom: 20px;

}

.cta-box p {

    max-width: 700px;

    margin: 0 auto;

    color: rgba(255, 255, 255, .9);

    line-height: 1.8;

    font-size: 1.05rem;

}

/* BOTONES */

.cta-buttons {

    margin-top: 45px;

    display: flex;

    justify-content: center;

    gap: 20px;

    flex-wrap: wrap;

}

.btn-primary-custom,
.btn-secondary-custom {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    min-width: 220px;

    padding: 16px 34px;

    border-radius: 999px;

    text-decoration: none;

    font-weight: 600;

    transition: .35s ease;

    font-size: 1rem;

}

/* Principal */

.btn-primary-custom {

    background: #fff;

    color: var(--color-primary);

    border: 2px solid #fff;

}

.btn-primary-custom:hover {

    background: #f4f4f4;

    color: var(--color-primary);

    transform: translateY(-4px);

    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);

}

/* Secundario */

.btn-secondary-custom {

    color: #fff;

    border: 2px solid rgba(255, 255, 255, .45);

    background: transparent;

}

.btn-secondary-custom:hover {

    background: rgba(255, 255, 255, .12);

    color: #fff;

    transform: translateY(-4px);

    border-color: #fff;

}

.btn-primary-custom i,
.btn-secondary-custom i {

    font-size: 1.2rem;

}

/*==========================================================
 RESPONSIVE
==========================================================*/

@media(max-width:991px) {

    .cta-box {

        padding: 60px 35px;

    }

}

@media(max-width:576px) {

    .cta-box {

        padding: 45px 25px;

    }

    .cta-box h2 {

        font-size: 2rem;

    }

    .cta-box p {

        font-size: .95rem;

    }

    .btn-primary-custom,
    .btn-secondary-custom {

        width: 100%;

    }

}


/* ==========================================================================
   TARJETAS DE REPRESENTANTES CON FOTO DE FONDO
   Cada región usa una foto de su lugar más representativo
   (assets/img/red-comercial/regiones/<region>.jpg). Si el .jpg no existe,
   se ve la ilustración <region>.svg que está detrás. Al pasar el mouse la
   tarjeta se agranda y la foto hace zoom.
========================================================================== */

.representante-card.rep-foto {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 400px;
    padding: 0;
    text-align: left;
    border: 0;
    border-radius: 24px;
    background: #2a5a2e;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
    overflow: hidden;
    isolation: isolate;
    transition: scale .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease;
    will-change: scale;
}

/* Se anula la línea superior del diseño anterior */
.representante-card.rep-foto::before {
    display: none;
}

/* Foto (o ilustración) de fondo */
.rep-foto-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat;
    transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

/* Degradado para que el texto blanco siempre se lea */
.representante-card.rep-foto::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top,
            rgba(8, 28, 12, .92) 0%,
            rgba(8, 28, 12, .70) 30%,
            rgba(8, 28, 12, .12) 62%,
            rgba(8, 28, 12, 0) 100%);
    transition: opacity .45s ease;
}

/* Distintivo del lugar (arriba a la izquierda) */
.representante-card.rep-foto .rep-lugar {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #1F5C24;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
}

.representante-card.rep-foto .rep-lugar i {
    width: auto;
    height: auto;
    margin: 0;
    background: none;
    color: var(--accent-green, #3c8d2f);
    font-size: 14px;
    display: inline;
    transition: none;
}

/* Texto inferior */
.representante-card.rep-foto .rep-info {
    position: relative;
    z-index: 3;
    padding: 0 26px 26px;
}

.representante-card.rep-foto h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: #fff;
    font-size: 30px;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.representante-card.rep-foto h3 i {
    width: auto;
    height: auto;
    margin: 0;
    background: none;
    color: var(--secondary-color, #F9A825);
    font-size: 22px;
    display: inline;
    transition: none;
}

.representante-card.rep-foto .rep-contacto {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.representante-card.rep-foto .rep-contacto span {
    display: block;
    margin: 0 0 2px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    letter-spacing: 1.2px;
}

.representante-card.rep-foto .rep-contacto strong {
    display: block;
    margin: 0;
    color: #fff;
    font-size: 23px;
    letter-spacing: .4px;
    white-space: nowrap;
}

.representante-card.rep-foto .btn-representante {
    width: auto;
    flex-shrink: 0;
    gap: 8px;
    padding: 11px 22px;
    background: var(--secondary-color, #F9A825);
    color: #1F2937;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
}

.representante-card.rep-foto .btn-representante i {
    width: auto;
    height: auto;
    margin: 0;
    background: none;
    color: inherit;
    font-size: 14px;
    display: inline;
    transition: none;
}

.representante-card.rep-foto .btn-representante:hover {
    background: #fff;
    color: #1F5C24;
    filter: none;
}

/* Al pasar el mouse: la tarjeta se agranda y la foto hace zoom */
/* Se usa la propiedad "scale" (no "transform") porque GSAP deja un transform
   en línea en la tarjeta tras la animación de entrada y anularía el hover. */
.representante-card.rep-foto:hover {
    scale: 1.07;
    z-index: 5;
    box-shadow: 0 28px 60px rgba(0, 0, 0, .32);
}

.representante-card.rep-foto:hover .rep-foto-bg {
    transform: scale(1.12);
}

.representante-card.rep-foto:hover .rep-lugar i,
.representante-card.rep-foto:hover h3 i {
    transform: none;
    background: none;
    color: inherit;
}

.representante-card.rep-foto:hover .rep-lugar i {
    color: var(--accent-green, #3c8d2f);
}

.representante-card.rep-foto:hover h3 i {
    color: var(--secondary-color, #F9A825);
}

/* Accesibilidad por teclado */
.representante-card.rep-foto:focus-within {
    scale: 1.04;
    z-index: 5;
}

@media (max-width: 575px) {

    .representante-card.rep-foto {
        min-height: 340px;
    }

    .representante-card.rep-foto h3 {
        font-size: 26px;
    }

}

/* Pantallas táctiles: sin "hover", se agranda un poco al tocar */
@media (hover: none) {

    .representante-card.rep-foto:hover {
        scale: 1;
    }

    .representante-card.rep-foto:active {
        scale: 1.03;
    }

}

@media (prefers-reduced-motion: reduce) {

    .representante-card.rep-foto,
    .rep-foto-bg {
        transition: none;
    }

}
