/* MSA Order Engine - Frontend Styles v2.2.0 */

/* ========================================
   MSA BRAND COLORS & VARIABLES
   ======================================== */
:root {
    /* Plugin-spezifische Variables (bleiben für Backward-Compat) */
    --msaoe-primary: #ff9933;
    --msaoe-primary-dark: #e68a2e;
    --msaoe-primary-light: #ffad5c;
    --msaoe-secondary: #9b59b6;
    --msaoe-success: #28a745;
    --msaoe-text: #333333;
    --msaoe-text-light: #6c757d;
    --msaoe-border: #dee2e6;
    --msaoe-radius: 12px;
    --msaoe-radius-sm: 8px;
    
    /* Aliase zu MSA Core Design Tokens (falls geladen) */
    /* Ermöglicht schrittweise Migration zu --msa-* */
}

/* Single Event Page - Content Positioning */
body.single-msaoe_event .site-content,
body.single-msaoe_event .content-area,
body.single-msaoe_event main {
    padding-top: 100px; /* Space for fixed header */
}

body.single-msaoe_event .entry-title,
body.single-msaoe_event .page-title,
body.single-msaoe_event h1.wp-block-post-title {
    margin-top: 0;
}

/* ========================================
   BUTTONS - MSA Brand Consistent
   ======================================== */
.msaoe-button {
    display: inline-block;
    padding: 14px 28px;
    background: var(--msaoe-primary);
    color: white !important;
    border: none;
    border-radius: var(--msaoe-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.msaoe-button:hover {
    background: var(--msaoe-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 51, 0.3);
    color: white !important;
}

.msaoe-button:active {
    transform: translateY(0);
}

/* Primary Button - Same as default (orange) */
.msaoe-button-primary {
    background: linear-gradient(135deg, var(--msaoe-primary), var(--msaoe-primary-dark));
}

.msaoe-button-primary:hover {
    background: linear-gradient(135deg, var(--msaoe-primary-dark), #d4791f);
    box-shadow: 0 6px 20px rgba(255, 153, 51, 0.4);
}

/* Secondary Button - Gray outlined style (consistent everywhere) */
.msaoe-button-secondary {
    background: #fff !important;
    border: 2px solid #ddd !important;
    color: #666 !important;
}

.msaoe-button-secondary:hover {
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ccc !important;
}

/* Block Button */
.msaoe-button-block {
    display: block;
    width: 100%;
}

/* Disabled Button */
.msaoe-button-disabled,
.msaoe-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   CHECKOUT STYLES
   ======================================== */
.msaoe-checkout {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
}

.msaoe-countdown {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: var(--msaoe-radius-sm);
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.msaoe-countdown-icon {
    font-size: 1.1em;
    vertical-align: middle;
    line-height: 1;
}

.msaoe-countdown-text {
    flex: 1;
}

.msaoe-countdown-warning {
    background: #f8d7da;
    border-color: #dc3545;
}

.msaoe-countdown-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
    width: 120px;
    flex-shrink: 0;
}

.msaoe-countdown-progress {
    height: 100%;
    background: var(--msaoe-success);
    transition: width 1s linear;
}

.msaoe-progress {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 15px 0;
}

.msaoe-progress-step {
    text-align: center;
}

.msaoe-progress-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    background: #dee2e6;
    margin-bottom: 5px;
    font-size: 14px;
}

.msaoe-progress-step.active .msaoe-progress-number {
    background: var(--msaoe-primary);
    color: white;
}

.msaoe-progress-label {
    font-size: 13px;
}

.msaoe-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 4px 0;
}

.msaoe-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
    color: #333;
}

.msaoe-form-field input,
.msaoe-form-field input[type="text"],
.msaoe-form-field input[type="email"],
.msaoe-form-field input[type="tel"],
.msaoe-form-field input[type="date"],
.msaoe-form-field input[type="number"],
.msaoe-form-field select,
.msaoe-form-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid var(--msaoe-border) !important;
    border-radius: var(--msaoe-radius-sm) !important;
    font-size: 0.9em;
    color: #1a1a1a; /* Darker text for better readability */
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff !important;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Select dropdown arrow */
.msaoe-form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

