/**
 * Mobile UX Improvements for VR-Infotainment
 * Addresses: Touch targets, WCAG compliance, responsive layouts, and mobile-first design
 */

/* ========================================
   WCAG CONTRAST IMPROVEMENTS
   ======================================== */

/* Improved contrast for labels and subtitles */
.wizard-stepper__subtitle {
    color: #cbd5e1; /* Upgraded from #94a3b8 for better WCAG AA compliance */
}

.booking-stage__heading p {
    color: #e2e8f0; /* Upgraded from #cbd5ff for better readability */
}

.booking-calendar__legend {
    color: #cbd5e1; /* Upgraded from #94a3b8 */
}

.slot-card__capacity-label {
    color: #e0e7ff; /* Upgraded for better contrast */
}

/* Ensure minimum 16px font size on mobile */
@media (max-width: 640px) {
    body {
        font-size: 16px; /* WCAG recommendation */
    }

    .wizard-stepper__title {
        font-size: 1rem;
    }

    .booking-stage__heading h2 {
        font-size: 1.75rem;
    }
}

/* ========================================
   TOUCH TARGETS (Minimum 44x44px)
   ======================================== */

@media (max-width: 768px) and (min-width: 481px) and (hover: none) {
    /* Navigation buttons */
    #mobile-menu-button {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    /* Calendar navigation */
    .booking-calendar__nav {
        min-width: 48px;
        min-height: 48px;
    }

    /* Wizard navigation buttons */
    #wizard-back,
    #wizard-next,
    #wizard-finish {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 1rem;
    }

    /* Calendar days - Tablet Touch */
    .calendar-day {
        min-height: 80px;
        padding: 0.65rem 0.45rem;
    }

    /* Time slots */
    .slot-card {
        min-height: 88px;
        padding: 1.25rem 1rem;
    }

    /* Package selection buttons */
    #package-selection button {
        min-height: 120px;
        padding: 1.5rem;
    }

    /* Person toggles (Voll/Ermäßigt buttons) */
    .person-ticket-toggle button {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Touch-Geräte im Smartphone-Bereich (max 480px) */
@media (max-width: 480px) and (hover: none) {
    #mobile-menu-button {
        min-width: 44px;
        min-height: 44px;
    }

    .booking-calendar__nav {
        min-width: 44px;
        min-height: 44px;
    }

    #wizard-back,
    #wizard-next,
    #wizard-finish {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Calendar days auf Smartphones - NICHT zu groß */
    .calendar-day {
        /* Größe wird durch booking-responsive.css gesteuert */
        padding: 0.35rem 0.25rem;
    }

    .slot-card {
        min-height: 80px;
        padding: 1rem;
    }

    #package-selection button {
        min-height: 100px;
        padding: 1.25rem;
    }

    .person-ticket-toggle button {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ========================================
   WIZARD STEPPER - ENHANCED MOBILE
   ======================================== */

@media (max-width: 768px) {
    #wizard-stepper {
        padding: 0 0.5rem;
        gap: 0.75rem;
        margin-bottom: 2rem;
        /* Horizontal scroll with snap */
        scroll-snap-type: x mandatory;
        scroll-padding: 0.5rem;
    }

    .wizard-stepper__item {
        min-width: 160px;
        padding: 0.65rem 0.9rem;
        gap: 0.6rem;
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .wizard-stepper__icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }

    .wizard-stepper__title {
        font-size: 0.9rem;
    }

    /* Hide subtitle on very small screens */
    .wizard-stepper__subtitle {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .wizard-stepper__item {
        min-width: 100px;
        padding: 0.5rem 0.6rem;
    }

    .wizard-stepper__subtitle {
        display: none;
    }

    /* Issue #175: Mobile Stepper-Labels kürzen um Abschneiden zu verhindern */
    .wizard-stepper__title {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 70px;
    }
}

/* Issue #175: Sehr kleine Screens (< 360px) - noch kompaktere Labels */
@media (max-width: 360px) {
    .wizard-stepper__item {
        min-width: 85px;
        padding: 0.4rem 0.5rem;
    }

    .wizard-stepper__title {
        font-size: 0.7rem;
        max-width: 60px;
    }

    .wizard-stepper__icon {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
    }
}

/* Vertical stepper alternative for narrow screens */
@media (max-width: 360px) {
    #wizard-stepper {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .wizard-stepper__item {
        min-width: auto;
        width: 100%;
    }
}

