/*
Theme Name: Santé - Centro de Diagnóstico
Theme URI: https://santediagnostico.com
Author: Santé Team
Author URI: https://santediagnostico.com
Description: Theme profesional para centro de diagnóstico médico con integración WooCommerce y sistema de citas
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sante-theme
Tags: medical, healthcare, woocommerce, appointments
*/

/* ============================
   VARIABLES Y COLORES CORPORATIVOS
   ============================ */
:root {
    --color-primary: #C41E3A;      /* Rojo corporativo */
    --color-secondary: #6D6E71;    /* Gris corporativo */
    --color-light-gray: #E6E7E8;   /* Gris claro */
    --color-white: #FFFFFF;
    --color-text: #333333;
    --color-success: #28a745;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
}

/* ============================
   RESET Y BASE
   ============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
    overflow-y: auto;
}

body {
    font-family: var(--font-secondary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-white);
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    position: relative;
}

/* Prevenir scroll horizontal */
.site-header,
.site-main,
.site-footer,
.container,
.header-container,
.footer-content,
.footer-main {
    max-width: 100%;
    overflow-x: hidden;
}

/* Contenedores responsive */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* Elementos que pueden causar overflow */
img,
video,
iframe,
table {
    max-width: 100%;
    height: auto;
}

/* Texto largo sin espacios */
p, h1, h2, h3, h4, h5, h6, span, a, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #9a1729;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================
   HEADER
   ============================ */
.site-header {
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-light-gray) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    top: 0;
    z-index: 9999;
    transition: all 0.3s ease;
    width: 100%;
    left: 0;
    right: 0;
}

.header-top {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 10px 0;
    font-size: 0.9rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-info i {
    color: white;
}

.contact-info span {
    margin-right: 20px;
}

.header-main {
    padding: 20px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-branding {
    flex-shrink: 0;
    max-width: 250px;
}

.site-branding .custom-logo-link {
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.site-branding .custom-logo,
.site-logo img {
    max-height: 60px !important;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
}

.site-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.site-navigation a {
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--color-secondary);
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.site-navigation a:hover,
.site-navigation .current-menu-item a {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ============================
   HERO SECTION
   ============================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary) 0%, #9a1729 100%);
    color: var(--color-white);
    padding: 100px 20px;
    text-align: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/images/medical-pattern.png') repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--color-white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

/* ============================
   CONTAINER Y SECCIONES
   ============================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 20px;
}

/* ============================
   SECTION TITLE CON SEPARADOR
   ============================ */
.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.section-title h2 {
    font-size: 2rem;
    color: #333;
    margin: 0;
    font-weight: 700;
    position: relative;
    white-space: nowrap;
}

/* Línea izquierda - ROJA */
.section-title:before {
    content: '';
    flex: 1;
    height: 3px;
    background: #C41E3A;
    max-width: 400px;
}

/* Línea derecha - GRIS */
.section-title:after {
    content: '';
    flex: 1;
    height: 3px;
    background: #E6E7E8;
    max-width: 400px;
}

/* Variante con subtítulo - se envuelve todo en columnas */
.section-title.with-subtitle {
    flex-direction: column;
    gap: 0;
}

.section-title.with-subtitle:before,
.section-title.with-subtitle:after {
    display: none;
}

.section-title.with-subtitle h2 {
    position: relative;
    padding: 0 30px;
}

.section-title.with-subtitle h2:before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 3px;
    background: #C41E3A;
}

.section-title.with-subtitle h2:after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 3px;
    background: #E6E7E8;
}

.section-title p {
    color: #666;
    font-size: 1.1rem;
    margin: 10px 0 0;
}

/* Responsive */
@media (max-width: 768px) {
    .section-title {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    /* Líneas arriba y abajo en móvil */
    .section-title:before {
        width: 120px;
        max-width: 120px;
        height: 3px;
        flex: 0 0 auto;
    }
    
    .section-title:after {
        width: 120px;
        max-width: 120px;
        height: 3px;
        flex: 0 0 auto;
    }
    
    /* Título al centro */
    .section-title h2 {
        font-size: 1.75rem;
        white-space: normal;
        text-align: center;
        padding: 0 20px;
    }
    
    /* Variante con subtítulo */
    .section-title.with-subtitle {
        gap: 15px;
    }
    
    .section-title.with-subtitle:before,
    .section-title.with-subtitle:after {
        display: block !important;
        position: static;
        transform: none;
        width: 120px;
        max-width: 120px;
        height: 3px;
        flex: 0 0 auto;
    }
    
    .section-title.with-subtitle:before {
        background: #C41E3A;
    }
    
    .section-title.with-subtitle:after {
        background: #E6E7E8;
    }
    
    .section-title.with-subtitle h2 {
        padding: 0 20px;
    }
    
    .section-title.with-subtitle h2:before,
    .section-title.with-subtitle h2:after {
        display: none !important;
    }
    
    .section-title.with-subtitle p {
        margin-top: 5px;
    }
}

/* ============================
   SERVICIOS / CATEGORÍAS
   ============================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: var(--color-white);
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top: 4px solid var(--color-primary);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.2);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary), #9a1729);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--color-white);
}

.service-card h3 {
    color: var(--color-secondary);
    margin-bottom: 15px;
}

.service-card p {
    color: #666;
    margin-bottom: 20px;
}

/* ============================
   PRODUCTOS WOOCOMMERCE
   ============================ */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    list-style: none;
}

.woocommerce ul.products li.product {
    background: var(--color-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(196, 30, 58, 0.15);
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.2rem;
    color: var(--color-secondary);
    padding: 15px;
}

.woocommerce ul.products li.product .price {
    color: var(--color-primary);
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0 15px 15px;
}

.woocommerce ul.products li.product .button {
    background-color: var(--color-primary);
    color: var(--color-white);
    width: 100%;
    border-radius: 0;
    padding: 15px;
    font-weight: 600;
}

.woocommerce ul.products li.product .button:hover {
    background-color: var(--color-secondary);
}

/* Badge para estudios virtuales */
.virtual-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--color-success);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ============================
   QUIENES SOMOS
   ============================ */
.about-section {
    background-color: var(--color-light-gray);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h2 {
    color: var(--color-primary);
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
    text-align: justify;
}

.about-features {
    list-style: none;
    margin-top: 20px;
}

.about-features li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
}

.about-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.3rem;
}