/* Focus state - Orange */
.msaoe-form-field input:focus,
.msaoe-form-field input[type="text"]:focus,
.msaoe-form-field input[type="email"]:focus,
.msaoe-form-field input[type="tel"]:focus,
.msaoe-form-field input[type="date"]:focus,
.msaoe-form-field input[type="number"]:focus,
.msaoe-form-field select:focus,
.msaoe-form-field textarea:focus {
    outline: none !important;
    border-color: var(--msaoe-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.15) !important;
}

/* Filled/valid state - Orange tint */
.msaoe-form-field input:not(:placeholder-shown),
.msaoe-form-field input[type="date"]:not([value=""]),
.msaoe-form-field select:valid,
.msaoe-form-field textarea:not(:placeholder-shown) {
    border-color: var(--msaoe-primary-light) !important;
    background: #fffaf5 !important;
}

/* Read-only pre-filled fields */
.msaoe-form-field input[readonly],
.msaoe-form-field input:read-only {
    background: #fff8f0 !important;
    border-color: var(--msaoe-primary-light) !important;
    color: var(--msaoe-text);
}

/* Section headings compact */
.msaoe-section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 15px 0 8px;
    color: #333;
}

.msaoe-section-subtitle {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
    font-weight: 400;
}

.msaoe-participant {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: var(--msaoe-radius-sm);
    margin-bottom: 4px;
}

.msaoe-participant-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--msaoe-primary);
    margin-bottom: 2px;
}

/* Participants Box - INLINE COMPACT */
.msaoe-participants-box {
    padding: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    margin-top: 4px;
}

.msaoe-participant-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.msaoe-participant-inline.msaoe-has-border {
    border-bottom: 1px dashed #ddd;
    margin-bottom: 4px;
    padding-bottom: 8px;
}

.msaoe-p-label {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    flex-shrink: 0;
}

.msaoe-participant-inline input[type="text"],
.msaoe-participant-inline input[type="date"] {
    flex: 1;
    padding: 8px 10px !important;
    border: 2px solid var(--msaoe-border) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #1a1a1a !important; /* Darker text for better readability */
    min-width: 0;
    height: 38px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    margin: 0 !important;
}

.msaoe-participant-inline input[type="date"] {
    flex: 0 0 140px;
}

/* Mobile-only label for birthdate - hidden on desktop */
.msaoe-mobile-label {
    display: none;
}

.msaoe-participant-inline input:focus {
    outline: none;
    border-color: var(--msaoe-primary);
}

/* Legacy classes - keep for compatibility */
.msaoe-participant-row {
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #e0e0e0;
}

