/* ==========================================================================
   Responsive / Mobile-Optimierung — Lokmatas
   Alle breakpoints: 375px (iPhone SE), 390px (iPhone 14), 768px (iPad), 1024px
   ========================================================================== */

/* ---------- Global: Prevent Horizontal Overflow ---------- */
html {
    overflow-x: clip;
}
body {
    overflow-x: clip;
    max-width: 100vw;
}

/* ---------- Hamburger Button (hidden on desktop) ---------- */
.nav_hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
}

.nav_hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger X animation */
.nav_hamburger.is-open .nav_hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav_hamburger.is-open .nav_hamburger-line:nth-child(2) {
    opacity: 0;
}
.nav_hamburger.is-open .nav_hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Better Touch Targets (WCAG 2.5.8) ---------- */
input[type="checkbox"],
input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
}

/* ---------- kontakt.php: Form Container ---------- */
.kontakt-form-card {
    background: var(--base-white);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 24px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px rgba(17, 16, 15, 0.06);
}

/* ---------- kontakt.php: Checkbox DSGVO ---------- */
.kontakt-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.kontakt-checkbox input[type="checkbox"] {
    width: 44px;
    height: 44px;
    min-width: 44px;
    accent-color: var(--color-primary);
    margin-top: -10px;
    cursor: pointer;
}

