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

:root {
    /* Paleta basada en bioformula.cl */
    --primary-color: #24AEB1;      /* turquesa principal */
    --primary-dark: #129B9E;       /* turquesa oscuro (barra superior, hover) */
    --secondary-color: #EB3A7B;    /* rosado de acento (botones) */
    --secondary-dark: #D42A69;
    --text-dark: #1D2A38;          /* azul marino (titulos) */
    --text-light: #7D879C;         /* gris azulado (texto) */
    --bg-light: #F5F8FA;
    --border-color: #EAEAEA;
    --rating-color: #FFD21C;
    --danger-color: #e74c3c;
    --success-color: #27ae60;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* TOP BAR */
.top-bar {
    background-color: var(--primary-dark);
    color: white;
    padding: 12px 0;
    font-size: 14px;
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.top-bar-left {
    display: flex;
    gap: 30px;
    align-items: center;
}

.top-bar-left a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.top-bar-left a:hover {
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: white;
    font-size: 16px;
}

/* NAVBAR */
header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* LOGO IMAGE */
.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-img:not([src]) {
    display: none;
}

.logo i {
    font-size: 28px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu > li {
    position: relative;
    padding-bottom: 15px;
}

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 250px;
    display: none;
    list-style: none;
    margin-top: 0;
    padding-top: 15px;
    padding-bottom: 5px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.nav-menu li:hover .submenu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    padding: 0;
}

.submenu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
}

.submenu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* HERO SECTION - CAROUSEL */
.hero {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(18, 155, 158, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

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

/* OVERLAY para el hero - para que el texto se vea sobre la imagen */
.hero-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 600px;
    padding: 20px;
    position: relative;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-weight: 600;
}

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

.btn-primary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.btn-secondary:hover {
    background-color: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.carousel-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 3;
}

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

.carousel-dot.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

/* SERVICES SECTION */
.services {
    background: var(--bg-light);
    padding: 80px 20px;
}

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

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.service-card {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.service-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 20px;
}

.service-card p {
    color: var(--text-light);
    font-size: 14px;
}

.section-title {
    text-align: center;
    font-size: 36px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 16px;
}

/* CLIENTS SECTION */
.clients {
    padding: 80px 20px;
    background: white;
}

.clients-carousel {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 50px;
}

.client-logo {
    width: 150px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 10px;
    font-weight: bold;
    color: var(--text-light);
    text-align: center;
    padding: 20px;
    transition: all 0.3s;
    overflow: hidden;
}

.client-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.client-logo:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.client-logo:hover img {
    filter: brightness(2);
}

/* BLOG SECTION */
.blog {
    background: var(--bg-light);
    padding: 80px 20px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.blog-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.blog-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    overflow: hidden;
    object-fit: cover;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-content {
    padding: 25px;
}

.blog-date {
    color: var(--secondary-color);
    font-size: 12px;
    margin-bottom: 10px;
}

.blog-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--text-dark);
}

.blog-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: gap 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    gap: 10px;
}

/* TESTIMONIALS SECTION */
.testimonials {
    background: white;
    padding: 80px 20px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.testimonial-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.rating {
    color: var(--rating-color);
    margin-bottom: 15px;
    font-size: 14px;
}

.testimonial-text {
    color: var(--text-light);
    margin-bottom: 15px;
    font-style: italic;
    line-height: 1.6;
}

.testimonial-author {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.testimonial-date {
    font-size: 12px;
    color: var(--text-light);
}

/* FOOTER */
footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-section p {
    color: #ccc;
    line-height: 1.8;
    font-size: 14px;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    max-width: 1200px;
    margin: 0 auto;
}

/* MODAL STYLES */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    width: calc(100% - 40px);
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    box-sizing: border-box;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-dark);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(36, 174, 177, 0.3);
}

/* PAGO STYLES */
.pago-opciones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.pago-opcion {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.pago-opcion:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-light);
}

.pago-opcion.active {
    border-color: var(--primary-color);
    background-color: rgba(36, 174, 177, 0.1);
}

.pago-opcion i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.pago-opcion h4 {
    margin: 10px 0;
    color: var(--text-dark);
}

.pago-opcion p {
    font-size: 12px;
    color: var(--text-light);
}

.pago-resumen {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.pago-resumen-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.pago-resumen-row.total {
    border: none;
    font-weight: bold;
    font-size: 16px;
    color: var(--primary-color);
}

.webpay-info {
    background: #E9F7F7;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-dark);
}

.webpay-info i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .top-bar-left {
        flex-direction: column;
        gap: 10px;
    }

    .services-grid, .blog-grid, .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .pago-opciones {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px auto;
        width: 95%;
    }
}