.about-image img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ============================
   CONTACTO
   ============================ */
.contact-section {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #4a4b4d 100%);
    color: var(--color-white);
}

.contact-grid {
    display: grid;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: none;
    border-radius: 5px;
    font-family: var(--font-secondary);
    font-size: 1rem;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-info-box {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.contact-info-box h3 {
    color: var(--color-white);
    margin-bottom: 15px;
}

.contact-info-box p {
    margin-bottom: 10px;
}

.contact-info-box i {
    color: var(--color-primary);
    margin-right: 10px;
}

/* ============================
   FOOTER
   ============================ */
.site-footer {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 50px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 30px;
}

.footer-widget h3 {
    color: var(--color-white);
    margin-bottom: 20px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: var(--color-light-gray);
}

.footer-widget a:hover {
    color: var(--color-white);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================
   SISTEMA DE CITAS
   ============================ */
.appointments-dashboard {
    background: var(--color-light-gray);
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
}

.appointment-card {
    background: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.appointment-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.status-confirmed {
    background-color: var(--color-success);
    color: white;
}

.status-completed {
    background-color: var(--color-secondary);
    color: white;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .site-navigation ul {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   ANIMACIONES
   ============================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ============================
   UTILIDADES
   ============================ */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.bg-light { background-color: var(--color-light-gray); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.bg-section-light {
    background: #f9f9f9;
}
/* ============================
   FIX OVERFLOW MÓVIL
   ============================ */
@media (max-width: 768px) {
    /* Forzar que nada se salga del viewport */
    * {
        max-width: 100vw;
    }
    
    body, html {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    .site-header,
    .site-main,
    .site-footer,
    .hero-section,
    .hero-slider,
    section,
    div {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Container específico */
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
    }
    
    /* Footer específico */
    .footer-main,
    .footer-content,
    .footer-bottom {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Tablas responsive */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}