/* ============================================
   TABLET (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {

    /* --- Global: Container Padding --- */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* --- Global: Section Padding kompakter --- */
    .section {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    /* --- Global: Eyebrow Text weniger Spacing --- */
    .eyebrow {
        font-size: 0.8rem;
        letter-spacing: 0.08em;
        margin-bottom: 10px;
    }

    /* --- Global: Subheading kompakter --- */
    .subheading {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* --- Global: Header spacing --- */
    .header.is-align-center {
        margin-bottom: 0;
    }

    .header.is-align-center .heading_h2 {
        margin-bottom: 8px;
    }

    /* --- Global: Gap-Reduktion bei grossen Gaps --- */
    .gap-large {
        gap: 32px;
    }

    .gap-small {
        gap: 12px;
    }

    /* --- Navigation: Hide brand text on mobile --- */
    .nav_left .paragraph_large[data-brand-name] {
        display: none;
    }

    /* --- Navigation: Show hamburger, hide inline menu --- */
    .nav_hamburger {
        display: flex !important;
    }

    .nav_center {
        display: none !important;
    }

    /* --- When menu is open, nav_center becomes the fullscreen overlay --- */
    .nav_center.is-open {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: var(--bg-primary) !important;
        z-index: 9998 !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav_center.is-open .nav_menu {
        display: flex !important;
        position: static !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 20px !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .nav_center.is-open .nav_menu-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .nav_center.is-open .nav_menu-list-item {
        width: 100% !important;
        text-align: center !important;
    }

    .nav_center.is-open .nav_link {
        display: block !important;
        padding: 16px 20px !important;
        font-size: 1.3rem !important;
        border-radius: 12px !important;
        transition: background 0.2s ease !important;
        color: var(--text-primary) !important;
    }

    .nav_center.is-open .nav_link:hover {
        background: var(--bg-secondary) !important;
    }

    /* Hide elements behind overlay when menu open */
    body.menu-open .w-background-video__pause-btn,
    body.menu-open .w-background-video button {
        z-index: 0 !important;
    }

    /* Hamburger stays on top of overlay */
    .nav_hamburger.is-open {
        position: fixed !important;
        top: 12px !important;
        right: 16px !important;
        z-index: 9999 !important;
    }

    /* --- index.php: 2-col grid 1-col --- */
    .page-index .grid_2-col {
        grid-template-columns: 1fr;
    }

    /* --- index.php: min-height_100dvh section --- */
    .page-index .min-height_100dvh {
        min-height: 50vh;
    }

    /* --- index.php: Tab Navigation horizontal scroll --- */
    .page-index .grid_4-col.w-tab-menu {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 8px;
        padding-bottom: 8px;
        grid-template-columns: unset;
    }

    .page-index .grid_4-col.w-tab-menu > a {
        flex: 0 0 auto;
        min-width: 140px;
        scroll-snap-align: start;
    }

    /* --- index.php: Video container --- */
    .w-background-video {
        min-height: 50vh;
    }

    .w-background-video video {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    /* --- index.php: 5-col grid stacked --- */
    .grid_5-col {
        grid-template-columns: 1fr !important;
    }

    /* --- index.php: 3-col grid 2-col --- */
    .page-index .grid_3-col {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- index.php: Feature cards spacing --- */
    .page-index .grid_5-col .card_body,
    .page-index .flex_vertical .card_body {
        padding: 20px 16px;
    }

    /* --- speisekarte.php: Section paddings strafferfuer saubere Uebergaenge --- */
    .page-speisekarte .section {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    /* --- speisekarte.php: Vor-Ort-Hinweis kompakter --- */
    .page-speisekarte .section + div[style*="text-align: center"][style*="padding: 14px"] {
        padding: 10px 16px !important;
    }

    /* --- speisekarte.php: Sticky nav horizontal scroll --- */
    .nav-buttons-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 4px;
        gap: 6px;
    }

    .nav-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* --- speisekarte.php: Eyebrow in sections --- */
    .page-speisekarte .eyebrow {
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        margin-bottom: 8px;
    }

    /* --- speisekarte.php: Header-Bereich (Eyebrow + H2 + Subheading) --- */
    .page-speisekarte .header.is-align-center {
        margin-bottom: 0;
    }

    .page-speisekarte .header.is-align-center .subheading {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    /* --- speisekarte.php: Inline margin-top auf Grids reduzieren --- */
    .page-speisekarte .grid_3-col[style*="margin-top: 40px"],
    .page-speisekarte .grid_4-col[style*="margin-top: 40px"] {
        margin-top: 24px !important;
    }

    .page-speisekarte .grid_2-col[style*="margin-top: 48px"] {
        margin-top: 28px !important;
    }

    /* --- speisekarte.php: Lokmatcha Featured Text Padding --- */
    .page-speisekarte .grid_2-col.gap-large[style*="background: linear-gradient"] > div:last-child {
        padding: 28px 20px !important;
    }

    /* --- speisekarte.php: CTA Button Abstand unter Boxen --- */
    .page-speisekarte div[style*="text-align: center"][style*="margin-top: 48px"] {
        margin-top: 32px !important;
    }

    /* --- speisekarte.php: Steps nav --- */
    .steps-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 8px;
    }

    .step-connector {
        display: none;
    }

    .step-badge {
        flex: 0 0 auto;
    }

    /* --- speisekarte.php: Steps nav margin --- */
    .steps-nav[style*="margin: 40px"] {
        margin: 24px 0 !important;
    }

    /* --- speisekarte.php: Summary sidebar unstick --- */
    .page-speisekarte .card[style*="position: sticky"] {
        position: static !important;
    }

    /* --- speisekarte.php: Builder 2-col 1-col on tablets --- */
    .page-speisekarte .grid_2-col.gap-large {
        grid-template-columns: 1fr;
    }

    /* --- speisekarte.php: Lokmatcha Featured 2-col 1-col --- */
    .page-speisekarte .grid_2-col.gap-large[style*="background: linear-gradient"] {
        grid-template-columns: 1fr;
    }

    /* --- speisekarte.php: Churros section 4-col 2-col (handled in inline styles) --- */

    /* --- speisekarte.php: Boxen 3-col 2-col --- */
    .page-speisekarte .section.is-secondary .grid_3-col {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- speisekarte.php: QR Modal smaller on mobile --- */
    .qr-modal-content {
        max-width: 90vw;
        padding: 28px 16px;
    }

    /* --- speisekarte.php: Builder navigation buttons spacing --- */
    .page-speisekarte .button-group[style*="margin-top: 32px"] {
        margin-top: 20px !important;
    }

    /* --- speisekarte.php: Summary sidebar card padding --- */
    .page-speisekarte .card .card_body[style*="padding: 32px"] {
        padding: 24px 16px !important;
    }

    /* --- speisekarte.php: Allergen section Flex gap --- */
    .page-speisekarte div[style*="gap: 32px"][style*="flex-wrap"] {
        gap: 16px !important;
    }

    /* --- kontakt.php: 2-col 1-col --- */
    .page-kontakt .grid_2-col {
        grid-template-columns: 1fr;
    }

    /* --- kontakt.php: Section kompakter --- */
    .page-kontakt .section {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    /* --- kontakt.php: Info section spacing --- */
    .page-kontakt .grid_2-col.gap-xsmall {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* --- kontakt.php: Labels --- */
    .page-kontakt .input_label {
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }

    /* --- footer: Heading responsive --- */
    .footer .heading_h2 {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    /* --- footer: Section spacing --- */
    .footer .header {
        margin-bottom: 32px;
    }

    /* --- footer: Bottom 3-col layout --- */
    .footer_bottom-3-col {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

    .footer_bottom-3-col .button-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* --- Legal pages: Reduce top padding --- */
    .legal-page {
        padding-top: 100px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .legal-content h2 {
        font-size: 20px;
    }
}

/* ============================================
   MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {

    /* --- Global: Section Padding noch kompakter --- */
    .section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    /* --- Global: Eyebrow noch kompakter --- */
    .eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.05em;
        margin-bottom: 8px;
    }

    /* --- Global: Subheading kleiner --- */
    .subheading {
        font-size: 0.9rem;
        line-height: 1.55;
    }

    /* --- index.php: 3-col 1-col --- */
    .page-index .grid_3-col {
        grid-template-columns: 1fr;
    }

    /* --- index.php: Heading responsive --- */
    .heading_h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    .heading_h2 {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    /* --- index.php: H3/H4/H5 proportional --- */
    .heading_h3 {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }

    .heading_h4 {
        font-size: clamp(1.05rem, 4vw, 1.3rem);
    }

    .heading_h5 {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    }

    /* --- speisekarte.php: Noch straffere Sections --- */
    .page-speisekarte .section {
        padding-top: 36px;
        padding-bottom: 36px;
    }

    /* --- speisekarte.php: Hero heading --- */
    .page-speisekarte .heading_h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    /* --- speisekarte.php: Hero container padding --- */
    .page-speisekarte header[style*="min-height: 45vh"] .container {
        padding: 60px 16px !important;
    }

    /* --- speisekarte.php: Card body padding --- */
    .page-speisekarte .card_body {
        padding: 16px;
    }

    /* --- speisekarte.php: Lokmatcha Featured text padding --- */
    .page-speisekarte .grid_2-col.gap-large[style*="background: linear-gradient"] > div:last-child {
        padding: 24px 16px !important;
    }

    /* --- speisekarte.php: Boxen 2-col 1-col --- */
    .page-speisekarte .section.is-secondary .grid_3-col {
        grid-template-columns: 1fr;
    }

    /* --- speisekarte.php: Drinks 3-col 1-col --- */
    .page-speisekarte .section:not(.is-secondary):not(.is-inverse) .grid_3-col.gap-small {
        grid-template-columns: 1fr;
    }

    /* --- speisekarte.php: Allergen section --- */
    .page-speisekarte .section[style*="padding: 48px"] {
        padding: 28px 0 !important;
    }

    /* --- speisekarte.php: Inline margin-tops noch kleiner --- */
    .page-speisekarte .grid_3-col[style*="margin-top: 40px"],
    .page-speisekarte .grid_4-col[style*="margin-top: 40px"] {
        margin-top: 20px !important;
    }

    .page-speisekarte .grid_2-col[style*="margin-top: 48px"] {
        margin-top: 24px !important;
    }

    /* --- speisekarte.php: CTA Button Abstand --- */
    .page-speisekarte div[style*="text-align: center"][style*="margin-top: 48px"] {
        margin-top: 24px !important;
    }

    /* --- speisekarte.php: Steps nav margin --- */
    .steps-nav[style*="margin: 40px"] {
        margin: 20px 0 !important;
    }

    /* --- speisekarte.php: Churros card padding --- */
    .page-speisekarte .section.is-inverse .card_body {
        padding: 16px 12px;
    }

    /* --- kontakt.php: Section kompakter --- */
    .page-kontakt .section {
        padding-top: 36px;
        padding-bottom: 36px;
    }

    /* --- kontakt.php: Heading area --- */
    .page-kontakt .header.is-align-center {
        margin-bottom: 0;
    }

    .page-kontakt .header.is-align-center .heading_h1 {
        margin-bottom: 8px;
    }

    /* --- kontakt.php: Info section grid 1-col --- */
    .page-kontakt .grid_2-col.gap-xsmall {
        grid-template-columns: 1fr;
    }

    /* --- Footer: Grid columns 1-col stack --- */
    .footer .grid_2-col {
        grid-template-columns: 1fr;
    }

    .footer .grid_2-col .grid_2-col {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* --- Footer: Padding kompakter --- */
    .footer {
        padding-top: 48px;
        padding-bottom: 32px;
    }

    .footer .header {
        margin-bottom: 24px;
    }

    /* --- Legal pages: More compact padding --- */
    .legal-page {
        padding-top: 80px;
        padding-bottom: 48px;
    }

    .legal-content h2 {
        font-size: 18px;
        margin: 28px 0 14px;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 375px — iPhone SE)
   ============================================ */
@media (max-width: 375px) {

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* --- Section Padding minimal --- */
    .section {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    /* --- Heading sizes even smaller --- */
    .heading_h1 {
        font-size: 1.6rem;
    }

    .heading_h2 {
        font-size: 1.3rem;
    }

    .heading_h3 {
        font-size: 1.15rem;
    }

    /* --- Eyebrow minimal --- */
    .eyebrow {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }

    /* --- Subheading minimal --- */
    .subheading {
        font-size: 0.85rem;
    }

    /* --- index.php: Section spacing tighter --- */
    .page-index .section {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    /* --- speisekarte.php: Noch kompaktere Sections --- */
    .page-speisekarte .section {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    /* --- speisekarte.php: Nav buttons smaller --- */
    .nav-btn {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    /* --- speisekarte.php: Option cards tighter --- */
    .option-card .card_body {
        padding: 12px !important;
    }

    /* --- speisekarte.php: Builder step heading --- */
    .page-speisekarte .builder-step .heading_h4 {
        font-size: 1rem;
    }

    /* --- speisekarte.php: Builder step description --- */
    .page-speisekarte .builder-step .text-color_secondary {
        font-size: 0.85rem;
        margin-bottom: 16px !important;
    }

    /* --- speisekarte.php: Steps nav padding --- */
    .steps-nav {
        padding: 16px 12px;
    }

    /* --- kontakt.php: Sections --- */
    .page-kontakt .section {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    /* --- Footer minimal padding --- */
    .footer {
        padding-top: 36px;
        padding-bottom: 24px;
    }

    .footer .subheading {
        font-size: 0.8rem;
    }

    /* --- Legal pages --- */
    .legal-page {
        padding-top: 72px;
    }
}

/* ============================================
   iOS-specific fixes
   ============================================ */

/* Fixed background doesn't work on iOS Safari */
@supports (-webkit-touch-callout: none) {
    .catering-fixed-bg {
        background-attachment: scroll !important;
    }
}

/* Prevent iOS zoom on inputs (font-size < 16px triggers zoom) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
}