/* ========================================
   PERSON COUNT - PLUS/MINUS BUTTONS
   ======================================== */

/* Container for the enhanced number input */
.person-count-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    width: fit-content;
    min-width: 180px;
}

.person-count-button {
    appearance: none;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.8), rgba(59, 130, 246, 0.8));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.person-count-button:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(96, 165, 250, 0.9));
    transform: scale(1.05);
}

.person-count-button:active:not(:disabled) {
    transform: scale(0.95);
}

.person-count-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.person-count-display {
    flex: 1;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    min-width: 60px;
}

/* Hide original number input */
#wz-persons.with-controls {
    display: none;
}

@media (max-width: 640px) {
    .person-count-wrapper {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem;
    }

    .person-count-button {
        width: 48px;
        height: 48px;
    }
}

/* ========================================
   PERSON TOGGLES - RESPONSIVE LAYOUT
   ======================================== */

#wz-person-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.person-ticket-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.person-ticket-label {
    flex: 1;
    min-width: 0;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
}

.person-ticket-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.person-ticket-buttons button {
    appearance: none;
    background: rgba(71, 85, 105, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #cbd5e1;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.person-ticket-buttons button:hover:not(:disabled) {
    background: rgba(100, 116, 139, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.person-ticket-buttons button.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(16, 185, 129, 0.8));
    border-color: rgba(34, 197, 94, 0.5);
    color: white;
}

/* Stack buttons vertically on mobile */
@media (max-width: 640px) {
    .person-ticket-toggle {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .person-ticket-buttons {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .person-ticket-buttons button {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }
}

/* Landscape mode: keep horizontal */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .person-ticket-toggle {
        flex-direction: row;
    }

    .person-ticket-buttons {
        flex-direction: row;
    }
}

/* ========================================
   PACKAGE SELECTION - RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    #package-selection {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #package-selection button {
        padding: 1.5rem;
        text-align: left;
    }
}

@media (max-width: 640px) {
    #package-selection button {
        padding: 1.25rem 1rem;
    }

    #package-selection button h3 {
        font-size: 1.1rem;
    }

    #package-selection button p {
        font-size: 0.9rem;
    }
}

/* ========================================
   CONDITIONAL BUTTON VISIBILITY
   ======================================== */
/* Note: Wizard navigation styles moved to booking-responsive.css */

/* Button bleibt sichtbar auch wenn Formular unvollständig */
#wizard-finish[data-form-incomplete="true"] {
    /* display: none !important; - Entfernt: Button soll immer sichtbar sein */
    opacity: 0.6;
    cursor: not-allowed;
}

#wizard-next[data-form-complete="true"] {
    display: none !important;
}

/* Disabled state improvements */
button[disabled],
button[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(30%);
}

/* ========================================
   IMPROVED LOADING STATES
   ======================================== */

@media (max-width: 640px) {
    .calendar-status[data-state="loading"],
    .slot-hint {
        font-size: 0.9rem;
        padding: 0.85rem;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid rgba(6, 182, 212, 0.8);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .wizard-stepper__item,
    .calendar-day,
    .slot-card,
    button {
        border-width: 2px;
    }

    .wizard-stepper__subtitle,
    .booking-calendar__legend,
    .slot-card__capacity-label {
        font-weight: 600;
    }
}

/* ========================================
   MOBILE MENU ENHANCEMENTS
   ======================================== */

@media (max-width: 768px) {
    #mobile-menu {
        /* Smooth slide animation */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    #mobile-menu.is-open {
        max-height: calc(100vh - var(--mobile-menu-offset, 76px) - 1rem);
    }

    #mobile-menu a {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
}

/* ========================================
   BOOKING MODAL - MOBILE IMPROVEMENTS (Issue #6)
   ======================================== */

@media (max-width: 640px) {
    .modal-content {
        max-width: 95%;
        padding: 1.5rem 1rem;
        margin: 1rem;
    }

    #time-slots {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #booking-cta {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        min-height: 56px;
    }

    /* Booking modal step 2 buttons - stack on mobile (Issue #6) */
    #booking-step-2 .flex.gap-4 {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    #booking-step-2 .flex.gap-4 button {
        width: 100%;
        min-height: 52px;
        justify-content: center;
    }

    /* Primary button styling */
    #booking-step-2 .btn-primary {
        font-size: 1.05rem;
        font-weight: 600;
        padding: 14px 24px;
    }

    /* Back button as ghost link */
    #booking-step-2 .glass-button {
        background: transparent !important;
        border: none !important;
        color: #94a3b8;
        font-size: 0.95rem;
        padding: 12px 16px;
    }

    #booking-step-2 .glass-button:hover {
        background: transparent !important;
        color: #e2e8f0;
        text-decoration: underline;
    }
}

