/* RESET I PODSTAWOWE STYLE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0077b6; /* Nowoczesny medyczny niebieski */
    --secondary-color: #00b4d8;
    --dark-text: #2b2d42;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --gray-border: #e9ecef;
    --font-main: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--dark-text);
    line-height: 1.6;
    background-color: var(--white);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* PASEK GÓRNY */
.top-bar {
    background-color: var(--dark-text);
    color: var(--white);
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.top-bar a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

/* NAGŁÓWEK I NAWIGACJA */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

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

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    transition: color 0.3s;
}

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

.main-nav .btn-nav {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 18px;
    border-radius: 20px;
}

.main-nav .btn-nav:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, rgba(0,119,182,0.9) 0%, rgba(0,180,216,0.8) 100%), url('images/hero-bg.jpg') no-repeat center center/cover;
    color: var(--white);
    padding: 100px 0;
    text-align: left;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-primary {
    display: inline-block;
    background-color: var(--white);
    color: var(--primary-color);
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* SEKCJE OGÓLNE */
.section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px auto;
    color: #6c757d;
}

/* O NAS */
.about-side-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: center;
}

.about-text-side p {
    font-size: 1.05rem;
    color: #4a5568;
    margin-bottom: 25px;
    text-align: justify;
    line-height: 1.8;
}

.about-features-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.about-image-side {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--gray-border);
}

.about-image-side img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

/* USŁUGI / GABINETY */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--gray-border);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 12px 30px rgba(0, 119, 182, 0.1);
}

.service-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-bottom: 1px solid var(--gray-border);
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.service-card-content {
    padding: 30px 25px;
    flex-grow: 1;
}

.service-card-content h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 600;
}

.service-card-content p {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* TABELA GODZIN PRZYJĘĆ */
.table-responsive {
    overflow-x: auto;
}

.hours-table {
    width: 100%;
    margin-top: 20px;
    background-color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--gray-border); 
}

.hours-table th, .hours-table td {
    padding: 18px 24px;
    text-align: left;
}

.hours-table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.hours-table td {
    border-bottom: 1px solid var(--gray-border);
}

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

.hours-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.hours-table tr.closed {
    color: #94a3b8;
    background-color: #f1f5f9;
}

/* NOCNA I ŚWIĄTECZNA OPIEKA ZDROWOTNA */
.emergency-section {
    border-top: 2px dashed var(--gray-border);
    border-bottom: 2px dashed var(--gray-border);
}

.emergency-wrapper {
    background: #fff5f5; 
    border: 1px solid #feb2b2; 
    padding: 40px; 
    border-radius: 16px; 
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.05);
}

.emergency-header {
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 20px;
}

.emergency-icon {
    font-size: 2.5rem; 
    line-height: 1;
}

.emergency-title {
    color: #c53030; 
    font-size: 1.8rem; 
    font-weight: 700; 
    margin: 0; 
    padding: 0;
}

.emergency-lead {
    font-size: 1.05rem; 
    color: #4a5568; 
    margin-bottom: 25px; 
    text-align: justify;
}

.emergency-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px;
}

.emergency-card {
    background: var(--white); 
    padding: 25px; 
    border-radius: 12px; 
    border: 1px solid #fed7d7; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}

.emergency-card h3 {
    color: #9b2c2c; 
    margin-bottom: 12px; 
    font-size: 1.2rem; 
    font-weight: 600;
}

.emergency-card p {
    font-size: 0.95rem; 
    color: #4a5568; 
    line-height: 1.6;
}

.emergency-phone {
    color: #c53030; 
    font-weight: 700; 
    text-decoration: none; 
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.emergency-phone:hover {
    color: #9b2c2c;
    text-decoration: underline;
}

.emergency-footer {
    margin-top: 25px; 
    padding-top: 20px; 
    border-top: 1px solid #fed7d7; 
    font-size: 0.9rem; 
    color: #742a2a;
}

/* KONTAKT */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
}

.contact-info h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.contact-info p {
    margin-bottom: 20px;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    padding-bottom: 75%; /* Zapewnia responsywne proporcje mapy */
    height: 0;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* STOPKA */
.main-footer {
    background-color: var(--dark-text);
    color: #a0aec0;
    padding: 30px 0;
    font-size: 0.9rem;
}

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

.main-footer a {
    color: var(--white);
    text-decoration: none;
}

/* AUTOMATYCZNE LIKWIDOWANIE SAMOTNYCH LITER */
p, li, h1, h2, h3, h4 {
    text-wrap: pretty;
}

/* RESPONSYWNOŚĆ PIONOWA (PIONOWE SMARTFONY) */
@media (max-width: 768px) {
    .header-flex, .top-bar .container, .footer-flex {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
        margin-top: 15px;
    }

    .about-side-layout, .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .about-image-side {
        order: 1; /* Zdjęcie ląduje pod tekstem */
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* ==========================================================================
   NOWOŚĆ: DOPASOWANIE DO TELEFONÓW PO OBROCIE EKRANU (TRYB LANDSCAPE)
   ========================================================================== */
@media (max-width: 920px) and (orientation: landscape) {
    
    /* Układamy logo i całe menu w jednej linii, zamiast jedno pod drugim */
    .header-flex {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 10px;
    }

    /* Logo delikatnie zmniejszamy, żeby zyskać przestrzeń w poziomie */
    .logo {
        font-size: 1.1rem !important;
    }
    .logo img {
        height: 30px !important;
    }

    /* Menu nawigacyjne: usuwamy pionowe odstępy, zmniejszamy font */
    .main-nav ul {
        flex-direction: row !important; 
        flex-wrap: nowrap !important; /* Wymuszamy trzymanie wszystkiego w jednej linii */
        align-items: center !important;
        gap: 12px !important; /* Zmniejszamy odstępy między linkami */
        margin-top: 0 !important; /* Kasujemy margines z trybu pionowego */
    }

    .main-nav a {
        font-size: 0.8rem !important; /* Mniejszy tekst, aby zmieścił się na szerokość */
    }

    /* Kompaktowy przycisk "Kontakt" w menu górnym */
    .main-nav .btn-nav {
        padding: 5px 12px !important; /* Mniejsze poduszki wokół tekstu */
        white-space: nowrap; /* Blokujemy łamanie tekstu "Kontakt" */
    }

    /* Pozostałe reguły dopasowania sekcji (zostają bez zmian) */
    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .section {
        padding: 40px 0;
        height: auto !important; 
    }

    .about-side-layout, 
    .services-grid, 
    .emergency-grid, 
    .contact-wrapper {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }

    .about-image-side, 
    .service-card-image {
        max-height: 250px;
    }

    .about-image-side img, 
    .service-card-image img {
        max-height: 250px;
    }

    .map-container {
        padding-bottom: 50%; 
    }
}