/**
 * Remmerzelt Reservation — Reservierungsformular Styles
 */

/* Form sections */
.remmerzelt-form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.remmerzelt-form-section:last-of-type {
    border-bottom: none;
}

.remmerzelt-form-section h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
}

.remmerzelt-form-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

/* Table summary */
.remmerzelt-form-table-summary {
    width: 100%;
    border-collapse: collapse;
}

.remmerzelt-form-table-summary td {
    padding: 4px 8px;
    font-size: 14px;
}

.remmerzelt-form-total {
    margin-top: 8px;
    font-size: 15px;
}

/* Food rows */
.remmerzelt-food-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.remmerzelt-food-row:last-child {
    border-bottom: none;
}

.remmerzelt-food-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.remmerzelt-food-info strong {
    font-size: 14px;
}

.remmerzelt-food-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.remmerzelt-food-allergens {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
    font-style: italic;
}

.remmerzelt-food-qty {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Pricing */
.remmerzelt-pricing-summary {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.remmerzelt-pricing-table {
    width: 100%;
    border-collapse: collapse;
}

.remmerzelt-pricing-table td {
    padding: 6px 0;
    font-size: 14px;
}

.remmerzelt-price-value {
    text-align: right;
    white-space: nowrap;
}

/* Honeypot anti-spam — display:none entfernt das Feld komplett aus dem AT-Baum.
   Off-screen-Positionierung (links: -9999px) wäre für Screen-Reader weiterhin
   erreichbar; CLAUDE.md-Anti-Pattern. Inline `style="display:none"` im HTML
   greift zuerst, diese Klasse ist defensiver Fallback. */
.remmerzelt-hp-wrap {
    display: none !important;
    visibility: hidden;
}

/* Contact form fields */
.remmerzelt-form-field {
    margin-bottom: 14px;
}

.remmerzelt-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.remmerzelt-form-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.remmerzelt-form-field input:focus-visible,
.remmerzelt-form-field textarea:focus-visible,
.remmerzelt-form-field select:focus-visible {
    /* WCAG 2.4.11: solid 2 px outline in #1976D2 (~4.6:1 vs. white) löst die
       alte 0.15-Opacity-Shadow-Lösung ab, die unter dem 3:1-Threshold lag. */
    outline: 2px solid #1976D2;
    outline-offset: 1px;
    border-color: #1976D2;
}

/* Textarea */
.remmerzelt-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
    transition: border-color 0.2s;
}

/* Select */
.remmerzelt-form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.2s;
}

/* Checkbox */
.remmerzelt-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.remmerzelt-checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Field description */
.remmerzelt-field-desc {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0;
}

/* Inline field errors */
.remmerzelt-field-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 4px;
    min-height: 1em;
}

.remmerzelt-field-error:empty {
    display: none;
}

.remmerzelt-form-field--has-error input,
.remmerzelt-form-field--has-error textarea,
.remmerzelt-form-field--has-error select {
    border-color: #d63638;
    box-shadow: 0 0 0 1px #d63638;
}

/* Half-width fields (side by side) */
.remmerzelt-form-row {
    display: flex;
    gap: 12px;
}

.remmerzelt-form-field-half {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .remmerzelt-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Actions */
.remmerzelt-form-actions {
    margin-top: 16px;
}

.remmerzelt-btn-lg {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
}

/* Messages */
.remmerzelt-form-message {
    margin-top: 10px;
    font-size: 14px;
    min-height: 20px;
}

.remmerzelt-msg-error {
    color: #d63638;
    background: #fef0f0;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.remmerzelt-msg-success {
    color: #155724;
    background: #d4edda;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.remmerzelt-msg-warn {
    color: #856404;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ffeeba;
}

/* Success state */
.remmerzelt-success {
    text-align: center;
    background: #fff;
    border-left: 4px solid #4CAF50;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 32px 24px;
    max-width: 560px;
    margin: 24px auto;
}

.remmerzelt-success-icon {
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 50%;
    border: 3px solid #4CAF50;
    color: #4CAF50;
    font-size: 28px;
    margin: 0 auto 16px;
}

.remmerzelt-success h3 {
    color: #1a1a1a;
    font-size: 20px;
    margin: 0 0 8px;
}

.remmerzelt-success p {
    color: #555;
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.5;
}

.remmerzelt-success-summary {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 16px 0 20px;
    text-align: left;
}

.remmerzelt-success-detail {
    padding: 4px 0;
    font-size: 14px;
    color: #333;
}

.remmerzelt-success-detail span {
    color: #666;
}

.remmerzelt-success-action {
    margin-top: 8px;
}

/* Alternatives panel */
.remmerzelt-alternatives {
    text-align: left;
}

.remmerzelt-alternatives-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.remmerzelt-alternatives-suggestion h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
}