/* ========================================
   SUMMARY SECTION - RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    [data-wizard-step="4"] .grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }

    /* iOS Safari Auto-Zoom Fix: All inputs must be >= 16px */
    #contact-name,
    #contact-email,
    #contact-phone,
    #contact-postal,
    #discount-code-input,
    #wz-persons,
    #modal-person-count,
    [data-wizard-step] input[type="text"],
    [data-wizard-step] input[type="email"],
    [data-wizard-step] input[type="tel"],
    [data-wizard-step] input[type="number"],
    .booking-step input[type="text"],
    .booking-step input[type="email"],
    .booking-step input[type="tel"],
    .booking-step input[type="number"] {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 1rem;
        min-height: 48px;
    }

    /* Form field vertical spacing */
    [data-wizard-step="4"] .grid > div,
    .booking-step .glass-widget > div {
        margin-bottom: 20px;
    }

    [data-wizard-step="4"] .grid > div:last-child {
        margin-bottom: 0;
    }

    #discount-apply,
    #discount-remove {
        min-height: 48px;
        padding: 12px 20px;
    }
}

/* ========================================
   IMPROVED SPACING ON MOBILE
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .booking-stage {
        padding: 1.5rem 1rem;
    }

    .booking-panel {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .booking-stage {
        padding: 1.25rem 0.85rem;
    }

    .booking-panel {
        padding: 1rem;
    }
}

/* ========================================
   SAFE AREA INSETS (for notched devices)
   ======================================== */

@supports (padding: max(0px)) {
    .site-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    #booking-wizard {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* ========================================
   PROGRESSIVE ENHANCEMENT
   ======================================== */

/* Show better UI only when JavaScript is enabled */
.js-enabled .person-count-wrapper {
    display: flex;
}

.no-js .person-count-wrapper {
    display: none;
}

.no-js #wz-persons {
    display: block !important;
}

/* ========================================
   TIME-SLOT MOBILE OPTIMIZATION (Issue #5)
   ======================================== */

/* Ensure minimum 44px touch target for time slots on mobile */
@media (max-width: 768px) {
    /* Slot tiles in modal and wizard */
    .slot-tile,
    .slot-card,
    .slot-card-enhanced,
    #time-slots > div,
    #time-slots button {
        min-height: 44px;
        touch-action: manipulation; /* Prevent double-tap zoom */
    }

    /* Enhanced selected state for slot tiles */
    .slot-tile--selected {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(16, 185, 129, 0.25)) !important;
        border-color: rgba(34, 197, 94, 0.9) !important;
        border-width: 3px;
        box-shadow:
            0 0 0 4px rgba(34, 197, 94, 0.25),
            0 8px 24px rgba(34, 197, 94, 0.4),
            inset 0 0 20px rgba(34, 197, 94, 0.1) !important;
        transform: scale(1.02);
    }

    .slot-tile--selected .slot-tile__time {
        color: #22c55e !important;
        -webkit-text-fill-color: #22c55e !important;
        font-weight: 800;
    }

    /* Checkmark indicator for selected slot */
    .slot-tile--selected::after {
        content: '✓';
        position: absolute;
        top: 6px;
        right: 8px;
        font-size: 14px;
        font-weight: 700;
        color: #22c55e;
        background: rgba(34, 197, 94, 0.2);
        border-radius: 50%;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Enhanced selected state for slot-card */
    .slot-card--selected,
    .slot-card[aria-selected="true"] {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2)) !important;
        border-color: rgba(34, 197, 94, 0.9) !important;
        border-width: 3px;
        box-shadow:
            0 0 0 4px rgba(34, 197, 94, 0.2),
            0 8px 20px rgba(34, 197, 94, 0.35) !important;
    }

    /* Enhanced selected state for slot-card-enhanced */
    .slot-card-enhanced--selected {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(16, 185, 129, 0.25)) !important;
        border-color: rgba(34, 197, 94, 0.9) !important;
        border-width: 3px;
        box-shadow:
            0 0 0 4px rgba(34, 197, 94, 0.25),
            0 12px 32px rgba(34, 197, 94, 0.4) !important;
    }
}

