/*  VARIABLES  */
:root {
    --naranja: #EF7D00;
    --naranja-oscuro: #C46700;
    --naranja-suave: rgba(239, 125, 0, .10);
    --gris: #54565A;
    --gris-medio: #8A8D91;

    --fondo: #FFFFFF;
    --fondo-2: #F7F6F4;
    --fondo-3: #EDECEA;
    --tinta: #1C1C1C;
    --tinta-2: var(--gris);
    --borde: #E3E2E0;
    --borde-2: #CECDCB;

    --radio-sm: 10px;
    --radio-lg: 24px;

    --fuente: 'Outfit', system-ui, sans-serif;

    --sombra: 0 1px 2px rgba(84, 86, 90, .06), 0 4px 12px rgba(84, 86, 90, .07);
    --sombra-md: 0 2px 8px rgba(84, 86, 90, .09), 0 8px 28px rgba(84, 86, 90, .10);

    --duracion-giro: 1.5s;
}

/*  CONTENEDOR  */
.contenedor {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}


/*  SECCIÓN  */
#servicios {
    padding: 96px 0;
    background: transparent;
}


/*  ENCABEZADO */
.encabezado-seccion {
    text-align: center;
    margin-bottom: 56px;
}

.encabezado-seccion .subtitulo {
    margin: 0 auto;
}

.etiqueta-seccion {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--naranja);
    letter-spacing: .10em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.subtitulo {
    font-size: clamp(15px, 1.5vw, 17px);
    color: var(--tinta-2);
    font-weight: 400;
    line-height: 1.7;
    max-width: 560px;
}

/* Logo tipográfico */
.titulo-marca {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.0;
    margin: 14px 0 18px;
}

.marca-gris {
    color: var(--gris);
}

/* Cromo animado en "Partners" */
.marca-cromo {
    background: linear-gradient(105deg,
            #C46700 0%,
            #EF7D00 15%,
            #FFD080 28%,
            #EF7D00 40%,
            #8B4500 55%,
            #EF7D00 68%,
            #FFE8A0 80%,
            #EF7D00 90%,
            #C46700 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(239, 125, 0, .40));
    animation: barrido-cromo 15s linear infinite;
}

@keyframes barrido-cromo {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -100% 0;
    }
}


/*   GRILLA  */
.grilla-servicios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}


/*  ENVOLTURA DE TARJETA  */
.tarjeta-envoltura {
    perspective: 1200px;
    min-height: 340px;
    transition: height .40s cubic-bezier(.4, 0, .2, 1);
    will-change: height;
}


/*  TARJETA GIRATORIA  */
.tarjeta-giro {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform var(--duracion-giro) cubic-bezier(.34, 1.30, .64, 1);
    will-change: transform;
}

/* Tilt magnético vía CSS vars (valores aplicados por JS) */
.tarjeta-giro:not(.girada) {
    transform: perspective(800px) rotateX(var(--inclin-x, 0deg)) rotateY(var(--inclin-y, 0deg));
    transition: transform 1s cubic-bezier(.25, .8, .25, 1),
        box-shadow .4s ease;
}

.tarjeta-giro.girada {
    transform: rotate3d(1, 1, 0, 180deg) !important;
    transition: transform var(--duracion-giro) cubic-bezier(.34, 1.30, .64, 1) !important;
}


/*  CARAS BASE  */
.tarjeta-cara {
    position: absolute;
    inset: 0;
    border-radius: var(--radio-lg);
    padding: 32px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}


/*  FRENTE  */
.tarjeta-frente {
    background: var(--fondo-2);
    border: 1px solid var(--borde);
    transition: box-shadow .2s ease, border-color .2s ease;
}

.tarjeta-envoltura:hover .tarjeta-frente {
    box-shadow: var(--sombra-md);
    border-color: var(--naranja);
}

/* Variante oscura */
.tarjeta-giro.oscura .tarjeta-frente {
    background: var(--gris);
    border-color: transparent;
    color: #fff;
}

.tarjeta-giro.oscura .tarjeta-frente .etiqueta-tarjeta {
    color: rgba(255, 255, 255, .55);
}

.tarjeta-giro.oscura .tarjeta-frente .descripcion-frente {
    color: rgba(255, 255, 255, .65);
}

.tarjeta-giro.oscura .tarjeta-frente h3 {
    color: #fff;
}


/*  REVERSO  */
.tarjeta-reverso {
    background: linear-gradient(145deg, #2A1800 0%, #1C1008 100%);
    border: 1px solid rgba(239, 125, 0, .25);
    color: #fff;
    transform: rotate3d(1, 1, 0, 180deg);
}

/* Línea naranja superior que crece al abrir */
.tarjeta-reverso::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--naranja), var(--naranja-oscuro));
    border-radius: var(--radio-lg) var(--radio-lg) 0 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .50s cubic-bezier(.4, 0, .2, 1) .30s;
}

.tarjeta-envoltura.abierta .tarjeta-reverso::before {
    transform: scaleX(1);
}

.tarjeta-reverso .etiqueta-tarjeta {
    color: rgba(239, 125, 0, .75);
}

.tarjeta-reverso h3 {
    color: #fff;
    margin-bottom: 16px;
}


/*  ÍCONO */
.icono-servicio {
    width: 44px;
    height: 44px;
    background: var(--fondo-3);
    border-radius: var(--radio-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--naranja);
    flex-shrink: 0;
    transition: background .2s, color .2s, transform .2s;
}

