/* ============================================================
   AutoListo — Taller Exprés
   Hoja de estilos principal
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --azul:      oklch(30% 0.097 254);
    --azul-dark: oklch(21% 0.073 254);
    --azul-light:oklch(40% 0.122 254);
    --rojo:      oklch(51.5% 0.234 27);
    --rojo-dark: oklch(44% 0.213 27);

    --gris-100: oklch(97.8% 0.006 254);
    --gris-200: oklch(93.5% 0.009 254);
    --gris-300: oklch(88% 0.013 254);
    --gris-500: oklch(58% 0.018 254);
    --gris-800: oklch(26% 0.027 254);
    --gris-900: oklch(17% 0.022 254);
    --blanco:   oklch(99% 0.004 254);

    --font-display: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 20px oklch(30% 0.097 254 / 0.08);
    --shadow-lg: 0 10px 40px oklch(30% 0.097 254 / 0.16);
    --transition: all 0.3s ease;
}

/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--gris-800);
    line-height: 1.65;
    background: var(--blanco);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--azul);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--rojo);
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--azul);
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.accent {
    color: var(--rojo);
}

/* ---------- Header ---------- */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--azul);
}

.logo img {
    height: 44px;
    width: auto;
}

.logo-text {
    color: var(--azul);
}

.logo-accent {
    color: var(--rojo);
}

.nav ul {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav a {
    font-weight: 600;
    color: var(--gris-800);
    font-size: 0.95rem;
    position: relative;
}

.nav a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    left: 0; bottom: -6px;
    width: 0; height: 2px;
    background: var(--rojo);
    transition: var(--transition);
}

.nav a:not(.btn-nav):hover::after {
    width: 100%;
}

.btn-nav {
    background: var(--rojo);
    color: white !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 700;
}

.btn-nav:hover {
    background: var(--rojo-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--azul);
    border-radius: 2px;
    transition: var(--transition);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, oklch(21% 0.073 254 / 0.93) 0%, oklch(30% 0.097 254 / 0.82) 100%),
        url('assets/img/img1.jpeg') center / cover no-repeat;
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 15%, oklch(51.5% 0.234 27 / 0.22) 0%, transparent 48%),
        radial-gradient(circle at 15% 80%, oklch(40% 0.122 254 / 0.35) 0%, transparent 48%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-text {
    max-width: 720px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    color: white;
    margin-bottom: 24px;
    font-weight: 900;
}

.hero h1 .accent {
    color: #ff6b6b;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 36px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    line-height: 1;
}

.stat span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--rojo);
    color: white;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

.btn-primary:hover {
    background: var(--rojo-dark);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.45);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
    background: white;
    color: var(--azul);
    border-color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ---------- Secciones generales ---------- */
.section {
    padding: 100px 0;
}

.section.bg-light {
    background: var(--gris-100);
}

.section.bg-dark {
    background: linear-gradient(135deg, var(--azul-dark) 0%, var(--azul) 100%);
    color: white;
}

.section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 60px;
}

.section-tag {
    display: inline-block;
    background: rgba(220, 38, 38, 0.1);
    color: var(--rojo);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.section-head h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 16px;
}

.section-head p {
    color: var(--gris-500);
    font-size: 1.1rem;
}

.section-head.light h2 { color: white; }
.section-head.light .section-tag { background: rgba(255,255,255,0.1); color: white; }

