/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --danger-color: #ef4444;
    --success-color: #10b981;
}

/* Font Display Optimization - Soluciona los 30ms de FOIT */
* {
    font-display: swap !important;
}

/* Navbar Performance Optimization - Prevent Forced Reflow */
.navbar {
    transition: background-color 0.3s ease !important;
    will-change: background-color;
}

.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
}

.navbar-transparent {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* CLS Prevention - Elimina Layout Shifts */
.service-card {
    min-height: 280px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-icon {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 20px !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-item {
    min-height: 220px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
}

.feature-icon {
    width: 60px !important;
    height: 60px !important;
    margin: 0 auto 15px !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.services-section {
    min-height: 800px !important;
}

.features-section {
    min-height: 600px !important;
}

.cta-section {
    min-height: 400px !important;
}

/* Prevenir shifts en títulos */
.display-5 {
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
}

/* Estabilizar grid */
.row.g-4 > * {
    padding-bottom: 1.5rem;
}

/* Específico para Font Awesome - Elimina el Flash of Invisible Text */
.fa, .fab, .fad, .fal, .far, .fas {
    font-display: swap;
    width: auto;
    height: auto;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Navigation Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Enhanced navbar spacing & hover underline */
.navbar-nav .nav-link {
    padding: 0.65rem 1.05rem;
    margin: 0 0.25rem;
    position: relative;
    border-radius: 30px;
    line-height: 1.1;
}
.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width .28s ease;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 60%;
}

/* Active & hover background pill */
.navbar-nav .nav-link:hover {
    background: rgba(37,99,235,0.08);
}
.navbar-nav .nav-link.active {
    background: var(--primary-color);
    color: #fff !important;
    box-shadow: 0 4px 12px -2px rgba(37,99,235,0.35);
}
.navbar-nav .nav-link.active:hover {
    background: var(--secondary-color);
}

/* Keyboard focus ring */
.navbar-nav .nav-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Slightly more gap using flex gap if supported */
.navbar-nav { gap: 0.15rem; }

/* Page Header */
.page-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(30, 64, 175, 0.9)), url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1920&h=600&fit=crop') center/cover;
    padding: 150px 0 100px;
    color: white;
    text-align: center;
}

/* Repairs Section */
.repairs-section {
    padding: 60px 0 40px 0;
}

.repair-card {
    background: white;
    border-radius: 15px;
    padding: 20px 16px 16px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    transition: transform 0.35s cubic-bezier(.4,1.4,.6,1), box-shadow 0.35s cubic-bezier(.4,1.4,.6,1);
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Borde sutil azul en todo el contorno */
    border: 1px solid rgba(37,99,235,0.25);
    margin-bottom: 10px;
}

.repair-card:hover {
    /* Solo refuerza levemente el borde, sin animación de desplazamiento */
    border-color: var(--primary-color);
    box-shadow: 0 4px 18px rgba(37,99,235,0.10), 0 2px 6px rgba(0,0,0,0.04);
    transform: none;
    transition: border-color .25s ease, box-shadow .25s ease;
}

/* Accordion Styles */
.accordion-item {
    border: none;
    margin-bottom: 10px;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.accordion-button {
    background: #f8fafc;
    border: none;
    padding: 15px 20px;
    font-weight: 500;
    color: var(--text-dark);
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-body {
    padding: 20px;
    background: white;
}

/* Solution Steps */
.solution-steps {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    counter-reset: step-counter;
}

.solution-steps li {
    padding: 10px 0;
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
    margin-bottom: 10px;
    position: relative;
}

.solution-steps li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    background: var(--primary-color);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    position: absolute;
    left: -12px;
    top: 10px;
}

/* Problem Icons and Badges */
.problem-icon {
    color: var(--danger-color);
    margin-right: 10px;
    font-size: 1.1rem;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

.difficulty-easy {
    background: #dcfce7;
    color: #166534;
}

.difficulty-medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-hard {
    background: #fee2e2;
    color: #991b1b;
}

/* Alert Styles */
.warning-alert {
    background: #fef3c7;
    color: #92400e;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    margin: 15px 0;
    font-size: 0.9rem;
}

.alert-custom {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    border-radius: 10px;
}

/* Diagnostic Section */
.diagnostic-section {
    background: var(--bg-light);
    padding: 80px 0;
}

.diagnostic-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.diagnostic-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 2rem;
}

/* CTA Section */
.cta-section {
    background: var(--primary-color);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.btn-primary-custom {
    background: var(--accent-color);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    color: white;
}

.btn-primary-custom:hover {
    background: #d97706;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

/* WhatsApp CTA button (hero) */
.whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    border: none;
    padding: 15px 26px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    box-shadow: 0 10px 25px rgba(18, 140, 126, 0.35);
    margin-left: 15px;
    transition: all .3s ease;
}
.whatsapp-btn i { font-size: 1.2rem; }
.whatsapp-btn:hover {
    background: linear-gradient(135deg, #1ebe5a, #0f6d60);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(18, 140, 126, 0.45);
    color:#fff;
}
.whatsapp-btn:active { transform: translateY(0); box-shadow: 0 6px 18px rgba(18,140,126,0.3); }

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 50px 0 30px;
}

.footer h5 {
    color: var(--accent-color);
    margin-bottom: 20px;
}

.footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--accent-color);
}

/* Footer credit link override (solo frandoweb azul) */
.footer .site-credit a {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.footer .site-credit a:hover {
    color: var(--secondary-color) !important;
    text-decoration: underline;
}

/* ============ GLOBAL SECTIONS (Centralizados) ============ */
/* Hero (Home) */
.hero-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(30, 64, 175, 0.9)), url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1920&h=1080&fit=crop') center/cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    padding-top: 90px;
}

.hero-section .hero-content h1 { font-size: 3.5rem; font-weight:700; line-height:1.15; }
.hero-section .hero-content p { font-size:1.25rem; opacity:.9; }

/* Generic Sections */
.services-section, .features-section, .service-detail, .faq-section, .brands-section, .about-section,
.values-section, .team-section, .contact-section { padding: 80px 0; }

/* Cards */
.service-card, .value-card, .featured-brand-card, .contact-card, .diagnostic-card { background:#fff; border-radius:15px; padding:40px 30px; box-shadow:0 10px 30px rgba(0,0,0,.1); transition:.3s; height:100%; }
.service-card:hover, .value-card:hover, .featured-brand-card:hover, .contact-card:hover { transform:translateY(-5px); box-shadow:0 20px 40px rgba(0,0,0,.15); }

/* Icons */
.service-icon, .value-icon, .diagnostic-icon { width:80px; height:80px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 20px; font-size:2rem; color:#fff; }
.service-icon { background: var(--primary-color); }
.value-icon { background: var(--accent-color); }

/* Feature / Brand / Misc */
.feature-item { text-align:center; padding:30px 20px; }
.feature-icon { width:60px; height:60px; border-radius:50%; background:var(--accent-color); color:#fff; display:flex; align-items:center; justify-content:center; margin:0 auto 20px; }
.brand-card { background:#fff; border-radius:15px; padding:30px 20px; text-align:center; box-shadow:0 5px 20px rgba(0,0,0,.08); transition:.3s; height:100%; border:2px solid transparent; }
.brand-card:hover { transform:translateY(-5px); box-shadow:0 15px 30px rgba(0,0,0,.15); border-color:var(--primary-color); }
.featured-brands { background: var(--bg-light); padding:80px 0; }
.featured-brand-card { border-radius:20px; }
.featured-icon { width:100px; height:100px; background:var(--primary-color); color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:3rem; margin:0 auto 30px; }
.highlight-text { background: linear-gradient(120deg, var(--accent-color) 0%, var(--accent-color) 100%); background-repeat:no-repeat; background-size:100% 0.2em; background-position:0 88%; padding:0 4px; }

/* FAQ Accordion */
.accordion-item { border:none; margin-bottom:15px; border-radius:10px !important; overflow:hidden; box-shadow:0 3px 10px rgba(0,0,0,.08); }
.accordion-button { font-weight:600; font-size:1.05rem; padding:18px 20px; background:#fff; color:var(--text-dark); }
.accordion-button:not(.collapsed) { background:var(--primary-color); color:#fff; }
.accordion-button:focus { box-shadow:none; }
.accordion-body { padding:25px; background:var(--bg-light); line-height:1.7; }

/* Contact specific */
.contact-card { text-align:center; }
.contact-icon { width:80px; height:80px; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 20px; color:#fff; font-size:2rem; }
.whatsapp-card { background: linear-gradient(135deg, #25d366, #128c7e); color:#fff; }
.whatsapp-card .contact-icon { background:#fff; color:#25d366; }
/* Coverage Section Styles */
.coverage-section {
    padding: 80px 0;
}

.coverage-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 3px 15px rgba(0,0,0,.08);
    transition: all .3s ease;
    border: 1px solid #e9ecef;
}

.coverage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
}

.coverage-header {
    text-align: center;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 20px;
}

.coverage-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 1.5rem;
}

.coverage-list ul {
    margin: 0;
    padding: 0;
}

.coverage-list li {
    padding: 5px 0;
    font-weight: 500;
    color: #495057;
    transition: color .2s ease;
}

.coverage-list li:hover {
    color: var(--primary-color);
}

.coverage-list .fa-check-circle {
    font-size: 0.9rem;
}

/* Responsive adjustments for coverage */
@media (max-width: 768px) {
    .coverage-card {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .coverage-list .col-md-6 {
        margin-bottom: 20px;
    }
}

/* Stats */
.stat-item { text-align:center; padding:30px 20px; }
.stat-number { font-size:3rem; font-weight:700; color:var(--primary-color); display:block; }
.stat-label { font-size:1.05rem; color:var(--text-light); margin-top:8px; }

/* Scroll / Floating reuse already defined for whatsapp & scroll */

/* CTA Section unified (already exists) */

/* ============ PAGE HEADER variantes por página ============ */
.page-header { padding:150px 0 100px; color:#fff; text-align:center; position:relative; }
.page-header-servicios { background: linear-gradient(135deg, rgba(37,99,235,.9), rgba(30,64,175,.9)), url('https://images.unsplash.com/photo-1581578731548-c64695cc6952?w=1920&h=600&fit=crop') center/cover; }
.page-header-contacto { background: linear-gradient(135deg, rgba(37,99,235,.9), rgba(30,64,175,.9)), url('https://images.unsplash.com/photo-1596524430615-b46475ddff6e?w=1920&h=600&fit=crop') center/cover; }
.page-header-faq { background: linear-gradient(135deg, rgba(37,99,235,.9), rgba(30,64,175,.9)), url('https://images.unsplash.com/photo-1516321497487-e288fb19713f?w=1920&h=600&fit=crop') center/cover; }
.page-header-marcas { background: linear-gradient(135deg, rgba(37,99,235,.9), rgba(30,64,175,.9)), url('https://images.unsplash.com/photo-1556909114-f6e7ad7d3136?w=1920&h=600&fit=crop') center/cover; }
.page-header-nosotros { background: linear-gradient(135deg, rgba(37,99,235,.9), rgba(30,64,175,.9)), url('https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=1920&h=600&fit=crop') center/cover; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-section .hero-content h1 { font-size:2.4rem; }
    .hero-section .hero-content p { font-size:1.05rem; }
    .btn-primary-custom, .whatsapp-btn { display:block; width:100%; text-align:center; margin-left:0 !important; }
    .whatsapp-btn { margin-top:15px; }
    .service-card, .value-card, .featured-brand-card, .contact-card { padding:32px 26px; }

    .floating-whatsapp, .floating-scrollup {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        bottom: 15px;
    }
    .floating-whatsapp { right: 15px; }
    .floating-scrollup { left: 15px; }
}

/* Floating Buttons */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-whatsapp:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
}

.floating-scrollup {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #2563eb;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    will-change: opacity, visibility, transform;
    pointer-events: none;
}

.floating-scrollup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.floating-scrollup:hover {
    background: #1e40af;
    color: white;
    transform: translateY(-2px) scale(1.05);
}