.msaoe-participant-row.msaoe-last {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.msaoe-participant-label {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    color: #555;
}

/* Mobile: Stack vertically */
@media (max-width: 600px) {
    .msaoe-participant-inline {
        flex-wrap: wrap;
    }
    .msaoe-participant-inline input[type="text"] {
        flex: 1 1 45%;
    }
    .msaoe-participant-inline input[type="date"] {
        flex: 1 1 100%;
    }
    /* Show birthdate label on mobile */
    .msaoe-mobile-label {
        display: block;
        flex: 1 1 100%;
        font-size: 12px;
        font-weight: 600;
        color: #555;
        margin-top: 8px;
        margin-bottom: 2px;
    }
}

/* Orderer Inline Fields - SAME STYLE AS PARTICIPANTS */
.msaoe-orderer-box {
    padding: 6px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: #fafafa !important;
    margin-top: 4px !important;
}

.msaoe-orderer-inline {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
}

.msaoe-orderer-inline:last-child {
    margin-bottom: 0 !important;
}

.msaoe-orderer-inline input,
.msaoe-orderer-box input,
.msaoe-orderer-box .msaoe-orderer-inline input {
    flex: 1;
    padding: 8px 10px !important;
    border: 2px solid var(--msaoe-border) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #1a1a1a !important; /* Darker text for better readability */
    min-width: 0;
    height: 38px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.msaoe-orderer-inline input:focus,
.msaoe-orderer-box input:focus {
    outline: none;
    border-color: var(--msaoe-primary) !important;
}

/* Address row field widths */
.msaoe-orderer-address .msaoe-field-street { flex: 2; }
.msaoe-orderer-address .msaoe-field-nr { flex: 0 0 60px; }
.msaoe-orderer-address .msaoe-field-plz { flex: 0 0 80px; }
.msaoe-orderer-address .msaoe-field-city { flex: 1; }

@media (max-width: 600px) {
    .msaoe-orderer-inline {
        flex-wrap: wrap;
    }
    /* All inputs: 2 per row on mobile */
    .msaoe-orderer-inline input {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
    }
    /* Address row: street 70%, nr 25%, then plz 30%, city 65% */
    .msaoe-orderer-address .msaoe-field-street { flex: 1 1 70% !important; }
    .msaoe-orderer-address .msaoe-field-nr { flex: 1 1 25% !important; }
    .msaoe-orderer-address .msaoe-field-plz { flex: 1 1 30% !important; }
    .msaoe-orderer-address .msaoe-field-city { flex: 1 1 65% !important; }
}

/* Checkout actions row */
.msaoe-checkout-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* Secondary Button (Back) - Consistent across all steps */
.msaoe-button-secondary,
.msaoe-checkout-actions .msaoe-button-secondary,
a.msaoe-button-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px !important;
    background: #fff !important;
    color: #666 !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    height: 44px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
}

.msaoe-button-secondary:hover,
.msaoe-checkout-actions .msaoe-button-secondary:hover,
a.msaoe-button-secondary:hover {
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ccc !important;
}

/* Primary Button - Same height as secondary */
.msaoe-checkout-actions .msaoe-button-primary,
.msaoe-checkout-actions .msaoe-submit {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 24px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.msaoe-link-secondary {
    font-size: 13px;
    color: var(--msaoe-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

.msaoe-payment-method {
    display: block;
    border: 2px solid var(--msaoe-border);
    border-radius: var(--msaoe-radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.msaoe-payment-method:hover {
    border-color: var(--msaoe-primary-light);
}

.msaoe-payment-method:has(input:checked) {
    border-color: var(--msaoe-primary);
    background: #fff8f0;
}

/* Info banner compact */
.msaoe-info-banner {
    padding: 10px 15px;
    margin-bottom: 12px;
    border-radius: var(--msaoe-radius-sm);
    font-size: 14px;
}

/* Hide discover more on checkout */
.msaoe-checkout .msaoe-discover-more {
    display: none;
}

/* Submit button prominent */
.msaoe-checkout .msaoe-button-primary {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .msaoe-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .msaoe-form-grid {
        grid-template-columns: 1fr;
    }
    
    .msaoe-countdown {
        flex-direction: column;
        text-align: center;
    }
    
    .msaoe-countdown-bar {
        width: 100%;
    }
}

/* ========================================
   MODAL STYLES
   ======================================== */
.msaoe-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.msaoe-modal {
    background: white;
    border-radius: var(--msaoe-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

.msaoe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--msaoe-border);
}

.msaoe-modal-header h2 {
    margin: 0;
    color: var(--msaoe-success);
}

.msaoe-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--msaoe-text-light);
    line-height: 1;
}

.msaoe-modal-body {
    padding: 30px 20px;
}

.msaoe-modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.msaoe-modal-actions .msaoe-button {
    flex: 1;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ========================================
   EVENTS LISTING
   ======================================== */
.msaoe-events-listing {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.msaoe-events-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--msaoe-radius-sm);
    margin-bottom: 30px;
}

/* Mobile Filter Toggle */
.msaoe-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid var(--msaoe-border);
    border-radius: var(--msaoe-radius-sm);
    margin-bottom: 10px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.msaoe-filter-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .msaoe-filter-toggle {
        display: block;
    }
    
    .msaoe-events-filters {
        display: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        margin-top: 0;
    }
    
    .msaoe-events-filters.msaoe-filters-visible {
        display: block;
    }
}

.msaoe-filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.msaoe-filter-group {
    flex: 1;
    min-width: 200px;
}

.msaoe-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.msaoe-filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--msaoe-border);
    border-radius: var(--msaoe-radius-sm);
}

.msaoe-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.msaoe-event-card {
    background: white;
    border: 1px solid var(--msaoe-border);
    border-radius: var(--msaoe-radius-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.msaoe-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.msaoe-event-thumbnail {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: #f8f9fa;
}

.msaoe-event-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msaoe-event-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--msaoe-primary);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.msaoe-event-content {
    padding: 20px;
}

.msaoe-event-title {
    margin: 0 0 15px;
    font-size: 20px;
    color: var(--msaoe-text);
}

.msaoe-event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--msaoe-text-light);
}

