:root {
    --primary: hsl(221, 83%, 53%);
    --primary-hover: hsl(221, 83%, 45%);
    --primary-light: hsl(214, 95%, 93%);
    --primary-light-hover: hsl(214, 95%, 88%);
    --bg-color: hsl(210, 40%, 98%);
    --bg-light: hsl(210, 40%, 96%);
    --card-bg: hsl(0, 0%, 100%);
    --text-color: hsl(222, 47%, 11%);
    --text-muted: hsl(215, 16%, 47%);
    --accent: hsl(199, 89%, 48%);
    --accent-light: hsl(199, 89%, 95%);
    --border-color: hsl(214, 32%, 91%);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Spacings that adjust dynamically */
    --section-padding: 6rem 2rem;
    --card-padding: 3rem 2.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 4vw, 1.35rem); /* Responsive font size */
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    flex-shrink: 0;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    padding: 0.25rem 0;
    white-space: nowrap;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.2s ease-in-out;
}

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

nav a:hover::after {
    width: 100%;
}

.hero {
    padding: clamp(4rem, 8vw, 6rem) 2rem;
    background: radial-gradient(circle at top, hsl(214, 95%, 97%) 0%, var(--bg-color) 70%);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
}

.hero-image-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 2;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: scale(1.03);
}

.badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 6vw, 3.5rem); /* Fluid responsive scaling */
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out;
}

.hero p.subtitle {
    font-size: clamp(1.05rem, 3vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease-out;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap; /* Allows wrap on small viewports */
    animation: fadeInUp 1.2s ease-out;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.4);
}

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

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

.section {
    padding: var(--section-padding);
    max-width: 1200px;
    margin: 0 auto;
}

.bg-light {
    background-color: var(--bg-light);
    max-width: 100%;
    width: 100%;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.section-header p {
    color: var(--text-muted);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

/* Services section */
.services-grid {
    display: grid;
    /* Clean fluid sizing to prevent overflow on very small devices */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--card-bg);
    padding: var(--card-padding);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-icon-wrapper {
    width: 54px;
    height: 54px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.card-icon-wrapper svg {
    width: 26px;
    height: 26px;
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.card-list {
    list-style: none;
    margin-top: auto;
}

.card-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

.card-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 800;
}

/* Times section */
.times-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.times-card {
    background: var(--card-bg);
    padding: var(--card-padding);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.times-card.highlighted {
    border: 2px solid var(--primary);
    position: relative;
}

.times-card.highlighted::before {
    content: "Ärztliche Zeiten";
    position: absolute;
    top: -14px;
    right: 24px;
    background: var(--primary);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.times-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color);
}

.times-card.highlighted h3 {
    color: var(--primary);
}

.times-table {
    width: 100%;
    border-collapse: collapse;
}

.times-table tr {
    border-bottom: 1px solid var(--border-color);
}

.times-table tr:last-child {
    border-bottom: none;
}

.times-table td {
    padding: 1rem 0.5rem;
    font-size: 0.95rem;
}

.times-table td:first-child {
    font-weight: 700;
    color: var(--text-color);
    width: 30%;
}

.times-table td:nth-child(2), .times-table td:nth-child(3) {
    color: var(--text-muted);
}

/* Contact section */
.contact-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info-card {
    background: var(--card-bg);
    padding: var(--card-padding);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.info-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.info-icon {
    width: 48px;
    height: 48px;
    background-color: var(--accent-light);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    width: 22px;
    height: 22px;
}

.info-item h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.info-item p {
    color: var(--text-muted);
}

.info-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.info-item a:hover {
    color: var(--primary-hover);
}

.appointment-notice {
    background: radial-gradient(circle at bottom right, var(--primary-light) 0%, var(--card-bg) 60%);
    border: 1px solid var(--border-color);
    padding: var(--card-padding);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.appointment-notice h3 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.appointment-notice p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.call-banner {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    gap: 1rem;
}

.call-banner span {
    font-weight: 700;
    font-family: var(--font-heading);
    white-space: nowrap;
}

.phone-link {
    color: var(--primary);
    text-decoration: none;
    font-size: clamp(1.15rem, 3.5vw, 1.35rem);
    font-weight: 800;
    font-family: var(--font-heading);
    transition: color 0.2s;
    white-space: nowrap;
}

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

footer {
    background-color: hsl(222, 47%, 6%);
    color: hsl(215, 16%, 70%);
    padding: 3rem 2rem;
    border-top: 1px solid hsl(222, 47%, 12%);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.9rem;
}

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

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

/* Media Queries for full responsiveness */
@media (max-width: 1024px) {
    :root {
        --section-padding: 4rem 1.5rem;
        --card-padding: 2.5rem 2rem;
    }
    .hero {
        gap: 2.5rem;
    }
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 4rem 1.5rem;
        gap: 3rem;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-image-wrapper {
        max-width: 550px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.25rem;
        padding: 1.25rem 1rem;
        text-align: center;
    }
    
    nav {
        justify-content: center;
        width: 100%;
    }

    nav a {
        margin: 0 1rem;
        font-size: 0.9rem;
    }
    
    .appointment-notice {
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 3.5rem 1rem;
        --card-padding: 2rem 1.25rem;
    }
    
    nav {
        flex-wrap: wrap;
        gap: 0.5rem 0;
    }

    nav a {
        margin: 0 0.75rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .times-table td {
        font-size: 0.85rem;
        padding: 0.8rem 0.25rem;
    }
    
    .times-table td:first-child {
        width: 25%;
    }
    
    .call-banner {
        flex-direction: column;
        padding: 1.25rem 1rem;
        text-align: center;
        gap: 0.5rem;
    }
}