/* Larger slots for touch devices */
@media (max-width: 640px) and (hover: none) {
    .slot-tile,
    .slot-card,
    #time-slots > div {
        min-height: 80px;
        padding: 16px 12px;
    }

    .slot-tile__time {
        font-size: 18px;
    }

    /* Better tap feedback */
    .slot-tile:active:not(.slot-tile--soldout):not(.slot-tile--closed),
    .slot-card:active,
    .slot-card-enhanced:active:not(.slot-card-enhanced--disabled) {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
}

/* ========================================
   CALENDAR HORIZONTAL SCROLL FIX (Issue #9)
   Prevents calendar from causing page-wide horizontal scroll on mobile
   ======================================== */

/* Fallback: Prevent horizontal scroll on html/body */
html {
    overflow-x: hidden;
}

/* Calendar section containment */
.calendar-section,
#kalender {
    max-width: 100%;
    overflow-x: hidden;
}

/* Calendar grid wrapper - contains overflow internally */
.calendar-grid-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Ensure calendar grid doesn't exceed viewport */
.calendar-grid,
#calendarGrid {
    max-width: 100%;
    min-width: 0; /* Allow grid to shrink */
}

/* Booking calendar on tickets page */
.booking-calendar,
#wz-cal-grid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Glass widget containers */
.glass-widget {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile-specific overflow fixes */
@media (max-width: 768px) {
    .calendar-section,
    #kalender,
    .calendar-grid-wrapper,
    .booking-calendar {
        overflow-x: hidden;
    }

    /* Calendar controls - prevent overflow */
    .calendar-controls {
        max-width: 100%;
        flex-wrap: wrap;
    }

    /* Legend wrapping */
    .calendar-legend {
        max-width: 100%;
        flex-wrap: wrap;
    }

    /* Kompakteres Calendar Grid für Tablets - NUR Homepage-Kalender */
    .calendar-grid,
    #calendarGrid {
        gap: 0.35rem !important;
    }

    /* Kleinere Calendar Days - NUR Homepage-Kalender (nicht Buchungskalender) */
    .calendar-grid > div,
    #calendarGrid > div,
    #calendarGrid .calendar-day {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens: ensure everything fits */
    .calendar-grid-wrapper {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        width: calc(100% + 1rem);
    }

    /* Noch kompakteres Grid für Smartphones - NUR Homepage-Kalender */
    .calendar-grid,
    #calendarGrid {
        gap: 0.2rem !important;
        padding: 0.5rem !important;
    }

    /* Kleinere Calendar Days für Smartphones - NUR Homepage-Kalender */
    .calendar-grid > div,
    #calendarGrid > div,
    #calendarGrid .calendar-day {
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0.25rem !important;
        font-size: 0.8rem;
        border-radius: 6px !important;
    }

    /* Wochentag-Header kompakter */
    .calendar-grid > div:nth-child(-n+7),
    #calendarGrid > div:nth-child(-n+7) {
        font-size: 0.7rem !important;
        padding: 0.25rem 0 !important;
    }
}

/* iPhone SE und sehr kleine Bildschirme - NUR Homepage-Kalender */
@media (max-width: 375px) {
    .calendar-grid,
    #calendarGrid {
        gap: 0.15rem !important;
        padding: 0.35rem !important;
    }

    .calendar-grid > div,
    #calendarGrid > div,
    #calendarGrid .calendar-day {
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 0.75rem;
    }

    /* Glass widget padding reduzieren */
    .glass-widget {
        padding: 1rem !important;
    }
}

/* ========================================
   ISSUE #7: HOMEPAGE KALENDER MOBILE OPTIMIERUNG
   Versteckt day-label, kw-label auf Mobile, zeigt nur Zahl + Tickets
   ======================================== */

/* Homepage Kalender - Basis-Styles für Mobile */
#calendarGrid .calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

/* Day-Label (Samstag, Sonntag, Feiertage) */
#calendarGrid .day-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.1;
}

/* KW-Label */
#calendarGrid .kw-label {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

/* Ticket Info */
#calendarGrid .ticket-info {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

#calendarGrid .ticket-count {
    font-weight: 700;
    font-size: 0.7rem;
}

