@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Manrope:wght@200..800&display=swap');

/* ════════════════════════════════════════
   VARIABLES
════════════════════════════════════════ */
:root {
    --burdeos: #800020;
    --burdeos-light: #a30029;
    --burdeos-dark: #6a0000;
    --amarillo: #FFCC00;
    --blanco: #FFFFFF;
    --gris-claro: #f8f9fa;
    --gris-oscuro: #1a1a1a;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Manrope', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* ════════════════════════════════════════
   RESET
════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--gris-oscuro);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--blanco);
}

/* ════════════════════════════════════════
   NAVBAR
════════════════════════════════════════ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 2rem;
    transition: var(--transition);
}

.navbar.scrolled {
    background: var(--burdeos);
    padding: 0.8rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

.nav-right { justify-content: flex-end; }

.nav-container a {
    text-decoration: none;
    font-weight: 700;
    color: var(--blanco);
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.nav-container a:hover { color: var(--amarillo); }

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--amarillo) !important;  /* Madrid = yellow */
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    white-space: nowrap;
}

/* ELECTRICISTAS = white */
.logo b {
    color: #ffffff;
    font-weight: 800;
    margin-right: 4px;
    font-size: 0.78em;
    letter-spacing: 0.04em;
}

/* RUEDA = burdeos */
.logo span { color: var(--burdeos); }

/* On scrolled burdeos navbar: lighten RUEDA so it's visible */
.navbar.scrolled .logo span { color: #ff6680; }

/* ════════════════════════════════════════
   CTA BUTTONS
════════════════════════════════════════ */
.cta-button {
    background: var(--amarillo);
    color: var(--burdeos) !important;
    padding: 0.7rem 1.5rem;
    border-radius: 0;
    font-weight: 800 !important;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    transition: var(--transition);
}

.cta-button:hover {
    background: #e6b800;
}

/* Dark CTA — white text on burdeos background */
.cta-button-dark {
    background: var(--burdeos);
    color: #ffffff !important;
    padding: clamp(12px, 2vw, 18px) clamp(24px, 5vw, 48px);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 800 !important;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.3s ease;
    border-radius: 0;
    white-space: nowrap;
}

.cta-button-dark:hover { background: var(--burdeos-dark); }

/* Legacy aliases used in some pages */
.cta-button-white,
.cta-button-burdeos {
    background: var(--burdeos);
    color: #ffffff !important;
    padding: clamp(12px, 2vw, 18px) clamp(24px, 5vw, 48px);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 800 !important;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.3s ease;
    border-radius: 0;
    white-space: nowrap;
}

.cta-button-white:hover,
.cta-button-burdeos:hover { background: var(--burdeos-dark); }

.cta-center {
    text-align: center;
    margin-top: 40px;
}

/* ════════════════════════════════════════
   HAMBURGER BUTTON
════════════════════════════════════════ */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--blanco);
    border-radius: 1px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                width 0.3s ease;
    transform-origin: center;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ════════════════════════════════════════
   MOBILE MENU OVERLAY
