/* ==========================================================================
   1. RESET Y VARIABLES GLOBALES
   ========================================================================== */

:root {
    --primary-brand: #0052cc;
    --primary-dark: #003d99;
    --accent-color: #25d366;
    --accent-hover: #1da851;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--card-bg);
    color: var(--text-primary);
    line-height: 1.7;
    text-align: justify;
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin-inline: auto;
}

.container-narrow {
    max-width: 800px;
}

/* ==========================================================================
   2. BOTONES Y COMPONENTES REUTILIZABLES
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-brand);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--primary-brand);
    color: white;
    border-color: var(--primary-brand);
}

.full-width {
    width: 100%;
}

.card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    /* 16px */
    border: 1px solid var(--border-color);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.section {
    padding-block: clamp(3rem, 8vw, 6rem);
}

.bg-light {
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-inline: auto;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--primary-brand);
    margin-bottom: 0.5rem;
}

.section-header .lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: 0.1s;
}

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

/* ==========================================================================
   3. HEADER Y NAVEGACIÓN
   ========================================================================== */

@media (min-width: 900px) {
    .sticky-header-container {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
    }
}

header {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    border-bottom-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.head-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.desktop-nav a {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    padding-block: 0.5rem;
}

.desktop-nav a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-brand);
    transition: width 0.3s ease;
}

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

.desktop-nav .btn {
    padding: 0.5rem 1rem;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-brand);
    cursor: pointer;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-nav-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--card-bg);
    z-index: 1002;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
}

.mobile-nav.visible {
    right: 0;
}

.mobile-nav a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-nav a i {
    margin-right: 1rem;
    color: var(--primary-brand);
    width: 20px;
}

/* ==========================================================================
   4. SECCIONES ESPECÍFICAS
   ========================================================================== */

/* --- Hero y Carrusel --- */
.hero {
    position: relative;
    height: calc(100vh - var(--header-height));
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.carousel-slides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 3;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot.active,
.carousel-dot:hover {
    background-color: white;
}

/* --- Barra de Anuncio --- */
.announcement-bar {
    background-color: #FFD700;
    color: black;
    text-align: center;
    padding: 0.75rem 1rem;
    overflow: hidden;
    font-size: 0.65rem;
}

.announcement-bar__content {
    display: block;
    white-space: normal;
    animation: none;
}

.announcement-bar__content p {
    margin: 0;
    padding: 0;
    font-weight: 500;
}

/* --- 2. Estilos para PC (Se activan en pantallas de 900px o más) --- */
@media (min-width: 900px) {
    .announcement-bar {
        background-color: #FFD700;
        color: black;
        text-align: left;
        padding: 0.75rem 0;
    }

    .announcement-bar__content {
        display: inline-block;
        white-space: nowrap;
        font-weight: 700;
        animation: moverAviso 25s linear infinite;
    }

    .announcement-bar__content p {
        font-size: 1rem;
    }

    .announcement-bar:hover .announcement-bar__content {
        animation-play-state: paused;
    }
}

@keyframes moverAviso {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- Barra de Visitantes --- */
.visitor-counter-bar {
    background-color: var(--bg-light);
    color: var(--text-secondary);
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.visitor-counter-bar strong {
    color: var(--primary-dark);
    font-weight: 600;
}

@media (max-width: 900px) {
    .visitor-counter-bar {
        font-size: 0.65rem;
    }
}

/* --- Servicios --- */
.service-card {
    text-align: center;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary-brand);
    margin-bottom: 1rem;
    display: inline-block;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* --- Paquetes --- */
.package-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.package-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 1rem 1rem 0 0;
}

.package-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.package-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--primary-brand);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.package-content .description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.link-simplificado {
    display: flex;
    align-items: center;
    white-space: nowrap;
    gap: 8px;
    margin-top: 1rem;
    padding: 0;
    border: none;
    background-color: transparent;
    color: var(--primary-brand);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-simplificado:hover {
    color: var(--primary-dark);
    background-color: transparent;
}

/* --- Canales --- */
.text-center {
    text-align: center;
}

.channel-guide-img {
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    margin-inline: auto;
}

.noticias-facebook h1,
.descripcion h1,
.ubicacion h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--primary-brand);
}

