/* ============================================
   Consultorio Local Alhendín - Stylesheet
   Warm & Friendly Medical Center
   ============================================ */

/* --- CSS Variables --- */
:root {
    --color-terracotta: #C05640;
    --color-terracotta-dark: #A04530;
    --color-terracotta-light: #D47865;
    --color-sand: #F5F0E8;
    --color-sand-light: #FAF7F2;
    --color-sand-dark: #E8DFD0;
    --color-cream: #FFFDF9;
    --color-text: #2D2A26;
    --color-text-light: #6B6560;
    --color-text-muted: #9B9590;
    --color-white: #FFFFFF;
    --color-success: #10B981;
    
    --font-heading: 'Quicksand', sans-serif;
    --font-body: 'Rubik', sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.06);
    --shadow-md: 0 4px 20px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 8px 40px rgba(45, 42, 38, 0.12);
    --shadow-card: 0 4px 24px rgba(192, 86, 64, 0.08);
    
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-xl: 48px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-sand-light);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

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

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

ul {
    list-style: none;
}

/* --- Layout Container --- */
.layout-container {
    display: flex;
    min-height: 100vh;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: var(--color-sand-light);
    min-height: 100vh;
}

.section {
    padding: 80px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 16px;
    color: var(--color-text);
}

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

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-sand-dark);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-terracotta);
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--color-sand);
}

.menu-toggle span {
    width: 22px;
    height: 2.5px;
    background: var(--color-terracotta);
    border-radius: 2px;
    transition: var(--transition);
}

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

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

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

/* --- Side Navigation --- */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--color-white);
    border-right: 1px solid var(--color-sand-dark);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 48px;
}

.brand-icon {
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1.1rem;
    color: var(--color-terracotta);
    line-height: 1.2;
}

.brand-text p {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-light);
    transition: var(--transition);
}

.nav-links li a:hover,
.nav-links li a.active {
    background: var(--color-sand);
    color: var(--color-terracotta);
}

.nav-links li a .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-sand-dark);
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-links li a.active .dot,
.nav-links li a:hover .dot {
    background: var(--color-terracotta);
    transform: scale(1.3);
}

.nav-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--color-sand-dark);
}

.emergency-box {
    background: linear-gradient(135deg, var(--color-terracotta), var(--color-terracotta-dark));
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    color: var(--color-white);
}

.urgency-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.85;
    display: block;
    margin-bottom: 4px;
}

.emergency-box p {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-white);
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, var(--color-sand-light) 0%, var(--color-sand) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(192, 86, 64, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    max-width: 540px;
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-white);
    border: 1px solid var(--color-sand-dark);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 16px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.hero-content h2 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    margin-bottom: 24px;
    color: var(--color-text);
    line-height: 1.1;
}

.hero-content h2 .highlight {
    color: var(--color-terracotta);
    position: relative;
}

.hero-content h2 .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(192, 86, 64, 0.15);
    border-radius: 4px;
    z-index: -1;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 36px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-terracotta);
    color: var(--color-white);
    box-shadow: 0 4px 16px rgba(192, 86, 64, 0.3);
}

.btn-primary:hover {
    background: var(--color-terracotta-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(192, 86, 64, 0.4);
}

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

.btn-secondary:hover {
    background: var(--color-terracotta);
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* --- Hero Visual --- */
.hero-visual {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

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

.main-card {
    width: 340px;
    height: 440px;
}

.main-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
}

.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-white);
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

.small-card {
    position: absolute;
    bottom: 40px;
    left: -40px;
    width: 180px;
    height: 180px;
    z-index: 2;
}

.small-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-card {
    position: absolute;
    top: 40px;
    right: 0;
    background: var(--color-terracotta);
    color: var(--color-white);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.floating-card strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.floating-card span {
    font-size: 0.8rem;
    opacity: 0.85;
}

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

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.service-card {
    background: var(--color-sand-light);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    background: var(--color-white);
    border-color: var(--color-sand-dark);
    box-shadow: var(--shadow-card);
    transform: translateY(-4px);
}

.service-icon {
    width: 64px;
    height: 64px;
    background: var(--color-white);
    border: 1px solid var(--color-sand-dark);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--color-terracotta);
    border-color: var(--color-terracotta);
}

.service-card:hover .service-icon svg {
    stroke: var(--color-white);
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--color-text);
}

