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

:root {
    --color-base-fuerte: #162336;
    --color-base-medio: #23334b;
    --color-base-bajo: #b9c3d3;

    /* Paleta de Colores Básica */
    --white: #ffffff;
    --white-soft: #fffcf7;
    --white-warm: #fffaf0;

    /* Variables Nuevas/Unificadas basadas en el diseño */
    --bg-main: #f8fbff;
    --bg-main-dark: #e7edf7;
    --line: #cfc6b9;
    --surface: #ffffff;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;

    /* Marca & Identidad (Valores deducidos de los degradados) */
    --primary: #8d1f18;
    --primary-dark: #041a35;
    --accent: #0f5f3d;
    --muted: #70685c;

    /* Textos */
    --ink: #202020;
    --ink-soft: #202020;
    --ink-light: #393939;

    /* Estados */
    --success: #0f5f3d;
    --success-bg: #dff6ea;
    --success-border: #a7dfc3;

    /* Errores */
    --error: #7f201b;
    --error-bg: #fde8e7;
    --error-border: #f3b8b3;

    /* Fondos auxiliares */
    --surface-accent: #eaf5f3;
    --surface-muted: #e8dfd2;
    --line-input: #cfc6b9;

    /* Overlays */
    --overlay-dark: rgba(15, 12, 11, 0.84);
    --overlay-medium: rgba(35, 31, 29, 0.56);
    --overlay-light: rgba(17, 17, 17, 0.4);

    /* Opacidades White */
    --white-05: rgba(255, 255, 255, 0.05);
    --white-06: rgba(255, 255, 255, 0.06);
    --white-08: rgba(255, 255, 255, 0.08);
    --white-13: rgba(255, 255, 255, 0.13);
    --white-30: rgba(255, 255, 255, 0.30);
    --white-50: rgba(255, 255, 255, 0.50);
    --white-82: rgba(255, 255, 255, 0.82);
    --white-88: rgba(255, 255, 255, 0.88);

    /* Sombras */
    --shadow-dark: rgba(24, 24, 24, 0.08);
    --shadow-primary: rgba(4, 26, 53, 0.30);
    --shadow-whatsapp: rgba(14, 143, 92, 0.36);
    --shadow-soft: rgba(24, 24, 24, 0.04);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', sans-serif;
    background: radial-gradient(circle at top left, var(--white), var(--bg-main) 40%, var(--bg-main-dark) 100%);
    color: var(--ink);
}

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

a {
    color: inherit;
}

/* Estructura Global */
.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.section-space {
    padding: 4.5rem 0;
}

.section-space-sm {
    padding: 2rem 0 3rem;
}

/* Header & Navegación */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.8rem 4vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-base-fuerte);
    color: var(--white);
    /*background: color-mix(in srgb, var(--white-warm) 95%, transparent);*/
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.header.scrolled {
    border-bottom-color: var(--color-base-medio);
    box-shadow: 0 6px 18px var(--shadow-dark);
}

.brand {
    text-decoration: none;
    display: grid;
    gap: 0.1rem;
}

.brand-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.7rem;
    letter-spacing: 0.04em;
    line-height: 1;
}

.brand-slogan {
    font-size: 0.72rem;
    color: var(--white);
}

.desktop-menu {
    display: none;
}

/* Menú Mobile & Hamburguesa */
.hamburger {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    display: grid;
    place-content: center;
    gap: 0.27rem;
    cursor: pointer;
}

.hamburger span {
    width: 1.25rem;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 4.5rem;
    left: 4vw;
    right: 4vw;
    z-index: 950;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white-soft);
    box-shadow: var(--shadow-soft);
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    display: grid;
    gap: 0.65rem;
    transition: all 0.25s ease;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu a {
    padding: 0.8rem 0.9rem;
    border-radius: 0.6rem;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
}

.mobile-menu a.active,
.mobile-menu a:hover {
    border-color: var(--line);
    background: var(--white-soft);
}

/* Hero Section */
.hero {
    min-height: 100svh;
    position: relative;
    display: flex;
    align-items: center;
    padding-top: 6.2rem;
    overflow: hidden;
}

.hero-bg,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    background: linear-gradient(100deg, var(--overlay-dark) 8%, var(--overlay-medium) 56%, var(--overlay-light) 100%);
}

.hero-content {
    position: relative;
    color: var(--white-88);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    background: var(--white-13);
    border: 1px solid var(--white-30);
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.45rem 0.8rem;
}