════════════════════════════════════════ */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--burdeos);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    clip-path: circle(0% at calc(100% - 48px) 48px);
    transition: clip-path 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.mobile-menu.open {
    clip-path: circle(150% at calc(100% - 48px) 48px);
    pointer-events: all;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.mobile-nav-item {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.7rem 2rem;
    width: 100%;
    text-align: center;
    transition: color 0.2s, background 0.2s, opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.mobile-menu.open .mobile-nav-item { opacity: 1; transform: translateY(0); }
.mobile-menu.open .mobile-nav-item:nth-child(1) { transition-delay: 0.10s; }
.mobile-menu.open .mobile-nav-item:nth-child(2) { transition-delay: 0.16s; }
.mobile-menu.open .mobile-nav-item:nth-child(3) { transition-delay: 0.22s; }
.mobile-menu.open .mobile-nav-item:nth-child(4) { transition-delay: 0.28s; }
.mobile-menu.open .mobile-nav-item:nth-child(5) { transition-delay: 0.34s; }

.mobile-nav-item:hover {
    color: var(--blanco);
    background: rgba(255, 255, 255, 0.07);
}

.mobile-nav-item.mobile-cta {
    background: var(--amarillo);
    color: var(--burdeos) !important;
    width: auto;
    padding: 0.85rem 2.5rem;
    margin-top: 0.75rem;
    font-size: 1rem;
}

/* ════════════════════════════════════════
   HERO
════════════════════════════════════════ */
.hero {
    height: 100vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 10vw, 6rem);
    font-weight: 800;
    color: white;
    text-align: center;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.divider {
    height: 5px;
    width: 80px;
    background: var(--amarillo);
    margin: 25px auto;
}

/* ════════════════════════════════════════
   BG SECTIONS  (index / generic pages)
════════════════════════════════════════ */
.bg-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
}

/* ════════════════════════════════════════
   SERVICE PAGES — hero & sections
════════════════════════════════════════ */
.service-hero {
    background-attachment: scroll;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    padding: clamp(90px, 12vw, 140px) clamp(12px, 3vw, 20px) clamp(50px, 7vw, 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-section {
    background-attachment: scroll;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    padding: clamp(40px, 7vw, 90px) clamp(12px, 3vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-intro {
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.15rem);
    margin: 0 auto 40px;
    max-width: 780px;
}

/* ════════════════════════════════════════
   SECTION CARD
════════════════════════════════════════ */
.section-card {
    background: rgba(255, 255, 255, 0.95);
    max-width: 1100px;
    width: 100%;
    padding: 60px;
    border-radius: 0;
    box-shadow: var(--shadow);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 3rem);
    color: var(--burdeos);
    margin-bottom: 2.5rem;
    text-align: center;
    font-weight: 800;
}

/* ════════════════════════════════════════
   GRIDS / SERVICE CARDS
════════════════════════════════════════ */
.grid-centered {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

.grid-centered > * {
    flex: 1;
    min-width: 250px;
    max-width: 320px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.service-card {
    background: #fff;
    padding: 25px;
    border-radius: 0;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 160px;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--amarillo);
    border-bottom-color: var(--amarillo);
    box-shadow: 0 20px 40px rgba(128, 0, 32, 0.18);
}

.service-card h3 {
    color: var(--burdeos);
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.service-card p {
    font-size: 0.9rem;
    color: #666;
}

/* ════════════════════════════════════════
   BADGE / TAG UTILITIES
════════════════════════════════════════ */
.alert-tag,
.check-tag {
    display: inline-block;
    background: var(--burdeos);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.stat-badge {
    display: inline-block;
    background: var(--burdeos);
    color: #fff;
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    font-weight: 800;
    padding: 8px 16px;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.step-icon {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 900;
    color: var(--burdeos);
    margin-bottom: 12px;
}

/* ════════════════════════════════════════
   ARTICLE / BLOG CONTENT
════════════════════════════════════════ */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    color: var(--burdeos);
    margin-top: 30px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 30px;
}

.warning-box {
    background: #fff5f5;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #e53e3e;
    margin: 30px 0;
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer {
    background: var(--gris-oscuro);
    color: var(--blanco);
    padding: 80px 0 0 0;
    font-family: var(--font-body);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding: 0 40px 60px 40px;
}

.footer-column h3 {
    font-family: var(--font-heading);
    color: var(--amarillo);
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 20px;
    max-width: 300px;
}

.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 12px; }

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-column ul li a:hover {
    color: var(--amarillo);
    padding-left: 5px;
}

.footer-phone {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--blanco);
    text-decoration: none;
    display: block;
    margin-top: 10px;
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.footer-bottom {
    background: #111;
    padding: 30px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

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

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-legal a:hover { color: var(--amarillo); }

/* ════════════════════════════════════════
   RESPONSIVE — BREAKPOINTS
════════════════════════════════════════ */

/* ── Tablet grande / landscape ≤ 1200px ── */
@media (max-width: 1200px) {
    .nav-container a { font-size: 0.8rem; }
    .nav-left, .nav-right { gap: 1.2rem; }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

/* ── Tablet ≤ 992px ── */
@media (max-width: 992px) {
    .nav-left,
    .nav-right { display: none; }

    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-toggle { display: flex; }

    .bg-section,
    .hero {
        background-attachment: scroll;
    }

    .section-card { padding: 40px 28px; }

    .section-title {
        font-size: clamp(1.5rem, 4vw, 2.2rem);
        margin-bottom: 1.8rem;
    }

    .grid-centered > * {
        min-width: 200px;
        max-width: 280px;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        padding: 0 32px 48px 32px;
    }
}

/* ── Mobile grande ≤ 768px ── */
@media (max-width: 768px) {
    .navbar { padding: 0.9rem 1.25rem; }
    .navbar.scrolled { padding: 0.65rem 1.25rem; }

    .logo { font-size: 1.45rem; }

    /* Hero */
    .hero {
        height: auto;
        min-height: 85vh;
        padding: 110px 16px 56px;
        background-attachment: scroll;
        text-align: center;
    }

    .hero h1 { font-size: clamp(2rem, 10vw, 3rem); }

    .divider { width: 50px; margin: 16px auto; }

    /* BG Sections */
    .bg-section {
        min-height: auto;
        padding: 48px 12px;
        background-attachment: scroll;
    }

    /* Service hero & sections */
    .service-hero {
        padding: 90px 12px 40px;
    }

    .service-section {
        padding: 40px 12px;
    }

    /* Cards */
    .section-card {
        padding: 28px 16px;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    }

    .section-title {
        font-size: clamp(1.3rem, 6vw, 1.7rem);
        margin-bottom: 1.2rem;
    }

    /* Grids → single column */
    .grid-3,
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .grid-centered {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .grid-centered > * {
        min-width: unset;
        max-width: unset;
        flex: unset;
    }

    .service-card {
        min-height: auto;
        padding: 22px 18px;
    }

    .cta-center { margin-top: 28px; }

    .service-intro { margin-bottom: 28px; }

    /* Footer */
    .footer { padding: 40px 0 0; }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 0 20px 36px 20px;
    }

    .footer-column h3 { font-size: 1.05rem; margin-bottom: 14px; }
    .footer-column p { font-size: 0.9rem; }
    .footer-phone { font-size: 1.35rem; }

    .footer-bottom { padding: 22px 20px; }

    .footer-bottom-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .footer-legal { flex-wrap: wrap; justify-content: center; gap: 10px; }

    /* Article image */
    .article-image { height: 240px; }
}

/* ── Mobile pequeño ≤ 480px ── */
@media (max-width: 480px) {
    .logo { font-size: 1.2rem; }

    .hero { min-height: 80vh; padding: 100px 12px 44px; }
    .hero h1 { font-size: clamp(1.9rem, 10vw, 2.6rem); }
    .hero p { font-size: 1rem !important; }

    .section-card { padding: 22px 12px; }
    .section-title { font-size: clamp(1.2rem, 7vw, 1.5rem); }

    .service-card { padding: 18px 14px; }
    .service-card h3 { font-size: 1rem; }

    .cta-button-dark,
    .cta-button-white,
    .cta-button-burdeos {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 0.9rem;
    }

    .mobile-nav-item { font-size: 1.35rem; }

    .article-image { height: 180px; }
}

/* ── Fix iOS: parallax y 100vh ── */
@supports (-webkit-touch-callout: none) {
    .hero {
        height: 100svh;
        background-attachment: scroll;
    }

    .bg-section,
    .service-hero,
    .service-section {
        background-attachment: scroll;
    }
}