/* LOADER */
.loader {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ALERT STYLES */
.alert {
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* MODAL DE POSTULACIÓN */
.postulacion-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
    overflow-y: auto;
}

.postulacion-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.postulacion-modal-content {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.postulacion-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.postulacion-modal-close:hover {
    color: var(--primary-color);
}

.postulacion-modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px 25px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.postulacion-modal-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.postulacion-modal-header h2 {
    font-size: 23px;
    margin-bottom: 5px;
    font-weight: 600;
}

.postulacion-modal-header p {
    font-size: 12px;
    opacity: 0.9;
}

.postulacion-modal-body {
    padding: 30px 25px;
}

.postulacion-intro {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.5;
}

.postulacion-opciones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.postulacion-opcion {
    background: #f9f9f9;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 18px;
    transition: all 0.3s ease;
    text-align: center;
}

.postulacion-opcion:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(36, 174, 177, 0.1);
    transform: translateY(-5px);
}

.postulacion-opcion-icon {
    font-size: 35px;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

.postulacion-opcion h3 {
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
}

.postulacion-opcion-desc {
    color: #666;
    font-size: 12px;
    margin-bottom: 15px;
}

.postulacion-datos {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    text-align: left;
}

.postulacion-dato-item {
    margin-bottom: 8px;
}

.postulacion-dato-item:last-child {
    margin-bottom: 0;
}

.postulacion-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.postulacion-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    transition: color 0.3s;
}

.postulacion-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.postulacion-opcion code {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    display: block;
    word-break: break-all;
    font-weight: 500;
}

.postulacion-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.postulacion-lista li {
    padding: 5px 0;
    color: var(--text-light);
    font-size: 13px;
    display: flex;
    align-items: center;
}

.postulacion-lista li:before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 8px;
}

.postulacion-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.postulacion-btn-primary:hover {
    background-color: var(--primary-dark);
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(36, 174, 177, 0.3);
}

.postulacion-btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.postulacion-btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(36, 174, 177, 0.3);
}

.postulacion-contacto {
    background: linear-gradient(135deg, rgba(36, 174, 177, 0.1) 0%, rgba(235, 58, 123, 0.05) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: #333;
}

.postulacion-contacto i {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 8px;
    display: block;
}

.postulacion-contacto p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .postulacion-opciones {
        grid-template-columns: 1fr;
    }

    .postulacion-modal-content {
        width: calc(100% - 20px);
        margin: 20px 10px;
    }

    .postulacion-modal-header {
        padding: 25px 20px;
    }

    .postulacion-modal-body {
        padding: 20px 18px;
    }

    .postulacion-modal-header h2 {
        font-size: 20px;
    }
}

/* =========================================
   SUCURSALES + FOOTER (estilo bioformula.cl)
   ========================================= */
.branches {
    background: white;
    padding: 60px 20px;
    border-top: 1px solid #E3E6EA;
}

.branches-wrap {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.branch-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.branch-info {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.branch-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 14px rgba(29, 42, 56, 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.branch-info h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.branch-info p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
}

.branch-info a {
    color: var(--text-light);
    text-decoration: none;
}

.branch-closed {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.branch-mail {
    margin-top: 6px;
}

.branch-mail a {
    color: var(--primary-color);
    font-weight: 600;
}

.branch-mail a:hover {
    text-decoration: underline;
}

.branch-map {
    width: 100%;
    height: 240px;
    border: 0;
    border-radius: 10px;
    background: #F2F3F5;
}

/* Footer */
.site-footer {
    background: white;
    color: var(--text-dark);
    padding: 0 20px;
    border-top: 1px solid #E3E6EA;
}

.site-footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.sf-col {
    padding: 40px 40px 40px 0;
}

.sf-col + .sf-col {
    border-left: 1px solid #E3E6EA;
    padding-left: 40px;
}

.sf-logo {
    height: 44px;
    width: auto;
    display: block;
    margin-bottom: 26px;
}

.site-footer h4 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dark);
    margin-bottom: 18px;
}

.sf-bullets {
    list-style: none;
}

.sf-bullets li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.sf-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.sf-partner {
    display: block;
    margin-bottom: 18px;
    transition: opacity 0.3s;
}

.sf-partner:hover {
    opacity: 0.85;
}

.sf-partner img {
    width: 100%;
    max-width: 230px;
    display: block;
}

.sf-links {
    list-style: none;
}

.sf-links li {
    margin-bottom: 10px;
}

.sf-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.sf-links a:hover {
    color: var(--primary-color);
}

.sf-pay-title {
    margin-top: 26px;
}

.sf-pay {
    width: 150px;
    height: auto;
    display: block;
}

.sf-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid #E3E6EA;
    padding: 18px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.sf-bottom a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Botón volver arriba */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(18, 155, 158, 0.35);
    z-index: 90;
    transition: transform 0.3s, background 0.3s;
}

