/* ===== RESET & GENERAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ===== NAVIGATION ===== */
#mainNav {
    background-color: #e52928;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

#mainNav .logo {
    height: 40px;
}

#mainNav .nav-link {
    color: white !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: opacity 0.3s ease;
}

#mainNav .nav-link:hover {
    opacity: 0.8;
}

#mainNav .btn-asociarme {
    background-color: white;
    color: #e52928 !important;
    border: 1px solid #e52928;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    opacity: 1;
}

#mainNav .btn-asociarme:hover {
    opacity: 1;
    background-color: #e52928;
    color: white !important;
    border: 1px solid #ffffff;
}

#mainNav .dropdown-menu {
    background-color: #e52928;
    border: none;
    border-radius: 0;
}

#mainNav .dropdown-item {
    color: white;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease;
}

#mainNav .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Mobile Menu */
@media (max-width: 991px) {
    #mainNav .logo {
        height: 30px;
    }
    
    #mainNav {
        padding: 0.75rem 1rem;
    }
    
    #mainNav .navbar-collapse {
        background-color: #e52928;
        margin-top: 1rem;
        padding: 1rem;
    }
    
    #mainNav .nav-item {
        margin-bottom: 0.5rem;
    }
}

/* ===== SALUD TAG (FLOATING) ===== */
.salud-tag {
    position: fixed;
    top: 110px;
    right: 0;
    background-color: #e52928;
    color: white;
    display: flex;
    align-items: stretch;
    z-index: 1000;
    font-weight: 600;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.2);
    border-radius: 5px 0 0 5px;
    overflow: hidden;
}

.salud-icon {
    background-color: #ef7d7d;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.salud-icon img {
    width: 27px;
    height: 27px;
}

.salud-tag span {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    cursor: default;
}