/* ---------- Servicios ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.service-card {
    background: white;
    border: 1px solid var(--gris-200);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--azul) 0%, var(--rojo) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-light) 100%);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--rojo) 0%, var(--rojo-dark) 100%);
    transform: rotate(-5deg) scale(1.05);
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--gris-500);
    font-size: 0.95rem;
}

/* ---------- Features ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.feature {
    text-align: center;
    color: white;
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid oklch(99% 0.004 254 / 0.06);
    transition: background 0.35s ease, border-color 0.35s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.feature:hover {
    background: oklch(99% 0.004 254 / 0.06);
    border-color: oklch(99% 0.004 254 / 0.14);
}

.feature i {
    font-size: 2.5rem;
    color: var(--rojo);
    margin-bottom: 16px;
    background: oklch(51.5% 0.234 27 / 0.14);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
    z-index: 2;
}

.feature:hover i {
    transform: scale(1.08);
    background: oklch(51.5% 0.234 27 / 0.22);
}

.feature h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.feature p {
    color: oklch(99% 0.004 254 / 0.72);
    font-size: 0.95rem;
    position: relative;
    z-index: 2;
}

/* ---------- Galería ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    grid-auto-rows: 270px;
    gap: 14px;
    margin-bottom: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--gris-200);
    cursor: pointer;
    isolation: isolate;
}

.gallery-item.gi-tall { grid-row: span 2; }
.gallery-item.gi-wide { grid-column: span 2; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.07);
}

.gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, oklch(17% 0.022 254 / 0.82) 0%, transparent 100%);
    color: var(--blanco);
    padding: 28px 16px 14px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 3;
}

.gallery-item:hover .gallery-label {
    transform: translateY(0);
}

.gallery-note {
    text-align: center;
    color: var(--gris-500);
    margin-top: 30px;
}

.gallery-note i {
    color: var(--rojo);
    margin-right: 6px;
}

/* ---------- Testimonios ---------- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.testimonial {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.testimonial:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.stars {
    color: #FBBF24;
    margin-bottom: 16px;
    font-size: 1rem;
}

.testimonial p {
    color: var(--gris-800);
    font-style: italic;
    margin-bottom: 24px;
    line-height: 1.7;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--gris-200);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--azul) 0%, var(--rojo) 100%);
    color: white;
    font-family: var(--font-display);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.testimonial-author strong {
    display: block;
    color: var(--azul);
}

.testimonial-author span {
    color: var(--gris-500);
    font-size: 0.85rem;
}

/* ---------- Contacto ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 48px;
    align-items: start;
}

.contact-info {
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 40px;
}

.contact-info h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 28px;
}

.info-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.info-item i {
    color: var(--rojo);
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    background: rgba(220, 38, 38, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-display);
}

.info-item p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
}

.info-item a {
    color: rgba(255, 255, 255, 0.9);
}

.info-item a:hover {
    color: white;
}

.btn-como-llegar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 14px;
    border: 1px solid rgba(220, 38, 38, 0.5);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-como-llegar:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: var(--rojo);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.social-links a {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--rojo);
    transform: translateY(-3px);
}

/* ---------- Formulario ---------- */
.contact-form {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gris-200);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gris-800);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gris-200);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group.checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

.form-group.checkbox input {
    width: auto;
    margin-top: 4px;
}