.msaoe-event-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.msaoe-event-meta-item .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.msaoe-event-excerpt {
    font-size: 14px;
    color: var(--msaoe-text-light);
    margin-bottom: 15px;
}

.msaoe-event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--msaoe-border);
}

.msaoe-event-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--msaoe-success);
}

.msaoe-availability-ok {
    color: var(--msaoe-success);
    font-size: 14px;
}

.msaoe-availability-full {
    color: #dc3545;
    font-size: 14px;
    font-weight: bold;
}

.msaoe-no-events {
    text-align: center;
    padding: 60px 20px;
    color: var(--msaoe-text-light);
}

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

/* Checkout Step Hints */
.msaoe-step-hint {
    color: var(--msaoe-text-light);
    font-size: 0.9em;
    margin: -0.5em 0 1.5em;
    padding: 0.75em 1em;
    background: #F3EDFA;
    border-radius: var(--msaoe-radius-sm);
    color: #6B4FA3;
}

/* ========================================
   COOKIE WARNING
   ======================================== */
.msaoe-cookie-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 15px;
    border-radius: var(--msaoe-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.msaoe-cookie-warning strong {
    display: block;
    margin-bottom: 5px;
    color: #856404;
}

.msaoe-cookie-warning a {
    color: var(--msaoe-primary-dark);
    text-decoration: underline;
    font-weight: 600;
}

.msaoe-cookie-warning a:hover {
    color: var(--msaoe-primary);
}

/* ========================================
   NOTICE BOXES
   ======================================== */
.msaoe-notice {
    padding: 20px;
    border-radius: var(--msaoe-radius-sm);
    margin-bottom: 20px;
}

.msaoe-notice p {
    margin: 0 0 10px;
}

.msaoe-notice p:last-child {
    margin-bottom: 0;
}

.msaoe-notice-info {
    background: #f5f0ff;
    border: 1px solid #d8b4fe;
    color: #6b21a8;
}

.msaoe-notice-success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.msaoe-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    color: #664d03;
}

.msaoe-notice-error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

.msaoe-notice a {
    color: inherit;
    text-decoration: underline;
}

.msaoe-notice .msaoe-button {
    margin-top: 10px;
}

.msaoe-notice .msaoe-button-secondary {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit !important;
}

.msaoe-notice .msaoe-button-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Payment method selected state (when only one option) */
.msaoe-payment-selected {
    display: block;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid var(--msaoe-primary);
    border-radius: var(--msaoe-radius-sm);
}

.msaoe-payment-selected .msaoe-payment-label {
    display: block;
}

.msaoe-payment-selected .msaoe-payment-label strong {
    display: block;
    font-size: 1.1em;
    color: var(--msaoe-text);
}

.msaoe-payment-selected .msaoe-payment-desc {
    color: var(--msaoe-text-light);
    font-size: 0.9em;
}

/* ========================================
   4-COLUMN FORM GRID
   ======================================== */