/* Mobile: Nur das Wichtigste zeigen */
@media (max-width: 640px) {
    /* Day-Label kürzen/ausblenden */
    #calendarGrid .day-label {
        display: none !important;
    }

    /* KW-Label ausblenden */
    #calendarGrid .kw-label {
        display: none !important;
    }

    /* Ticket-Info kompakter */
    #calendarGrid .ticket-info {
        margin-top: 0.1rem;
    }

    #calendarGrid .ticket-icon {
        width: 12px !important;
        height: 12px !important;
    }

    #calendarGrid .ticket-count {
        font-size: 0.65rem !important;
    }

    /* Calendar Day kompakter */
    #calendarGrid .calendar-day {
        padding: 0.3rem 0.2rem !important;
        min-height: 48px !important;
        gap: 0.1rem;
    }

    #calendarGrid .day-number {
        font-size: 0.9rem !important;
        font-weight: 700;
    }
}

/* Sehr kleine Bildschirme (iPhone SE) */
@media (max-width: 375px) {
    #calendarGrid .calendar-day {
        min-height: 42px !important;
        padding: 0.2rem !important;
    }

    #calendarGrid .day-number {
        font-size: 0.8rem !important;
    }

    #calendarGrid .ticket-count {
        font-size: 0.6rem !important;
    }

    #calendarGrid .ticket-icon {
        width: 10px !important;
        height: 10px !important;
    }
}

/* Day-Header (Mo, Di, Mi...) zentriert */
#calendarGrid .day-header {
    text-align: center;
    font-weight: 600;
}

@media (max-width: 480px) {
    #calendarGrid .day-header {
        font-size: 0.65rem !important;
        padding: 0.3rem 0 !important;
    }
}

@media (max-width: 375px) {
    #calendarGrid .day-header {
        font-size: 0.55rem !important;
    }
}

/* Kalender-Legende auf Mobile kompakter */
@media (max-width: 640px) {
    .calendar-legend {
        gap: 0.5rem 1rem !important;
        font-size: 0.7rem !important;
    }

    .calendar-legend .legend-item {
        gap: 0.3rem !important;
    }

    .calendar-legend-dot {
        width: 8px !important;
        height: 8px !important;
    }
}

/* ========================================
   ISSUE #10: SUMMARY & PAYMENT CTA VEREINHEITLICHEN
   Premium-Button-Styles, Sticky CTA, Preis/Fees getrennt
   ======================================== */

/* -------------------------------------------
   1. PREMIUM BUTTON STYLES - Anwenden & Finish CTAs
   ------------------------------------------- */

/* Enhanced Primary Button Style for Summary Section */
/* Issue #175: Lila durch Royal Blue ersetzt */
[data-wizard-step="4"] .btn-primary,
#wizard-finish {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #3b82f6 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    box-shadow:
        0 4px 15px rgba(37, 99, 235, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Shimmer Effect auf Primary Buttons */
[data-wizard-step="4"] .btn-primary::before,
#wizard-finish::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

[data-wizard-step="4"] .btn-primary:hover::before,
#wizard-finish:not([disabled]):hover::before {
    left: 100%;
}

/* Hover State */
[data-wizard-step="4"] .btn-primary:hover,
#wizard-finish:not([disabled]):hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(37, 99, 235, 0.45),
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #60a5fa 100%);
}

/* Active/Pressed State */
[data-wizard-step="4"] .btn-primary:active,
#wizard-finish:not([disabled]):active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Issue #175: Rabattcode-Button als Tertiary/Ghost-Style */
#discount-apply {
    background: transparent;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

#discount-apply:hover {
    color: #e2e8f0;
    border-color: rgba(226, 232, 240, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

#discount-apply:active {
    transform: scale(0.98);
}

/* Finish Button - Extra Prominent */
#wizard-finish:not([disabled]) {
    background: linear-gradient(135deg, #059669 0%, #10B981 50%, #34D399 100%);
    box-shadow:
        0 4px 20px rgba(16, 185, 129, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
    padding: 16px 32px;
    min-height: 56px;
}

#wizard-finish:not([disabled]):hover {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10B981 100%);
    box-shadow:
        0 8px 30px rgba(16, 185, 129, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Disabled State */
#wizard-finish[disabled],
#wizard-finish.opacity-50 {
    background: linear-gradient(135deg, #374151 0%, #4B5563 100%);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* -------------------------------------------
   2. PREIS/FEES VISUELL GETRENNT
   ------------------------------------------- */

/* Price Summary Container */
[data-wizard-step="4"] .text-right {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.4) 100%);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

/* Zwischensumme - dezenter */
#sum-base-price {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Rabatt Zeile - hervorgehoben */
#sum-discount-row {
    margin: 0.75rem 0;
    padding: 0.75rem 0;
    border-top: 1px dashed rgba(52, 211, 153, 0.3);
    border-bottom: 1px dashed rgba(52, 211, 153, 0.3);
}

#sum-discount {
    font-size: 1.15rem;
    font-weight: 700;
    color: #34D399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

/* Gesamtpreis - sehr prominent */
#sum-price {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    margin-top: 0.5rem;
    line-height: 1.1;
}