.form-msg {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-msg.ok {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.form-msg.err {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ---------- Mapa ---------- */
.map-section {
    line-height: 0;
}

.map-section iframe {
    display: block;
    filter: grayscale(20%);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--gris-900);
    color: rgba(255, 255, 255, 0.7);
    padding: 70px 0 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer h5 {
    color: white;
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 12px;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul a, .footer ul li {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.footer ul a:hover {
    color: var(--rojo);
}

.footer-col i {
    color: var(--rojo);
    margin-right: 8px;
    width: 16px;
}

.footer-col .logo-text { color: white; font-size: 1.5rem; }

.footer .social-links {
    justify-content: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.footer-col:nth-child(4) {
    text-align: center;
}

.footer-col:nth-child(4) h5 {
    text-align: center;
}

.footer .social-links a {
    background: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 22px 0;
    text-align: center;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p, .footer-bottom a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.footer-bottom a:hover {
    color: var(--rojo);
}

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background: #128C7E;
    transform: scale(1.1) rotate(8deg);
    color: white;
}

.wa-tooltip {
    position: absolute;
    right: 75px;
    background: var(--gris-900);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    white-space: nowrap;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.whatsapp-float:hover .wa-tooltip {
    opacity: 1;
    right: 80px;
}

@keyframes pulse {
    0% { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4), 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- Animaciones scroll ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 70px);
        background: white;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        padding: 30px 24px;
        transition: right 0.3s ease;
    }

    .nav.open {
        right: 0;
    }

    .nav ul {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .section {
        padding: 70px 0;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat strong {
        font-size: 1.6rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 200px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-info,
    .contact-form {
        padding: 28px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer .social-links {
        justify-content: center;
    }

    .footer-bottom .container {
        flex-direction: column;
        text-align: center;
    }

    .whatsapp-float {
        width: 54px;
        height: 54px;
        font-size: 1.6rem;
        bottom: 20px;
        right: 20px;
    }

    .wa-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
    .gallery-item.gi-tall { grid-row: auto; }
    .gallery-item.gi-wide { grid-column: auto; }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   EFECTO RAYO ⚡ — Lightning hover effect
   Rayo SVG con degradado azul → blanco → rojo que cruza la
   tarjeta al pasar por encima, con parpadeo realista.
   ============================================================ */

.service-card,
.testimonial,
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Capa del rayo (SVG embebido como background) */
.service-card::after,
.testimonial::after,
.btn-primary::after,
.gallery-item::after,
.feature::after {
    content: '';
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 220' preserveAspectRatio='xMidYMid meet'><defs><linearGradient id='boltGrad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'><stop offset='0%25' stop-color='%231B3A6B'/><stop offset='45%25' stop-color='%23FFFFFF'/><stop offset='100%25' stop-color='%23DC2626'/></linearGradient><filter id='glow' x='-50%25' y='-50%25' width='200%25' height='200%25'><feGaussianBlur stdDeviation='2.5' result='b'/><feMerge><feMergeNode in='b'/><feMergeNode in='SourceGraphic'/></feMerge></filter></defs><path d='M34,4 L18,96 L36,96 L20,216 L42,108 L26,108 Z' fill='url(%23boltGrad)' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round' filter='url(%23glow)'/></svg>");
    background-repeat: no-repeat;
    background-size: auto 130%;
    background-position: -30% center;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    will-change: transform, opacity, background-position;
}

.service-card:hover::after,
.testimonial:hover::after,
.btn-primary:hover::after,
.gallery-item:hover::after,
.feature:hover::after {
    animation: lightning-strike 0.9s ease-out forwards;
}

@keyframes lightning-strike {
    0% {
        opacity: 0;
        background-position: -30% center;
        filter: brightness(1);
    }
    8% {
        opacity: 1;
        filter: brightness(1.6) drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
    }
    15% {
        opacity: 0.2;
    }
    22% {
        opacity: 1;
        filter: brightness(2) drop-shadow(0 0 14px rgba(220, 38, 38, 0.8));
    }
    30% {
        opacity: 0.5;
    }
    40% {
        opacity: 1;
        filter: brightness(1.6) drop-shadow(0 0 10px rgba(27, 58, 107, 0.9));
    }
    100% {
        opacity: 0;
        background-position: 130% center;
        filter: brightness(1);
    }
}

/* Flash de fondo sutil que acompaña al rayo */
.service-card::before {
    z-index: 1;
}

.service-card:hover,
.testimonial:hover,
.gallery-item:hover {
    animation: card-flash 0.9s ease-out;
}

@keyframes card-flash {
    0%, 100% {
        box-shadow: var(--shadow);
    }
    10% {
        box-shadow: 0 0 30px rgba(27, 58, 107, 0.6), 0 10px 40px rgba(27, 58, 107, 0.15);
    }
    25% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.8), 0 10px 40px rgba(27, 58, 107, 0.15);
    }
    40% {
        box-shadow: 0 0 35px rgba(220, 38, 38, 0.6), 0 10px 40px rgba(27, 58, 107, 0.15);
    }
}

/* Botón primario: brillo cíclico azul-blanco-rojo en el borde */
.btn-primary {
    background-image: linear-gradient(135deg, var(--rojo) 0%, var(--rojo-dark) 100%);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(
        90deg,
        var(--azul) 0%,
        #ffffff 50%,
        var(--rojo) 100%
    );
    background-size: 200% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 3;
}

.btn-primary:hover::before {
    opacity: 1;
    animation: btn-color-cycle 1.8s linear infinite;
}

@keyframes btn-color-cycle {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Respeta a quien prefiere menos animación */
@media (prefers-reduced-motion: reduce) {
    .service-card::after,
    .testimonial::after,
    .btn-primary::after,
    .gallery-item::after,
    .feature::after {
        display: none;
    }
    .service-card:hover,
    .testimonial:hover,
    .gallery-item:hover,
    .feature:hover,
    .btn-primary:hover {
        animation: none;
    }
}