.msaoe-form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 992px) {
    .msaoe-form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .msaoe-form-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   3-COLUMN GRID (Participants: Vorname, Nachname, Geburtsdatum)
   ======================================== */
.msaoe-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 768px) {
    .msaoe-form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .msaoe-form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ADDRESS FORM GRID (Straße, Nr, PLZ, Ort)
   ======================================== */
.msaoe-form-grid-address {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 2fr;
    gap: 15px;
}

.msaoe-field-street {
    grid-column: 1;
}

.msaoe-field-house-number {
    grid-column: 2;
}

.msaoe-field-zip {
    grid-column: 3;
}

.msaoe-field-city {
    grid-column: 4;
}

@media (max-width: 768px) {
    .msaoe-form-grid-address {
        grid-template-columns: 3fr 1fr;
    }
    
    .msaoe-field-street {
        grid-column: 1;
    }
    
    .msaoe-field-house-number {
        grid-column: 2;
    }
    
    .msaoe-field-zip {
        grid-column: 1;
    }
    
    .msaoe-field-city {
        grid-column: 2;
    }
}

@media (max-width: 480px) {
    .msaoe-form-grid-address {
        grid-template-columns: 1fr;
    }
    
    .msaoe-field-street,
    .msaoe-field-house-number,
    .msaoe-field-zip,
    .msaoe-field-city {
        grid-column: 1;
    }
}

/* ========================================
   CONTINUE SHOPPING LINK
   ======================================== */
.msaoe-continue-shopping {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    text-align: center;
}

.msaoe-continue-shopping-link {
    color: var(--msaoe-primary, #667eea);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.msaoe-continue-shopping-link:hover {
    color: var(--msaoe-primary-dark, #5a67d8);
    text-decoration: underline;
}

/* Sections */
.msaoe-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--msaoe-border);
}

.msaoe-section:last-child {
    border-bottom: none;
}

.msaoe-section h3 {
    margin: 0 0 10px;
    font-size: 1.1em;
    color: var(--msaoe-text);
}

/* Compact notice */
.msaoe-notice-compact {
    padding: 10px 15px;
    margin-bottom: 15px;
}

/* Participant header with checkbox */
.msaoe-participant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.msaoe-participant-header h4 {
    margin: 0;
    font-size: 1em;
    color: var(--msaoe-text);
}

.msaoe-copy-data-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: var(--msaoe-text-light);
    cursor: pointer;
}

.msaoe-copy-data-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Age info styling */
.msaoe-age-info {
    margin: 0 0 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: var(--msaoe-radius-sm);
    font-size: 0.95em;
    color: var(--msaoe-text);
}

.msaoe-age-info strong {
    color: var(--msaoe-primary-dark);
}

/* Age feedback messages */
.msaoe-age-feedback {
    margin-top: 6px;
    font-size: 0.85em;
    min-height: 20px;
}

.msaoe-age-feedback.age-ok {
    color: var(--msaoe-success);
}

.msaoe-age-feedback.age-ok::before {
    content: '✓ ';
}

.msaoe-age-feedback.age-warning {
    color: #856404;
    background: #fff3cd;
    padding: 6px 10px;
    border-radius: 4px;
}

.msaoe-age-feedback.age-warning::before {
    content: '⚠️ ';
}

.msaoe-age-feedback.age-error {
    color: #721c24;
    background: #f8d7da;
    padding: 6px 10px;
    border-radius: 4px;
}

.msaoe-age-feedback.age-error::before {
    content: '❌ ';
}

/* Participant cards */
.msaoe-participant {
    padding: 20px;
    background: #fafafa;
    border-radius: var(--msaoe-radius-sm);
    margin-bottom: 15px;
    border: 1px solid var(--msaoe-border);
}

.msaoe-participant:last-child {
    margin-bottom: 0;
}

/* Event participants container */
.msaoe-event-participants {
    margin-bottom: 20px;
}

.msaoe-event-participants:last-child {
    margin-bottom: 0;
}

/* Copy from participant checkbox */
.msaoe-copy-from-participant {
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #e8f4e8;
    border: 1px solid #c3e6c3;
    border-radius: var(--msaoe-radius-sm);
}