@media (max-width: 768px) {
    .salud-tag {
        top: 87px;
    }
    
    .salud-icon {
        width: 35px;
        height: 35px;
    }
    
    .salud-icon img {
        width: 20px;
        height: 20px;
    }
    
    .salud-tag span {
        padding: 0 1rem;
        font-size: 1rem;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    height: 550px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 70px;
}

.hero-parallax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img-header.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: left;
    color: white;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.hero-content h1 {
    font-size: 2.7rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    color: #FFF !important;
}

.btn-hero {
    background-color: white;
    color: #e52928;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background-color: #e52928;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .hero-section {
        height: 400px;
        margin-top: 60px;
    }
    
    .hero-parallax {
        background-attachment: scroll;
        background-image: url('img-header.jpg');
    }
    
    .hero-content h1 {
        font-size: 2rem;
        padding-top: 4rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* ===== SERVICES GRID ===== */
.services-grid {
    padding: 0;
}

.service-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.service-card-content {
    text-align: center;
    padding: 4rem 1.5rem;
    color: white;
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.service-title-desktop,
.service-title-mobile {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.service-title-mobile {
    display: none;
}

.service-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: #FFF !important;
}

.btn-service {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-service:hover {
    background-color: white;
    color: #242424;
}

/* Mobile Adaptations for Service Cards */
@media (max-width: 767px) {
    .service-card {
        min-height: 150px;
    }
    
    .service-card-content {
        padding: 1.5rem 1rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.75rem;
    }
    
    .service-title-desktop {
        display: none;
    }
    
    .service-title-mobile {
        display: block;
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    
    .service-description,
    .btn-service {
        display: none;
    }
    
    /* Mobile toggle state */
    .service-card.active {
        min-height: auto;
    }
    
    .service-card.active .service-card-content {
        padding: 1rem;
    }
}

/* ===== SERVICE DETAIL SECTION ===== */
.service-detail {
    display: none;
    animation: fadeIn 0.5s ease;
}

.service-detail.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-detail .row {
    display: flex;
    flex-wrap: wrap;
}

.service-detail-image,
.service-detail-content-wrapper {
    display: flex;
    flex-direction: column;
}

.service-detail-image {
    position: relative;
    min-height: 500px;
    overflow: hidden;
}

.service-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.service-detail-content-wrapper {
    flex: 1;
}

.service-detail-header {
    padding: 2rem 3rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.detail-icon {
    width: 50px;
    height: 50px;
}

.service-detail-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.service-detail-content {
    padding: 2rem 3rem;
    color: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-main-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #FFF !important;
}

#detailServices {
    margin-bottom: 1.5rem;
}

#detailServices p {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #FFF !important;
}

#detailServicesList {
    list-style-position: inside;
    padding-left: 0;
}

#detailServicesList li {
    margin-bottom: 0.25rem;
}

.detail-footer-text {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    color: #FFF !important;
}

/* ===== BOTONES DEL DETALLE ===== */
.detail-buttons-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-detail {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-detail:hover {
    background-color: white;
    color: #000;
}

/* Ocultar segundo botón por defecto */
#detailButton2 {
    display: none;
}

.btn-detail-secondary {
    background-color: transparent;
    border-color: white;
}

.btn-detail-secondary:hover {
    background-color: white;
    color: #000;
}

@media (max-width: 767px) {
    .detail-buttons-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-detail {
        flex: 1 1 100%;
        min-width: auto;
    }
}

/* Mobile Service Detail */
@media (max-width: 767px) {
    .service-detail-image {
        min-height: 250px;
        order: 1;
    }
    
    .service-detail-content-wrapper {
        order: 2;
    }
    
    .service-detail-header {
        display: none !important;
    }
    
    .service-detail-content {
        padding: 2rem 1.5rem;
    }
    
    .service-detail-header h2 {
        font-size: 1.5rem;
    }
    
    .detail-main-text {
        font-size: 1rem;
    }
}

/* Mobile Detail Positioning */
@media (max-width: 767px) {
    .service-detail.mobile-positioned {
        position: relative;
    }
}

/* ===== SMOOTH SCROLL ANIMATION ===== */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ===== LOADING ANIMATIONS ===== */
.service-card {
    animation: slideIn 0.5s ease;
}

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

/* Stagger animation for service cards */
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }
.service-card:nth-child(7) { animation-delay: 0.7s; }
.service-card:nth-child(8) { animation-delay: 0.8s; }

/* ===== UTILITY CLASSES ===== */
.text-white {
    color: white !important;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}


/* ===== FOOTER ===== */
.footer-area {
    background-color: #4a4a4a;
    color: #b5b5b5;
    padding: 50px 0 30px;
}

.footer-logo-row {
    margin-bottom: 45px;
}

.footer-logo {
    width: 200px;
}

.footer-columns {
    margin-bottom: 30px;
}

.footer-column h6 {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    letter-spacing: 0.05em;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul li a {
    color: #b5b5b5;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.footer-column ul li a:hover {
    color: #ffffff;
}

.footer-divider {
    border: none;
    border-top: 1px solid #606060;
    margin: 1.5rem 0;
}

/* Newsletter */
.footer-newsletter {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-newsletter h6 {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.newsletter-form {
    width: 100%;
}

.newsletter-input-group {
    display: flex;
    gap: 0.5rem;
}

.newsletter-input-group input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 7px;
    font-size: 0.875rem;
    background-color: white;
}

.newsletter-input-group button {
    padding: 0.625rem 1.25rem;
    background-color: #e52928;
    color: white;
    border: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.newsletter-input-group button:hover {
    background-color: #c41f1f;
}

/* Teléfono */
.footer-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.footer-phone .phone-icon {
    font-size: 1.75rem;
}

.footer-phone a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

/* Botón Información al Usuario */
.btn-info-usuario {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 66px;
    background-color: #e52928;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.4;
    transition: background-color 0.3s ease;
}

.btn-info-usuario:hover {
    background-color: #c41f1f;
    color: white;
}

/* Redes Sociales Mobile */
.footer-social-mobile {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0;
}

.footer-social-mobile img {
    width: 35px;
    height: 35px;
    transition: transform 0.3s ease;
}

.footer-social-mobile img:hover {
    transform: scale(1.1);
}

/* Redes Sociales Desktop */
.footer-social-desktop {
    display: none;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.social-icon {
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* Logos institucionales */
.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.footer-logos img {
    max-width: 150px;
    height: auto;
}

/* Textos legales */
.footer-legal-text {
    text-align: center;
    margin-top: 1.5rem;
}

.footer-legal-text p {
    color: #b5b5b5;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.footer-legal-text a {
    color: #b5b5b5;
    text-decoration: none;
}

.footer-legal-text a:hover {
    color: #ffffff;
}

/* Responsive Desktop */
@media (min-width: 768px) {
    .footer-social-mobile {
        display: none;
    }
    
    .footer-social-desktop {
        display: flex;
    }
    
    .newsletter-input-group {
        flex-direction: row;
    }
}

/* Responsive Mobile */
@media (max-width: 767px) {
    .footer-columns {
        margin-bottom: 0;
    }
    
    .footer-column {
        margin-bottom: 2rem;
    }
    
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-input-group button {
        width: 100%;
    }
    
    .footer-logos {
        gap: 1rem;
    }
    
    .footer-logos img {
        max-width: 120px;
    }
}


/* ===== MODALES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.3s ease, transform 0.3s ease;
    border-radius: 50%;
}

.modal-close:hover {
    color: #e52928;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    color: #333;
}

.modal-body h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e52928;
    margin-bottom: 1rem;
}

.modal-body h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-body p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #555;
}

.modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-body ul li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #555;
}

.modal-body strong {
    color: #333;
}

/* Mobile Modal - Pantalla completa */
@media (max-width: 767px) {
    .modal-container {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(100%);
    }
    
    .modal-container.active {
        transform: translateY(0);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
        position: sticky;
        top: 0;
        background-color: white;
        z-index: 10;
    }
    
    .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-body h4 {
        font-size: 1.1rem;
    }
    
    .modal-body h5 {
        font-size: 1rem;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}