.hero-content h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 16vw, 6.3rem);
    line-height: 0.95;
    margin-top: 1rem;
    max-width: 10ch;
    letter-spacing: 0.015em;
}

.hero-content p {
    margin-top: 0.8rem;
    max-width: 36ch;
    color: var(--white-88);
}

.hero-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* Botones */
.btn {
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 800;
    text-decoration: none;
    padding: 0.85rem 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-primary {
    color: var(--white);
    background: var(--color-base-medio);/*linear-gradient(120deg, var(--primary-dark), var(--primary));*/
    box-shadow: 0 8px 20px rgba(141, 31, 24, 0.35);
}

.btn-light {
    color: var(--ink);
    background: var(--white);
}

/* Estadísticas */
.stats {
    margin-top: -1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 1rem 0.8rem;
    text-align: center;
}

.stat-card h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.1rem;
    color: var(--accent);
}

.stat-card p {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Secciones & Títulos */
.section-title {
    margin-bottom: 1.25rem;
}

.section-title h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 8vw, 3.8rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
}

.section-title p {
    margin-top: 0.6rem;
    color: var(--muted);
    max-width: 58ch;
}

/* Categorías */
.categories {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.45));
}

.category-grid {
    display: grid;
    gap: 0.85rem;
}

.category-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.category-card-toggle {
    width: 100%;
    border: 0;
    padding: 1rem;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    cursor: pointer;
}

.category-card-toggle i {
    color: var(--primary);
    transition: transform 0.25s ease;
}

.category-card.is-open .category-card-toggle i {
    transform: rotate(45deg);
}

.category-card-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 1rem;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
}

.category-card.is-open .category-card-content {
    opacity: 1;
    padding: 0 1rem 4rem;
}

.category-card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin: 0;
    line-height: 1;
}

.category-card p {
    color: var(--muted);
    /*margin-bottom: 0.7rem;*/
}

.category-card span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--surface-accent);
    border-radius: 999px;
    display: inline-flex;
    padding: 0.35rem 0.65rem;
}

/* Testimonios */
.testimonials {
    background: #f8f4ec;
}

.testimonial-grid {
    display: grid;
    gap: 0.85rem;
}

.testimonial-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.testimonial-card p {
    color: var(--ink-light);
}

.testimonial-card h3 {
    margin-top: 0.9rem;
    color: var(--primary-dark);
    font-size: 1rem;
}

.testimonial-card span {
    display: block;
    color: var(--muted);
    font-size: 0.83rem;
}

/* Galería / Carousel */
.gallery .carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.carousel-track {
    display: flex;
    transition: transform 0.45s ease;
}

.carousel-slide {
    min-width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--surface-muted);
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.3rem;
    height: 2.3rem;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.6);
    color: var(--white);
    display: grid;
    place-content: center;
    cursor: pointer;
}

.carousel-btn.prev {
    left: 0.6rem;
}

.carousel-btn.next {
    right: 0.6rem;
}

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 0.7rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.35rem;
}

.carousel-dots button {
    width: 0.55rem;
    height: 0.55rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.carousel-dots button.active {
    width: 1.2rem;
    background: var(--white);
}

/* Contacto & Sucursales */
.contact {
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.5) 100%);
}

.contact-tabs {
    display: grid;
    gap: 1rem;
}

.branch-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.branch-tab-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.65rem 1rem;
    background: var(--white);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.2s ease;
}

.branch-tab-btn:hover,
.branch-tab-btn:focus-visible {
    border-color: var(--primary);
    outline: none;
}

.branch-tab-btn.is-active {
    color: var(--white);
    border-color: transparent;
    background: var(--color-base-medio); /*linear-gradient(120deg, var(--color-base-fuerte), var(--color-base-bajo));*/
    box-shadow: 0 8px 20px rgba(141, 31, 24, 0.25);
}

.branch-panels {
    display: grid;
    gap: 1rem;
}

.branch-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
}

.branch-panel-grid {
    display: grid;
    gap: 1rem;
}

.branch-contact-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white-soft);
    padding: 1rem;
}

.branch-contact-card a {
     text-decoration: none;
}

.branch-status {
    display: none; /* inline-flex; */
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--surface-accent);
    border-radius: 999px;
    padding: 0.3rem 0.62rem;
    margin-bottom: 0.5rem;
}

