/* ============================================
   MAIN STYLES
   ============================================ */

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

html,
body {
    margin: 0;
    padding: 0;
    font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg-page);
    width: 100%;
    max-width: 100%;
}

html {
    overflow-x: clip;
}

body {
    overflow-x: hidden;
}

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

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1100px;
    margin-inline: auto;
    padding: 24px;
}

.section {
    padding: 20px 0;
}

.section h2 {
    font-size: clamp(22px, 3vw, 34px);
    margin: 0 0 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* Typography */
h1 {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.2;
    margin: 8px 0 16px;
}

.lead {
    font-size: clamp(16px, 2.4vw, 20px);
    color: var(--text);
}

.kicker {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

/* Call-to-Action */
.cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

/* About Section */
.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.about .photo {
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 20%, transparent), transparent);
    aspect-ratio: 4/3;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 2rem;
}

/* O mně Section Specific */
#o-mne {
    padding-top: 0;
}

#kontakt {
    padding-top: 0;
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Desktop: Hide hamburger menu and overlay */
@media (min-width: 769px) {

    .hamburger,
    .menu-toggle {
        display: none !important;
    }

    .nav-overlay {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .about {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Hero Responsive */
    .hero-with-bg {
        min-height: 400px;
        padding: 60px 0;
        background-position: center center;
    }

    .hero-content {
        max-width: 100%;
        padding: 1.5rem;
        background: rgba(0, 0, 0, 0.37);
        backdrop-filter: blur(0.5px);
    }

    .hero-title {
        font-size: clamp(24px, 6vw, 32px);
    }

    .hero-text {
        font-size: clamp(14px, 4vw, 16px);
    }

    .cta {
        flex-direction: column;
        gap: 10px;
    }

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

    /* Navigation Responsive - Hamburger Menu */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        background: var(--card);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 24px 24px;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease, visibility 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
        visibility: hidden;
    }

    .main-nav.nav-open {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-link {
        width: 100%;
        padding: 16px 12px;
        border-bottom: 1px solid color-mix(in oklab, var(--muted) 15%, transparent);
    }

    .nav-item.dropdown {
        width: 100%;
    }

    .nav-item.dropdown .nav-link {
        border-bottom: none;
    }

    /* Menu Toggle Button (always visible - opens menu) */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 12px;
        border: none;
        background: var(--card);
        border-radius: 12px;
        cursor: pointer;
        border: 1px solid color-mix(in oklab, var(--muted) 25%, transparent);
        box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }

    .menu-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.2);
        border-color: var(--brand);
        background: color-mix(in oklab, var(--brand) 10%, var(--card));
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Hamburger Button (X - only visible when menu is open, closes menu) */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 12px;
        border: none;
        background: var(--card);
        border-radius: 12px;
        cursor: pointer;
        border: 1px solid color-mix(in oklab, var(--muted) 25%, transparent);
        box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        z-index: 1001;
        position: fixed;
        top: 24px;
        right: 24px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
    }

    .hamburger.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .hamburger:hover {
        box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.2);
        border-color: var(--brand);
        background: color-mix(in oklab, var(--brand) 10%, var(--card));
    }

    .hamburger span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

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

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

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

    /* Mobile Menu Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        min-width: 100%;
        max-width: 100%;
        display: none;
        grid-template-columns: 1fr;
        gap: 4px;
        margin-top: 8px;
        box-shadow: none;
        border: none;
        padding: 0;
        background: transparent;
    }

    .nav-item.dropdown.dropdown-active .dropdown-menu {
        display: grid;
        opacity: 1;
        visibility: visible;
    }

    .dropdown-item {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        padding: 12px 16px;
        margin-left: 20px;
        border-radius: 8px;
        background: color-mix(in oklab, var(--muted) 5%, transparent);
    }

    .dropdown-item.dropdown-overview {
        margin-left: 10px;
    }

    .dropdown-item span {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .dropdown-item svg {
        width: 20px;
        height: 20px;
    }

    /* O mně Section Responsive */
    #o-mne .container>div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }

    #o-mne .container>div>div[style*="width: 400px"] {
        width: 100% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    /* Preparation Section Responsive */
    .section div[style*="grid-template-columns: repeat(6, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    .section div[style*="grid-template-columns: repeat(6, 1fr)"] .card {
        grid-column: 1 / -1 !important;
    }

    /* Treatment Carousel Responsive */
    #treatment-carousel img {
        height: 300px !important;
    }

    /* Post-Treatment Section Responsive */
    .section h2+div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .section div[style*="position: sticky"] {
        position: static !important;
        margin-top: 1.5rem;
    }

    /* Pricing Section - Mobile Responsive */
    .page-transport .lead[style*="font-size: 1.75rem"] {
        font-size: 1.25rem !important;
    }

    .page-transport .lead[style*="font-size: 1.5rem"] {
        font-size: 1.1rem !important;
    }

    /* Vehicle Images - Mobile Responsive */
    .page-transport .section div[style*="flex: 0 0 400px"] {
        flex: 1 1 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .page-transport .section div[style*="display: flex"][style*="flex-wrap: wrap"] {
        flex-direction: column !important;
    }

    /* Lightbox - Mobile Responsive */
    #lightbox img {
        max-width: 95vw !important;
        max-height: 80vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* Transport Carousel - Mobile Responsive */
    #transport-carousel img {
        height: 300px !important;
    }
}

/* Transport Carousel Images */
.transport-carousel-img {
    height: 500px;
}

/* About Section Responsive Layout */
.about-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: start;
    margin-top: 2rem;
}

.about-photos {
    width: 400px;
}

@media (max-width: 900px) {
    .about-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    /* Unwrap columns to allow reordering children */
    .about-left,
    .about-photos {
        display: contents;
    }

    /* 1. Text o mně */
    .about-text {
        order: 1;
    }

    /* 2. Fotka o mně */
    .about-photo-item {
        order: 2;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    /* 3. Vzdělání (Timeline) */
    .about-timeline {
        order: 3;
    }

    /* 4. Carousel */
    .about-carousel-item {
        order: 4;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Navigation Auto-hide Fix */
header.nav {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

header.nav.nav-hidden {
    transform: translateY(-100%) !important;
}

/* Compensate for fixed header */
body {
    padding-top: 80px;
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    /* Pricing section - reduce padding on mobile */
    .page-treatment .section[style*="padding: 1.5rem 0 3rem 0"] {
        padding: 0.2rem 0 0.2rem 0 !important;
    }
}

/* After treatment section - center image on desktop */
@media (min-width: 769px) {
    .after-treatment-grid {
        align-items: center !important;
    }
}