.msaoe-copy-from-participant .msaoe-copy-data-checkbox {
    margin: 0;
    color: #2d5a2d;
    font-weight: 500;
}

.msaoe-copy-from-participant .msaoe-copy-data-checkbox input[type="checkbox"] {
    accent-color: var(--msaoe-success);
}

/* ========================================
   TRUST BADGES
   ======================================== */
.msaoe-trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--msaoe-border);
}

.msaoe-trust-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    color: var(--msaoe-text-light);
}

.msaoe-trust-icon {
    font-size: 1.1em;
}

.msaoe-trust-text {
    white-space: nowrap;
}

/* Checkout-spezifische Trust Badges */
.msaoe-trust-badges-checkout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--msaoe-radius-sm);
    border-top: none;
}

.msaoe-trust-badges-checkout .msaoe-trust-badge {
    justify-content: flex-start;
    font-size: 0.85em;
    color: var(--msaoe-text);
}

.msaoe-trust-badges-checkout .msaoe-trust-icon {
    width: 20px;
    text-align: center;
}

@media (max-width: 576px) {
    .msaoe-trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .msaoe-trust-badges-checkout {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   URGENCY INDICATORS (Booking Widget)
   ======================================== */
.msaoe-availability-indicator {
    padding: 8px 12px;
    border-radius: var(--msaoe-radius-sm);
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
}

.msaoe-urgency-critical {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    animation: pulse-urgency 1.5s ease-in-out infinite;
}

.msaoe-urgency-high {
    background: linear-gradient(135deg, #ff9933 0%, #e67300 100%);
    color: white;
}

.msaoe-urgency-medium {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #333;
}

.msaoe-urgency-time {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

@keyframes pulse-urgency {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========================================
   COMPACT CHECKOUT LAYOUT
   ======================================== */

/* Checkout Header mit Countdown inline */
.msaoe-checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--msaoe-primary);
}

.msaoe-checkout-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--msaoe-text);
    margin: 0;
}

.msaoe-countdown-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95em;
    color: #856404;
}

.msaoe-countdown-inline.msaoe-countdown-warning {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    animation: pulse-countdown 1s ease-in-out infinite;
}