.branch-contact-card h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: var(--primary-dark);
    line-height: 0.95;
    margin-bottom: 0.7rem;
}

.branch-contact-list {
    margin-top: 1rem;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.branch-contact-list li {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    font-weight: 600;
}

.branch-contact-list i {
    color: var(--accent);
}

/* Formularios */
.contact-form {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 0.45rem;
}

.branch-form-card {
    border-top: 4px solid var(--primary);
}

.branch-form-header {
    margin-bottom: 0.35rem;
}

.branch-form-header h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.75rem;
    line-height: 0.95;
    color: var(--primary-dark);
}

.branch-form-header p {
    color: var(--muted);
    margin-top: 0.45rem;
    font-size: 0.88rem;
}

.contact-form label {
    font-size: 0.86rem;
    font-weight: 700;
}

.contact-form input,
.contact-form textarea {
    border: 1px solid var(--line-input);
    border-radius: 0.68rem;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.94rem;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid #f4a69f;
    border-color: var(--primary);
}

.form-alert {
    border-radius: 0.65rem;
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.form-alert.success {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.form-alert.error {
    color: var(--error);
    background: var(--error-bg);
    border: 1px solid var(--error-border);
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Footer */
.footer {
    border-top: 1px solid var(--line);
    background: var(--white-warm);
    padding: 1.5rem 0;
}

.footer-content {
    display: grid;
    gap: 1rem;
}

.footer-brand span {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.55rem;
}

.footer-brand p {
    color: var(--muted);
    font-size: 0.83rem;
}

.social-links {
    display: flex;
    gap: 0.55rem;
}

.social-links a {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-decoration: none;
    display: grid;
    place-content: center;
}

/* Elementos Flotantes & Animaciones */
.whatsapp-float {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    text-decoration: none;
    display: grid;
    place-content: center;
    color: var(--white);
    background: linear-gradient(120deg, #0e8f5c, #22c55e);
    box-shadow: 0 12px 20px var(--shadow-whatsapp);
    z-index: 900;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Clases de Secciones Especiales (Sin sobreescrituras) */
.section-white {
    background: linear-gradient(180deg, var(--bg-main) 0%, var(--bg-main-dark) 100%);
}

.section-dark {
    background: linear-gradient(135deg, #041a35, #082757);
    color: var(--white);
}

.section-dark .section-title p,
.section-dark p {
    color: var(--white-82);
}

.section-dark h2,
.section-dark h3 {
    color: var(--white);
}

.section-pattern {
    position: relative;
    background: linear-gradient(135deg, #041a35, #082757);
    color: var(--white);
    overflow: hidden;
}

.section-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-25deg, var(--white-06), var(--white-06) 80px, transparent 80px, transparent 180px);
    pointer-events: none;
}

.section-stripes {
    background: linear-gradient(to bottom, #082757 0, #082757 80px, var(--white) 80px, var(--white) 140px, #082757 140px, #082757 220px, var(--white) 220px, var(--white) 280px);
}

/* Modificadores de Cards para Secciones Oscuras */
.section-dark .category-card,
.section-pattern .category-card,
.section-dark .testimonial-card,
.section-pattern .testimonial-card {
    background: var(--white-08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.section-dark .category-card p,
.section-pattern .category-card p {
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================
   MEDIA QUERIES (Responsive Design)
   ========================================== */

@media (min-width: 768px) {
    .section-space {
        padding: 6rem 0;
    }

    .hero {
        padding-top: 5.5rem;
    }

    .hero-content h1 {
        max-width: 12ch;
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .testimonial-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .carousel-slide {
        aspect-ratio: 16 / 7;
    }

    .branch-panel {
        padding: 1.15rem;
    }

    .branch-panel-grid {
        grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
        align-items: start;
    }

    .footer-content {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

@media (min-width: 980px) {
    .desktop-menu {
        display: flex;
        gap: 1rem;
    }

    .desktop-menu a {
        text-decoration: none;
        font-weight: 700;
        font-size: 0.9rem;
        padding: 0.45rem 0.65rem;
        border-radius: 0.5rem;
        border: 1px solid transparent;
    }

    .desktop-menu a:hover,
    .desktop-menu a.active {
        border-color: var(--line);
        background: var(--white);
        color: var(--primary-dark)
    }

    .hamburger,
    .mobile-menu {
        display: none;
    }

    .hero-content p {
        font-size: 1.05rem;
    }

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .branch-tabs {
        gap: 0.7rem;
    }
}