.service-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* --- Team Section --- */
.team-section {
    background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-sand-light) 100%);
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.split-content h2 {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    margin-bottom: 24px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 40px;
    line-height: 1.8;
}

.stats-row {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-terracotta);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.split-visual {
    position: relative;
}

.team-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--color-terracotta);
    color: var(--color-white);
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.exp-year {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.exp-text {
    font-size: 0.75rem;
    opacity: 0.85;
    letter-spacing: 0.05em;
}

/* --- Info Section --- */
.info-section {
    background: var(--color-white);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.info-card {
    background: var(--color-sand-light);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    border: 1px solid var(--color-sand-dark);
    transition: var(--transition);
}

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

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--color-terracotta);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hours-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-sand-dark);
}

.day-row:last-child {
    border-bottom: none;
}

.day {
    font-weight: 500;
    color: var(--color-text);
}

.time {
    font-weight: 600;
    color: var(--color-terracotta);
    font-family: var(--font-heading);
}

.time.closed {
    color: var(--color-text-muted);
}

.hours-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 16px;
    font-style: italic;
}

.address {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 20px;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-terracotta);
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.map-link:hover {
    gap: 12px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.contact-list a {
    color: var(--color-text);
    font-weight: 500;
}

.contact-list a:hover {
    color: var(--color-terracotta);
}

/* --- Contact Section --- */
.contact-section {
    background: linear-gradient(135deg, var(--color-sand-light) 0%, var(--color-sand) 100%);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    align-items: start;
}

.contact-text h2 {
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    margin-bottom: 16px;
}

.contact-text > p {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 32px;
    line-height: 1.8;
}

.quick-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.quick-link-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* --- Form --- */
.contact-form {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

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

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-sand-dark);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-sand-light);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-terracotta);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(192, 86, 64, 0.1);
}

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

.form-success {
    display: none;
    text-align: center;
    padding: 40px;
}

.form-success.show {
    display: block;
}

.success-icon {
    margin-bottom: 16px;
}

.form-success h3 {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-success p {
    color: var(--color-text-light);
}

/* --- Footer --- */
.footer {
    background: var(--color-text);
    color: var(--color-white);
    padding: 48px 60px 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo svg {
    opacity: 0.9;
}

.footer-brand h4 {
    font-size: 1rem;
    color: var(--color-white);
}

.footer-brand p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

.footer-info {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

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

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

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    
    .side-nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .side-nav.open {
        transform: translateX(0);
    }
    
    .mobile-header {
        display: flex;
    }
    
    .section {
        padding: 80px 24px;
    }
    
    .hero-section {
        flex-direction: column !important;
        padding-top: 100px;
    }
    
    .hero-content {
        margin-bottom: 40px;
    }
    
    .hero-visual {
        min-height: 400px;
    }
    
    .main-card {
        width: 280px;
        height: 360px;
    }
    
    .small-card {
        left: 0;
        width: 140px;
        height: 140px;
    }
    
    .floating-card {
        right: 10px;
        top: 20px;
    }
    
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .team-img {
        height: 350px;
    }
    
    .experience-badge {
        right: 10px;
        bottom: -10px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer {
        padding: 40px 24px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .section {
        padding: 60px 20px;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .contact-form {
        padding: 24px;
    }
    
    .quick-links {
        flex-direction: column;
    }
    
    .hero-visual {
        min-height: 350px;
    }
    
    .main-card {
        width: 240px;
        height: 300px;
    }
    
    .small-card {
        width: 120px;
        height: 120px;
    }
}

/* --- Overlay for mobile menu --- */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.nav-overlay.show {
    display: block;
}