.remmerzelt-alternatives-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.remmerzelt-alternatives-table td {
    padding: 8px 10px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

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

.remmerzelt-alternatives-timer {
    background: #e8eaf6;
    border: 1px solid #c5cae9;
    color: #283593;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.remmerzelt-alternatives-timer #remmerzelt-countdown {
    font-variant-numeric: tabular-nums;
}

.remmerzelt-alternatives-actions {
    display: flex;
    gap: 12px;
}

.remmerzelt-alternatives-actions .remmerzelt-btn {
    flex: 1;
    text-align: center;
}

.remmerzelt-alternatives-expired {
    text-align: center;
    padding: 20px 0;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 14px;
}

.remmerzelt-alternatives-expired p {
    margin: 0;
}

.remmerzelt-alternatives-expired .remmerzelt-btn {
    margin-top: 12px;
}

/* Retry button inside error messages */
.remmerzelt-btn-retry {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 12px;
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    vertical-align: middle;
}

.remmerzelt-btn-retry:hover {
    background: #b32d2f;
}

.remmerzelt-btn-retry:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.4);
}

/* Mobile form adjustments */
@media (max-width: 600px) {
    .remmerzelt-form-field input {
        padding: 12px 14px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .remmerzelt-btn-lg {
        padding: 16px 24px;
        font-size: 17px;
    }

    .remmerzelt-food-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .remmerzelt-food-qty {
        margin-left: 0;
        width: 70px;
    }

    .remmerzelt-btn-retry {
        display: block;
        margin: 8px 0 0 0;
        width: 100%;
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* § 312j Abs. 2 BGB Bestellübersicht — visuell hervorgehoben, direkt vor dem Submit-Button.
   Das Panel muss sich von den voranstehenden Form-Sections optisch abheben, damit klar wird:
   "Hier sind die Vertragsbestandteile, gleich folgt der zahlungspflichtige Submit." */
.remmerzelt-order-summary {
    background: #f8f9fa;
    border: 2px solid #1976D2;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.remmerzelt-order-summary h4 {
    margin-top: 0;
    color: #1976D2;
}

.remmerzelt-order-summary-list {
    margin: 0;
    padding: 0;
}

.remmerzelt-order-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(25, 118, 210, 0.12);
    font-size: 14px;
}

.remmerzelt-order-summary-row:last-child {
    border-bottom: none;
}

.remmerzelt-order-summary-row dt {
    flex: 0 0 140px;
    font-weight: 600;
    color: #555;
    margin: 0;
}

.remmerzelt-order-summary-row dd {
    flex: 1;
    margin: 0;
    min-width: 0;
}

.remmerzelt-order-summary-total {
    font-size: 16px;
}

.remmerzelt-order-summary-total dd strong {
    font-size: 18px;
}

.remmerzelt-vat-label {
    color: #555;
    font-size: 13px;
}

/* Consent-Gruppe (DSGVO + AGB) — direkt zwischen Bestellübersicht und Submit. */
.remmerzelt-consent-group {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.remmerzelt-consent-group__legend {
    /* Sichtbares Group-Label (WCAG 1.3.1) — kein remmerzelt-sr-only mehr,
       damit sehende Nutzer den Bezug der Checkboxen erkennen. */
    font-size: 13px;
    font-weight: 600;
    color: #555;
    padding: 0 6px;
    margin-left: -6px;
}

.remmerzelt-consent-field {
    margin-bottom: 8px;
}

.remmerzelt-consent-field:last-child {
    margin-bottom: 0;
}

.remmerzelt-consent-group .remmerzelt-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    font-size: 14px;
    cursor: pointer;
}

.remmerzelt-consent-group input[type="checkbox"] {
    /* WCAG 2.5.8 (Target Size Minimum, AA in 2.2): ≥24×24 CSS-Pixel.
       Direkter Maßstab — kein Padding-Trick. */
    width: 24px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.remmerzelt-consent-group a {
    color: #1976D2;
    text-decoration: underline;
}

.remmerzelt-consent-group a:focus-visible {
    outline: 2px solid #1976D2;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .remmerzelt-order-summary-row dt {
        flex: 0 0 100%;
    }
}

/* Erklärung zur Barrierefreiheit — dezenter Link unter der Map (neben "Aktualisiert vor"). */
.remmerzelt-accessibility-link-wrap {
    margin: 8px 0 0 0;
    text-align: left;
    font-size: 12px;
}

.remmerzelt-accessibility-link {
    color: #555;
    text-decoration: underline;
}

.remmerzelt-accessibility-link:focus-visible {
    outline: 2px solid #1976D2;
    outline-offset: 2px;
}