.icono-servicio svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.tarjeta-giro.oscura .tarjeta-frente .icono-servicio {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.tarjeta-envoltura:hover .tarjeta-frente .icono-servicio {
    background: var(--naranja-suave);
    color: var(--naranja);
    transform: translateY(-3px) scale(1.08);
}

.tarjeta-envoltura:hover .tarjeta-giro.oscura .tarjeta-frente .icono-servicio {
    background: rgba(255, 255, 255, .20);
    color: #fff;
}


/*  ETIQUETA DE TARJETA  */
.etiqueta-tarjeta {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gris-medio);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}


/*  DESCRIPCIÓN FRENTE  */
.descripcion-frente {
    font-size: 14px;
    color: var(--tinta-2);
    line-height: 1.65;
    font-weight: 400;
    margin-top: 10px;
    flex: 1;
}


/*  CHIPS / ETIQUETAS  */
.grupo-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.etiqueta-chip {
    background: var(--naranja-suave);
    color: var(--naranja-oscuro);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 50px;
    border: 1px solid rgba(239, 125, 0, .20);
}

.tarjeta-giro.oscura .tarjeta-frente .etiqueta-chip {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .80);
    border-color: rgba(255, 255, 255, .15);
}


/*  BOTÓN LEER MÁS  */
.boton-leer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding: 9px 16px;
    border-radius: 50px;
    font-family: var(--fuente);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--borde-2);
    background: transparent;
    color: var(--tinta-2);
    transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
    align-self: flex-start;
    animation: pulso-boton 1.2s ease-in-out 2;
}

.boton-leer svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.boton-leer:hover {
    background: var(--naranja);
    border-color: var(--naranja);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 125, 0, .35);
}

.boton-leer:hover svg {
    animation: flecha-loop .5s ease forwards;
}

@keyframes flecha-loop {
    0% {
        transform: translateX(0);
    }

    40% {
        transform: translateX(5px);
    }

    70% {
        transform: translateX(-2px);
    }

    100% {
        transform: translateX(4px);
    }
}

@keyframes pulso-boton {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 125, 0, 0);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(239, 125, 0, .20);
    }
}

.tarjeta-giro.oscura .boton-leer {
    border-color: rgba(255, 255, 255, .28);
    color: rgba(255, 255, 255, .85);
}

.tarjeta-giro.oscura .boton-leer:hover {
    background: var(--naranja);
    border-color: var(--naranja);
    color: #fff;
}


/*  BOTÓN CERRAR  */
.boton-cerrar {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 125, 0, .15);
    border: 1px solid rgba(239, 125, 0, .35);
    color: var(--naranja);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, transform .2s;
    flex-shrink: 0;
}

.boton-cerrar:hover {
    background: var(--naranja);
    color: #fff;
    transform: rotate(90deg);
}

.boton-cerrar svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}


/*  LISTA DEL REVERSO  */
.lista-reverso {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 16px;
}

.lista-reverso li {
    font-size: 13.5px;
    color: rgba(255, 255, 255, .78);
    line-height: 1.55;
    padding-left: 20px;
    position: relative;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity .30s ease, transform .30s ease;
}

.lista-reverso li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--naranja);
    font-weight: 700;
    font-size: 12px;
}

.lista-reverso li strong {
    color: #fff;
    font-weight: 700;
}

/* Entrada escalonada al abrir */
.tarjeta-envoltura.abierta .lista-reverso li {
    opacity: 1;
    transform: translateX(0);
}

.tarjeta-envoltura.abierta .lista-reverso li:nth-child(1) {
    transition-delay: .35s;
}

.tarjeta-envoltura.abierta .lista-reverso li:nth-child(2) {
    transition-delay: .44s;
}

.tarjeta-envoltura.abierta .lista-reverso li:nth-child(3) {
    transition-delay: .53s;
}

.tarjeta-envoltura.abierta .lista-reverso li:nth-child(4) {
    transition-delay: .62s;
}

.tarjeta-envoltura.abierta .lista-reverso li:nth-child(5) {
    transition-delay: .71s;
}

.tarjeta-envoltura.abierta .lista-reverso li:nth-child(6) {
    transition-delay: .80s;
}

/* Reset instantáneo al cerrar */
.tarjeta-envoltura:not(.abierta) .lista-reverso li {
    transition: none;
}


/*  DESCRIPCIÓN DEL REVERSO  */
.descripcion-reverso {
    font-size: 13px;
    color: rgba(255, 255, 255, .45);
    line-height: 1.6;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(239, 125, 0, .18);
    opacity: 0;
    transition: opacity .30s ease .88s;
}

.tarjeta-envoltura.abierta .descripcion-reverso {
    opacity: 1;
}

.tarjeta-envoltura:not(.abierta) .descripcion-reverso {
    transition: none;
}


/*  REVELAR AL SCROLL  */
.revelar {
    opacity: 0;
    transform: translateY(24px) rotateX(8deg);
    transform-origin: top center;
    transition: opacity .65s ease, transform .65s ease;
}

.revelar.visible {
    opacity: 1;
    transform: none;
}

.revelar-d1 {
    transition-delay: .07s;
}

.revelar-d2 {
    transition-delay: .14s;
}

.revelar-d3 {
    transition-delay: .21s;
}

/* Encabezado: desplegado con scaleX */
.encabezado-seccion.revelar {
    transform: scaleX(.92) translateY(16px);
    transform-origin: center center;
}

.encabezado-seccion.revelar.visible {
    transform: none;
}


/*  RESPONSIVE  */
@media (max-width: 960px) {
    .grilla-servicios {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    #servicios {
        padding: 64px 0;
    }

    .grilla-servicios {
        grid-template-columns: 1fr;
    }

    .tarjeta-envoltura {
        min-height: 320px;
    }

    .tarjeta-giro:not(.girada) {
        transform: none !important;
    }
}