/* Label über Gesamtpreis */
#sum-price + .text-gray-300,
[data-wizard-step="4"] .text-right > div:last-child .text-gray-300 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.25rem;
}

/* -------------------------------------------
   3. STICKY CTA AUF MOBILE
   ------------------------------------------- */

@media (max-width: 768px) {
    /* Sticky Navigation Container */
    .wizard-navigation {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: linear-gradient(
            to top,
            rgba(15, 17, 32, 0.98) 0%,
            rgba(15, 17, 32, 0.95) 60%,
            rgba(15, 17, 32, 0.85) 80%,
            transparent 100%
        );
        padding: 1rem 1rem 1.25rem;
        margin: 0 -1rem -1rem;
        width: calc(100% + 2rem);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    }

    /* Safe Area für notched devices */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .wizard-navigation {
            padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
        }
    }

    /* Sticky Navigation Buttons */
    .wizard-navigation .btn-primary,
    .wizard-navigation #wizard-next,
    .wizard-navigation #wizard-finish {
        width: 100%;
        min-height: 54px;
        font-size: 1.1rem;
        font-weight: 700;
        border-radius: 14px;
    }

    /* Finish Button noch prominenter auf Mobile */
    #wizard-finish:not([disabled]) {
        min-height: 58px;
        font-size: 1.15rem;
        animation: subtle-pulse 2s ease-in-out infinite;
    }

    @keyframes subtle-pulse {
        0%, 100% {
            box-shadow:
                0 4px 20px rgba(16, 185, 129, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.1);
        }
        50% {
            box-shadow:
                0 6px 28px rgba(16, 185, 129, 0.55),
                0 3px 6px rgba(0, 0, 0, 0.12);
        }
    }

    /* Discount Button auf Mobile - Tertiary-Style beibehalten */
    #discount-apply {
        min-height: 44px;
        flex: 1;
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    /* Price Summary Mobile Anpassung */
    [data-wizard-step="4"] .text-right {
        text-align: center;
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    #sum-price {
        font-size: 2.75rem;
    }

    /* Scroll-Padding für Sticky Nav */
    [data-wizard-step="4"] {
        scroll-padding-bottom: 120px;
        padding-bottom: 1rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    #sum-price {
        font-size: 2.25rem;
    }

    .wizard-navigation {
        padding: 0.85rem 0.85rem 1rem;
    }

    #wizard-finish:not([disabled]) {
        min-height: 54px;
        font-size: 1.05rem;
    }
}

/* -------------------------------------------
   4. RABATTCODE SEKTION - VERBESSERT
   ------------------------------------------- */

/* Discount Code Container */
[data-wizard-step="4"] .glass-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
}

/* ========================================
   ISSUE #142: MOBILE TOUCH TARGETS (min. 44x44px)
   Apple Human Interface Guidelines compliant
   ======================================== */

/* -------------------------------------------
   5. FOOTER LINKS - 44px Touch Targets
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* Footer Contact Links */
    .footer-contact-link,
    .site-footer a,
    footer a:not(.btn-primary):not(.btn-secondary) {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 8px;
        margin: 2px 0;
        touch-action: manipulation;
    }

    /* Footer Links in Lists */
    .footer-links a,
    .footer-nav a,
    footer ul a,
    footer li a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 0;
        width: 100%;
    }

    /* Footer Grid Spacing for Touch */
    .footer-links li,
    .footer-nav li,
    footer ul li {
        margin-bottom: 4px;
    }
}