.contenedor-noticias-facebook {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: stretch;
}

@media (min-width: 900px) {
    .contenedor-noticias-facebook {
        grid-template-columns: 1fr 1fr;
    }
}

.noticias-izquierda {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.noticias-izquierda .card {
    padding: 1.5rem;
}

.noticias-izquierda h3 {
    margin-bottom: 0.5rem;
}

.noticias-izquierda img,
.noticias-izquierda video {
    margin-top: 1rem;
    border-radius: 0.5rem;
}

.noticias-derecha {
    display: flex;
    flex-direction: column;
}

.youtube-responsive-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    flex-grow: 1;
}

.youtube-responsive-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sucursalprincipal img {
    display: block;
    margin: 0 auto;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

/* --- FAQ --- */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    color: var(--primary-dark);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease;
}

.faq-answer p {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.bottom-bar {
    display: none;
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */

footer {
    background-color: var(--primary-dark);
    color: white;
    padding-block: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-logo img {
    height: 40px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.footer-logo p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-links h5,
.footer-social h5 {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-links a {
    display: block;
    color: white;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    transition: opacity 0.2s;
    text-align: left;
}

.footer-links a:hover {
    opacity: 1;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.social-icons a:hover {
    opacity: 1;
    transform: scale(1.1);
}

.footer-bottom {
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ==========================================================================
   6. UTILIDADES Y OTROS
   ========================================================================== */

.whatsapp-fab {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: auto;
    height: 60px;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    text-decoration: none;
}

.whatsapp-fab i {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    color: white;
    font-size: 2.2rem;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: grid;
    place-items: center;
    animation: pulse 2s infinite;
}

.whatsapp-fab .whatsapp-bubble {
    background-color: #25d366;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Animación de pulso */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#backToTop {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid #eaeaea;
    box-shadow: var(--sombra);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

.bottom-bar {
    display: none;
}

/* Visor PDF */
#visorPDF {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

#visorPDF.visible {
    opacity: 1;
    pointer-events: auto;
}

#contenedorPDF {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
}

#visorPDF.visible #contenedorPDF {
    transform: scale(1);
}

#cerrarPDF {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    background: #333;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    line-height: 1;
    z-index: 10;
}

/* ==========================================================================
   7. ANCHOR LINK FIX (AÑADIDO)
   ========================================================================== */

section[id],
div[id] {
    scroll-margin-top: 120px;
}

/* ==========================================================================
   8. ESTILOS PÁGINA DE SUCURSALES
   ========================================================================== */

.branch-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.branch-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 1rem 1rem 0 0;
}

.branch-card-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.branch-card-info h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--primary-brand);
}

.branch-card-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.branch-card-info p i {
    color: var(--primary-dark);
    margin-right: 0.75rem;
    margin-top: 4px;
    width: 16px;
    text-align: center;
}

.branch-card-info .btn {
    margin-top: auto;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
    .desktop-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero {
        height: 80vh;
    }

    .package-content {
        font-size: 0.8em;
    }

    .package-content h3 {
        font-size: 1.0rem;
    }

    #backToTop.show {
        right: 1rem;
        bottom: 5rem;
    }

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

    .footer-logo img,
    .social-icons {
        justify-content: center;
        margin-inline: auto;
    }

    .whatsapp-fab {
        display: none;
    }

    .bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        z-index: 9999;
    }

    .bottom-bar a {
        text-decoration: none;
        color: inherit;
    }

    .bottom-bar .button {
        flex: 1;
        height: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-size: 24px;
        cursor: pointer;
        transition: background 0.2s, transform 0.2s;
    }

    .bottom-bar .button:hover {
        transform: translateY(-3px);
        opacity: 0.9;
    }

    .bottom-bar .whatsapp {
        background: #25D366;
    }

    .bottom-bar .facebook {
        background: #1877F2;
    }

    .bottom-bar .instagram {
        background: #E1306C;
    }

}