/* ===================================
   CLÍNICA DENTAL BRUNETE - STYLES
   =================================== */

/* Variables CSS */
:root {
    --color-primary: #236875;      /* Azul Petróleo */
    --color-secondary: #57A639;    /* Verde Hoja */
    --color-light: #F5F5F5;        /* Gris claro */
    --color-white: #FFFFFF;
    --color-dark: #1a1a1a;
    --color-text: #333333;
    --color-text-light: #666666;
    
    --font-primary: 'Montserrat', sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-white);
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 16px;
}

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

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

.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);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Header y Navegación */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar {
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.btn-cta {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 8px 20px;
    border-radius: var(--border-radius);
}

.nav-link.btn-cta:hover {
    background-color: #4a8f30;
    transform: translateY(-2px);
}

.nav-link.btn-cta::after {
    display: none;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

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

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a5460 100%);
    overflow: hidden;
}

/* Opción para usar imagen de fondo en el hero */
.hero.with-image {
    background: linear-gradient(rgba(35, 104, 117, 0.9), rgba(35, 104, 117, 0.9)), url('../images/sala-espera-clinica-1.jpg') center/cover;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-white);
    padding: 100px 0 50px;
}

.hero-title {
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s both;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    width: 24px;
    height: 24px;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.hero-wave svg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Secciones */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.services {
    background-color: var(--color-light);
}

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

.service-card {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card.featured {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    margin-bottom: 1.5rem;
}

.service-title {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.service-description {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.service-link {
    color: var(--color-secondary);
    font-weight: 600;
}

.service-link:hover {
    color: var(--color-primary);
}

/* Experience Section */
.experience-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.experience-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.experience-item.reverse {
    direction: rtl;
}

.experience-item.reverse .experience-content {
    direction: ltr;
}

.experience-image {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.experience-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Ajuste específico para las fotos de la clínica */
    object-position: center;
}

/* Ajustes específicos para cada imagen */
.experience-item:first-child .experience-image img {
    object-position: center right; /* Enfoca el sofá Chesterfield */
}

.experience-item:nth-child(2) .experience-image img {
    object-position: center; /* Centra la entrada de cristal */
}

.experience-item:last-child .experience-image img {
    object-position: center bottom; /* Muestra mejor la fachada */
}

.experience-image:hover img {
    transform: scale(1.05);
}

.experience-content h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.experience-features {
    margin-top: 1.5rem;
}

.experience-features li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 0.75rem;
    color: var(--color-text-light);
}

.experience-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: bold;
    font-size: 1.25rem;
}

/* Team Section */
.team {
    background-color: var(--color-light);
}

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

.team-member {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.member-image {
    position: relative;
    overflow: hidden;
    height: 300px;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.member-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(35, 104, 117, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-member:hover .member-image img {
    transform: scale(1.1);
}

.team-member:hover .member-overlay {
    opacity: 1;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--color-secondary);
    transform: scale(1.1);
}

.member-info {
    padding: 1.5rem;
    text-align: center;
}

.member-info h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.member-role {
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.member-bio {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* Cases Section */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.case-item {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.case-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
}

.before-after::after {
    content: 'VS';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-secondary);
    color: var(--color-white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: var(--shadow-md);
}

.before-after img {
    height: 250px;
    object-fit: cover;
}

.case-info {
    padding: 1.5rem;
}

.case-info h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.case-info p {
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.case-duration {
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.cases-cta {
    text-align: center;
}

.cases-cta p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Testimonials Section */
.testimonials {
    background-color: var(--color-light);
}

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

.testimonial-card {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 80px;
    color: var(--color-secondary);
    opacity: 0.2;
    font-family: Georgia, serif;
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.testimonial-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-header h4 {
    margin-bottom: 0.25rem;
}

.stars {
    color: #ffc107;
}

.testimonial-card p {
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-treatment {
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-form {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: var(--font-primary);
    transition: var(--transition);
    background-color: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea {
    outline: none;
    border-color: var(--color-secondary);
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    transition: var(--transition);
    pointer-events: none;
    background-color: var(--color-white);
    padding: 0 5px;
}

.form-group textarea + label {
    top: 20px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    font-size: 14px;
    color: var(--color-secondary);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox input {
    width: auto;
    margin: 0;
}

.form-group.checkbox label {
    position: static;
    transform: none;
}

.info-card {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item svg {
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.map-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Footer */
.footer {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-logo {
    margin-bottom: 1rem;
    background: white;
    padding: 10px;
    border-radius: var(--border-radius);
    max-width: 180px;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--color-white);
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
}

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

.social-media {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-media a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-media a:hover {
    background: var(--color-secondary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* WhatsApp Button */
.whatsapp-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 999;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--color-white);
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .experience-item,
    .experience-item.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-media {
        justify-content: center;
    }
    
    .whatsapp-button {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .section-header {
        margin-bottom: 2rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero-features {
        flex-direction: column;
        align-items: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonials-slider {
        grid-template-columns: 1fr;
    }
}

/* Optimizaciones de rendimiento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .header,
    .whatsapp-button,
    .hero-wave,
    .hamburger {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Loading animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading.hidden {
    animation: fadeOut 0.5s;
    animation-fill-mode: forwards;
}

@keyframes fadeOut {
    100% {
        opacity: 0;
        visibility: hidden;
    }
}