/* -------------------------------------------
   6. FAQ ACCORDIONS - 44px Touch Targets
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* FAQ Accordion Headers/Summaries */
    .faq-item summary,
    .faq-accordion summary,
    .accordion-header,
    .accordion-trigger,
    details.faq summary,
    #faq details summary,
    .wp-block-details summary,
    [data-accordion] > button,
    [data-accordion] summary {
        min-height: 48px;
        padding: 14px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* FAQ Content Links */
    .faq-item a,
    .faq-accordion a,
    #faq a,
    .wp-block-details a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 4px;
    }

    /* Accordion Expand Icon Area */
    .faq-item summary::after,
    .faq-accordion summary::after,
    details.faq summary i,
    details.faq summary svg {
        min-width: 24px;
        min-height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* -------------------------------------------
   7. HEADER CONTACT LINKS - 44px Touch Targets
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* Header Contact Links */
    .header-contact-link,
    header a[href^="tel:"],
    header a[href^="mailto:"],
    .site-header a[href^="tel:"],
    .site-header a[href^="mailto:"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        touch-action: manipulation;
    }

    /* Mobile Contact Buttons */
    .mobile-contact-button {
        min-height: 48px;
        padding: 12px 16px;
    }
}

/* -------------------------------------------
   8. TELEFON/E-MAIL LINKS - 44px Touch Targets
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* All Tel/Email Links across the site */
    a[href^="tel:"],
    a[href^="mailto:"] {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 12px;
        margin: 2px 0;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Contact section specific */
    .contact-info a,
    .kontakt a,
    #kontakt a {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 48px;
        padding: 12px 8px;
    }
}

/* -------------------------------------------
   9. SOCIAL MEDIA ICONS - 44px Touch Targets
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* Social Media Links */
    .social-links a,
    .social-icons a,
    .footer-social a,
    [class*="social"] a,
    a[href*="facebook.com"],
    a[href*="instagram.com"],
    a[href*="twitter.com"],
    a[href*="linkedin.com"],
    a[href*="youtube.com"],
    a[href*="tiktok.com"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        touch-action: manipulation;
    }

    /* Social Icons inside */
    .social-links a svg,
    .social-links a i,
    .social-icons a svg,
    .social-icons a i,
    .footer-social a svg,
    .footer-social a i {
        width: 24px;
        height: 24px;
    }
}

/* -------------------------------------------
   10. GENERAL LINK SPACING (8px minimum gap)
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* Ensure minimum 8px spacing between adjacent touch targets */
    footer li + li,
    .footer-links li + li,
    .footer-nav li + li,
    .social-links a + a,
    .social-icons a + a {
        margin-top: 8px;
    }

    /* Horizontal link groups */
    .social-links,
    .social-icons,
    .footer-social {
        gap: 8px;
    }
}

/* -------------------------------------------
   11. ENHANCED TAP FEEDBACK
   ------------------------------------------- */

@media (max-width: 768px) and (pointer: coarse) {
    /* Active state for all touch targets */
    .footer-contact-link:active,
    footer a:active,
    .faq-item summary:active,
    .accordion-trigger:active,
    a[href^="tel:"]:active,
    a[href^="mailto:"]:active,
    .social-links a:active {
        opacity: 0.8;
        transform: scale(0.98);
        transition: transform 0.1s ease, opacity 0.1s ease;
    }

    /* Focus visible for accessibility */
    .footer-contact-link:focus-visible,
    footer a:focus-visible,
    .faq-item summary:focus-visible,
    a[href^="tel:"]:focus-visible,
    a[href^="mailto:"]:focus-visible {
        outline: 2px solid rgba(6, 182, 212, 0.8);
        outline-offset: 2px;
        border-radius: 4px;
    }
}

/* Discount Code Input */
#discount-code-input {
    background: rgba(15, 17, 32, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: white;
    transition: all 0.3s ease;
}

#discount-code-input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

#discount-code-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.05em;
    font-weight: 400;
}

/* Discount Feedback */
#discount-feedback {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

#discount-feedback:not(:empty) {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Remove Button Style */
#discount-remove {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#discount-remove:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #FEE2E2;
}

/* ===========================================
   12. ISSUE #168: Mobile Kalender-Steuerung Fix
   =========================================== */

/* Kalendertage im Buchungsprozess: Touch-Optimierung */
#wz-cal-grid .calendar-day {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Nested Elemente: Events an Button delegieren */
#wz-cal-grid .day-number,
#wz-cal-grid .calendar-day__seats-count,
#wz-cal-grid .availability-label {
    pointer-events: none;
}

/* Navigation-Buttons: Touch-Optimierung */
.booking-calendar__nav {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Icons in Navigation-Buttons: Events an Button delegieren */
.booking-calendar__nav svg,
.booking-calendar__nav i {
    pointer-events: none;
}