@keyframes pulse-countdown {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Kompakter Progress-Indikator */
.msaoe-progress-compact {
    margin-bottom: 15px;
    padding: 10px 0;
}

/* Kompakte Sections */
.msaoe-section-compact {
    margin-bottom: 20px;
}

.msaoe-section-compact h3 {
    margin: 0 0 10px;
    font-size: 1em;
    font-weight: 600;
    color: var(--msaoe-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Kompakte Teilnehmer-Boxen */
.msaoe-checkout-compact .msaoe-participant {
    padding: 15px;
    margin-bottom: 10px;
    background: #fafafa;
    border: 1px solid var(--msaoe-border);
    border-radius: var(--msaoe-radius-sm);
}

.msaoe-checkout-compact .msaoe-participant h4 {
    margin: 0 0 10px;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--msaoe-primary-dark);
}

/* Kompakte Age-Info */
.msaoe-checkout-compact .msaoe-age-info {
    margin: 0 0 10px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: var(--msaoe-radius-sm);
    font-size: 0.85em;
}

.msaoe-checkout-compact .msaoe-age-info strong {
    color: var(--msaoe-primary-dark);
}

/* Keine extra Margins für event-participants */
.msaoe-checkout-compact .msaoe-event-participants {
    margin-bottom: 0;
}

/* Kompaktere Form-Fields */
.msaoe-checkout-compact .msaoe-form-field label {
    font-size: 0.85em;
    margin-bottom: 3px;
}

.msaoe-checkout-compact .msaoe-form-field input {
    padding: 8px 10px;
    font-size: 0.95em;
}

/* Trust Badges im Checkout - 3er Grid */
.msaoe-trust-badges-checkout {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .msaoe-checkout-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .msaoe-trust-badges-checkout {
        grid-template-columns: 1fr;
    }
}

/* Hide default page title when using compact checkout */
.msaoe-checkout-compact + .entry-title,
.page-template-checkout .entry-title,
body.page .msaoe-checkout-compact ~ .entry-title {
    display: none;
}

/* Also hide via parent - WordPress often wraps title */
.msaoe-checkout-compact {
    /* Ensure our header is the main title */
}

/* For themes that put title before content */
.entry-header:has(+ .entry-content .msaoe-checkout-compact) .entry-title {
    display: none;
}

/* ========================================
   HIDE THEME CTA ON CHECKOUT PAGES
   ======================================== */

/* Hide "Nächster Schritt: Probestunde vereinbaren" on checkout pages */
.msaoe-checkout-compact ~ *,
.msaoe-checkout ~ * {
    /* Don't hide siblings - need more specific selector */
}

/* Target common CTA patterns that shouldn't appear on checkout */
body.page .msaoe-checkout-compact ~ .elementor-section,
body.page .entry-content:has(.msaoe-checkout) ~ *,
.msaoe-checkout-compact + .wp-block-group,
.msaoe-checkout-compact + section,
.msaoe-checkout + .wp-block-group,
.msaoe-checkout + section {
    display: none !important;
}

/* More specific: hide any section with "Probestunde" after checkout */
.entry-content .msaoe-checkout-compact ~ *:not(script):not(style) {
    display: none !important;
}

/* ========================================
   INLINE SECTION HEADERS
   ======================================== */
.msaoe-section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.msaoe-section-header h3 {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    color: var(--msaoe-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msaoe-section-hint {
    font-size: 0.85em;
    color: var(--msaoe-text-light);
    font-weight: 400;
}

/* ========================================
   COMPACT PARTICIPANT TITLE
   ======================================== */
.msaoe-participant-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.msaoe-participant-number {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--msaoe-text);
}

.msaoe-participant-number:empty {
    display: none;
}

.msaoe-participant-event {
    font-size: 0.85em;
    color: var(--msaoe-primary-dark);
}

.msaoe-participant-age {
    color: var(--msaoe-text-light);
    font-weight: 400;
}

/* Remove old age-info box styling */
.msaoe-checkout-compact .msaoe-age-info {
    display: none;
}

/* Make participant boxes tighter */
.msaoe-checkout-compact .msaoe-participant {
    padding: 12px 15px;
    margin-bottom: 8px;
}

.msaoe-checkout-compact .msaoe-event-participants {
    margin-bottom: 0;
}

/* ========================================
   EVENT HEADER + PARTICIPANT ROWS
   ======================================== */
.msaoe-event-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px 10px;
    /* background removed - set via inline style with event-specific color */
    border-radius: var(--msaoe-radius-sm);
}

.msaoe-event-header .msaoe-event-title {
    font-weight: 600;
    font-size: 0.85em;
    /* color removed - set via inline style with event-specific color */
    line-height: 1.3;
    margin: 0;
}

.msaoe-event-datetime {
    font-size: 0.78em;
    font-weight: 400;
    line-height: 1.3;
}

.msaoe-event-tagline {
    font-size: 0.76em;
    font-style: italic;
    font-weight: 400;
    line-height: 1.3;
}

.msaoe-summary-datetime {
    color: #666;
    font-size: 0.85em;
}

/* Altersanzeige im Header ausblenden - Validierung erfolgt beim Geburtsdatum */
.msaoe-event-age {
    display: none;
}

.msaoe-participants-group {
    overflow: hidden;
}

/* Event groups spacing */
.msaoe-event-participants + .msaoe-event-participants {
    margin-top: 12px;
}

/* Remove old participant styling */
.msaoe-checkout-compact .msaoe-participant {
    padding: 0;
    margin-bottom: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.msaoe-participant-title,
.msaoe-participant-number,
.msaoe-participant-event {
    display: none;
}

/* ========================================
   AVAILABILITY STATES (EventsListing)
   ======================================== */
.msaoe-availability-critical {
    color: #dc3545;
    font-weight: 600;
    animation: msaoe-pulse 2s infinite;
}

.msaoe-availability-low {
    color: #fd7e14;
    font-weight: 500;
}

.msaoe-availability-ok {
    color: var(--msaoe-success);
}

.msaoe-availability-full {
    color: #6c757d;
    font-style: italic;
}

@keyframes msaoe-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   CHECKOUT PAGE POSITIONING
   Orangene Linie bündig mit Logo/Hamburger-Unterkante (~96px)
   Speziell für MSA-2025-Theme
   ======================================== */

/* MSA-2025-Theme: Override inline padding from page.php */
body.page .msa-standard-page:has(.msaoe-checkout-wrapper),
.msa-standard-page:has(.msaoe-checkout-wrapper) {
    padding-top: 20px !important;
    padding-bottom: 40px !important;
}

/* Hide the default page title (Checkout has its own) */
body.page .entry-header:has(+ .entry-content .msaoe-checkout-wrapper),
body.page article:has(.msaoe-checkout-wrapper) > .entry-header,
.msa-standard-page .entry-header:has(~ .entry-content .msaoe-checkout-wrapper) {
    display: none !important;
}

/* Fallback für Browser ohne :has() Support */
body.page-template-default .entry-header {
    /* Nur auf Checkout-Seite per JS ausblenden */
}

/* Checkout wrapper selbst */
.msaoe-checkout-wrapper {
    margin-top: 0;
    padding-top: 0;
}

/* Header-Bereich kompakter */
.msaoe-checkout-header {
    padding-top: 0;
    margin-bottom: 12px;
}

/* Für Elementor-Seiten */
.elementor-page .msaoe-checkout-wrapper,
.elementor .msaoe-checkout-wrapper {
    margin-top: 0;
}

/* ========================================
   AGE FEEDBACK AUSBLENDEN
   Validierung erfolgt nur bei Submit, nicht live
   ======================================== */
.msaoe-age-feedback {
    display: none !important;
}

/* ========================================
   BUTTON CONSISTENCY
   Alle Buttons mit gleichem Radius (12px)
   ======================================== */
.msaoe-step-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.msaoe-step-buttons .msaoe-button {
    border-radius: 6px;
    padding: 0 24px;
    font-weight: 600;
    min-width: 140px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Zurück-Button in step-buttons: Use same style as checkout-actions */
.msaoe-step-buttons .msaoe-prev-step {
    background: #fff !important;
    border: 2px solid #ddd !important;
    color: #666 !important;
    border-radius: 6px !important;
}

.msaoe-step-buttons .msaoe-prev-step:hover {
    background: #f5f5f5 !important;
    color: #333 !important;
    border-color: #ccc !important;
}

/* Submit-Button: Solid Orange */
.msaoe-step-buttons .msaoe-submit {
    background: var(--msaoe-primary);
    border: 2px solid var(--msaoe-primary);
    color: white !important;
    border-radius: 6px !important;
}

.msaoe-step-buttons .msaoe-submit:hover {
    background: var(--msaoe-primary-dark);
    border-color: var(--msaoe-primary-dark);
}

/* ========================================
   PAYMENT METHOD OPTIONS
   ======================================== */

/* Payment Options */
.msaoe-payment-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.msaoe-payment-option:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.msaoe-payment-option.msaoe-payment-selected {
    border-color: #ff9933;
    background: #fff5eb;
}

.msaoe-payment-option input[type="radio"] {
    margin-top: 4px;
    flex-shrink: 0;
}

.msaoe-payment-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msaoe-payment-desc {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: normal;
}

/* ========================================
   HIDE "NÄCHSTER SCHRITT" TEXT VIA CSS (Fallback)
   ======================================== */

/* Hide elements with specific data attribute */
[data-hide-trial-text="true"] {
    display: none !important;
}

/* CSS-only approach for known selectors (if applicable) */
body.post-type-archive-msaoe_event section:has(h2:contains("Nächster Schritt")),
body.post-type-archive-msaoe_event section:has(h3:contains("Probestunde vereinbaren")) {
    /* Note: :contains() is not standard CSS, handled by JS instead */
}