.back-to-top:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

@media (max-width: 900px) {
    .branches-wrap,
    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .sf-col,
    .sf-col + .sf-col {
        padding: 30px 0;
        border-left: 0;
    }

    .sf-col + .sf-col {
        border-top: 1px solid #E3E6EA;
    }
}

/* =========================================
   MENÚ PRINCIPAL (estilo bioformula.cl)
   ========================================= */
.nav-menu {
    gap: 34px;
    align-items: center;
}

.nav-menu > li {
    padding: 22px 0;
}

.nav-menu > li > a {
    position: relative;
    color: var(--text-light);
    font-weight: 600;
    font-size: 15px;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-menu > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.nav-menu > li:hover > a,
.nav-menu > li.current > a {
    color: var(--text-dark);
}

.nav-menu > li:hover > a::after,
.nav-menu > li.current > a::after {
    transform: scaleX(1);
}

.nav-menu > li.has-submenu > a {
    padding-right: 14px;
}

.nav-menu > li.has-submenu > a::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.submenu {
    min-width: 260px;
    border-radius: 0;
    padding: 18px 0;
    margin-top: 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.09);
}

.submenu a {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    border-bottom: 0;
    transition: color 0.2s, padding-left 0.2s;
}

.submenu a:hover {
    background: transparent;
    color: var(--primary-color);
    padding-left: 30px;
}

@media (max-width: 768px) {
    .nav-menu > li {
        padding: 8px 0;
    }

    .nav-menu > li > a::after {
        display: none;
    }
}

/* Logo más grande en celular, sin desbordar el encabezado */
@media (max-width: 768px) {
    .logo-img {
        height: 56px;
    }
}

/* Logo del pie de página */
.sf-logo {
    height: 58px;
}

/* ===== Barra superior: direcciones de las sucursales (abren Google Maps) ===== */
.top-bar-dirs {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.top-bar-dirs a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.top-bar-dirs a:hover,
.top-bar-dirs a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.top-bar-dirs i { color: #ffd54f; }
.top-bar-sep {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
}
@media (max-width: 768px) {
    .top-bar-content { justify-content: center; text-align: center; }
    .top-bar-dirs { flex-direction: column; gap: 6px; width: 100%; }
    .top-bar-sep { display: none; }
}

/* =========================================
   AJUSTES RESPONSIVOS (celular y tablet)
   ========================================= */
/* Nada se sale de la pantalla: imágenes, videos y correos largos */
img, iframe, video { max-width: 100%; }
a[href^="mailto:"] { overflow-wrap: anywhere; }

/* Páginas Intranet y Trabaja con nosotros: margen lateral */
.page-content > .container {
    padding-left: 20px;
    padding-right: 20px;
}

/* Tablet: sucursales y pie de página en 2 columnas en vez de 1 */
@media (min-width: 601px) and (max-width: 900px) {
    .branches-wrap {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .site-footer-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 32px;
    }
    .site-footer-grid .sf-col:first-child {
        grid-column: 1 / -1;
    }
    .site-footer-grid .sf-col + .sf-col {
        border-top: 1px solid #E3E6EA;
    }
}

@media (max-width: 768px) {
    /* Barra superior más compacta: solo las direcciones */
    .top-bar {
        padding: 7px 0;
        font-size: 13px;
    }
    .top-bar-left {
        display: none;
    }
    .top-bar-content {
        gap: 0;
    }
    .top-bar-dirs {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        column-gap: 14px;
        row-gap: 2px;
    }

    /* Recuadros de dos columnas escritos dentro de la página: pasan a una */
    .page-content [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    .page-content [style*="padding: 30px"],
    .page-content [style*="padding: 40px"] {
        padding: 20px !important;
    }

    /* Mapas de sucursales menos altos */
    .branch-map {
        height: 200px;
    }
    .branches {
        padding: 40px 20px;
    }
}

@media (max-width: 600px) {
    .page-content h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    .page-content h2 {
        font-size: 1.45rem;
        line-height: 1.25;
    }
    .branch-map {
        height: 180px;
    }
    .branch-info {
        gap: 14px;
    }
    .branch-icon {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }
    /* Botón "volver arriba" más pequeño para no tapar texto */
    .back-to-top {
        width: 40px;
        height: 40px;
        right: 14px;
        bottom: 14px;
    }
}
@media (max-width: 600px) {
    /* Intranet: accesos para empleados en 2 columnas */
    .page-content [style*="minmax(250px, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }
}
