/**
 * VASTCOB Widerrufsbutton – Frontend CSS
 *
 * Klassen:
 * .vcw-btn-withdraw      – Widerrufs-Button (Stufe 1)
 * .vcw-btn-confirm       – Bestätigungs-Button (Stufe 2)
 * .vcw-btn-cancel        – Abbrechen-Button
 * .vcw-btn-prominent     – Hervorgehobener Stil
 * .vcw-btn-outline       – Outline-Stil
 * .vcw-confirm-wrap      – Container Bestätigungsseite
 * .vcw-confirm-notice    – Hinweis-Box
 * .vcw-floating-btn      – Floating Button
 * .vcw-footer-link       – Footer-Link
 * .vcw-legal-links       – Rechtstext-Links
 * .vcw-modal-*           – AJAX-Modal
 * .vcw-reason-*          – Widerrufsgrund-Dropdown
 * .vcw-block-*           – Gutenberg Block
 */

/* ─── Buttons ──────────────────────────────────── */

.vcw-btn-withdraw,
.vcw-btn-confirm {
    display: inline-block;
    padding: 10px 24px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.vcw-btn-confirm {
    background: #46b450;
    color: #fff;
    border: 2px solid #46b450;
}
.vcw-btn-confirm:hover {
    background: #3a9a42;
    border-color: #3a9a42;
    color: #fff;
}

.vcw-btn-cancel {
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
}
.vcw-btn-cancel:hover {
    border-color: #999;
    color: #333;
}

/* Prominent – § 356a: hervorgehoben */
.vcw-btn-prominent.vcw-btn-withdraw {
    background: #0073aa;
    color: #fff;
    border: 2px solid #0073aa;
    font-size: 15px;
    padding: 12px 28px;
}
.vcw-btn-prominent.vcw-btn-withdraw:hover {
    background: #005f8b;
    border-color: #005f8b;
    color: #fff;
}
.vcw-btn-prominent.vcw-btn-confirm {
    font-size: 15px;
    padding: 12px 28px;
}

/* Outline */
.vcw-btn-outline.vcw-btn-withdraw {
    background: transparent;
    color: #333;
    border: 2px solid #333;
}
.vcw-btn-outline.vcw-btn-withdraw:hover {
    background: #333;
    color: #fff;
}

/* ─── Bestätigungsseite ────────────────────────── */

.vcw-confirm-wrap {
    max-width: 700px;
}

.vcw-confirm-notice {
    margin: 16px 0;
    padding: 12px 16px;
}

.vcw-order-table th {
    width: 180px;
    text-align: left;
    vertical-align: top;
}

.vcw-confirm-actions {
    margin: 24px 0;
}

/* ─── Widerrufsgrund-Dropdown ──────────────────── */

.vcw-reason-wrap {
    margin: 20px 0;
}

.vcw-reason-select {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    margin-top: 6px;
}

.vcw-reason-text {
    width: 100%;
    max-width: 400px;
    margin-top: 8px;
    padding: 8px;
    resize: vertical;
}

/* ─── Footer-Link ──────────────────────────────── */

.vcw-footer-link-wrap {
    text-align: center;
    padding: 12px 0;
    margin: 8px 0 0;
}

.vcw-footer-link {
    display: inline-block;
    padding: 8px 20px;
    background: #333;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}
.vcw-footer-link:hover {
    background: #555;
    color: #fff !important;
}

/* ─── Floating Button ──────────────────────────── */

.vcw-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3) !important;
    text-decoration: none !important;
    color: inherit !important;
}

.vcw-floating-icon {
    font-size: 18px;
    line-height: 1;
}

/* ─── AJAX Modal ───────────────────────────────── */

.vcw-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
    backdrop-filter: blur(2px);
}
.vcw-modal-overlay.vcw-modal-active {
    display: block;
}

.vcw-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 999999;
    width: 90%;
    max-width: 620px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.vcw-modal.vcw-modal-active {
    display: flex;
    animation: vcwModalIn 0.2s ease-out;
}

@keyframes vcwModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.vcw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    position: relative;
    z-index: 10;
}

.vcw-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vcw-modal-close {
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    cursor: pointer !important;
    color: #666 !important;
    padding: 8px 12px !important;
    line-height: 1 !important;
    position: relative !important;
    z-index: 999999 !important;
    pointer-events: all !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    transition: background 0.15s ease;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    float: none !important;
    margin: -8px -12px -8px 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    text-indent: 0 !important;
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
}
.vcw-modal-close:hover,
.vcw-modal-close:focus {
    color: #333 !important;
    background: rgba(0,0,0,0.08) !important;
    outline: none !important;
}

.vcw-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.vcw-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Modal-Inhalte */
.vcw-modal-loading {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.vcw-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: vcwSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes vcwSpin {
    to { transform: rotate(360deg); }
}

.vcw-modal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.vcw-modal-table th,
.vcw-modal-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 14px;
}

.vcw-modal-table th {
    width: 140px;
    font-weight: 600;
    color: #333;
}

.vcw-modal-items thead th {
    background: #f8f8f8;
    font-weight: 600;
    width: auto;
}

.vcw-modal-notice {
    padding: 12px 16px;
    background: #f0f6fc;
    border-left: 3px solid #0073aa;
    margin-bottom: 16px;
    font-size: 14px;
    border-radius: 2px;
}

.vcw-modal-error {
    padding: 10px 16px;
    background: #fef0f0;
    border-left: 3px solid #dc3232;
    color: #dc3232;
    margin-bottom: 16px;
    font-size: 14px;
    border-radius: 2px;
}

.vcw-modal-success {
    text-align: center;
    padding: 30px 20px;
}

.vcw-modal-checkmark {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 32px;
    background: #46b450;
    color: #fff;
    border-radius: 50%;
    margin-bottom: 16px;
}

.vcw-modal-success h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: #333;
}

.vcw-modal-ref {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

/* Modal Dropdown */
.vcw-modal-reason {
    margin: 16px 0;
}

.vcw-modal-reason label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.vcw-modal-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.vcw-modal-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    resize: vertical;
}

body.vcw-modal-open {
    overflow: hidden;
}

/* ─── Gutenberg Block ──────────────────────────── */

.vcw-block-wrap {
    margin: 16px 0;
}

.vcw-block-title {
    margin-bottom: 12px;
}

.vcw-block-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.vcw-block-select {
    min-width: 250px;
    padding: 8px;
}

.vcw-block-preview {
    padding: 16px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

/* ─── Responsive ───────────────────────────────── */

@media (max-width: 767px) {
    .vcw-floating-hide-mobile {
        display: none !important;
    }

    /* Auf Mobil nur Icon zeigen */
    .vcw-floating-btn:not(.vcw-floating-hide-mobile) .vcw-floating-label {
        display: none;
    }
    .vcw-floating-btn:not(.vcw-floating-hide-mobile) {
        padding: 14px !important;
        border-radius: 50% !important;
        width: 52px;
        height: 52px;
        justify-content: center;
    }
    .vcw-floating-btn:not(.vcw-floating-hide-mobile) .vcw-floating-icon {
        font-size: 22px;
    }

    .vcw-confirm-actions {
        flex-direction: column;
    }

    /* Modal Mobile */
    .vcw-modal {
        width: 95%;
        max-height: 90vh;
    }

    .vcw-modal-header {
        padding: 12px 16px;
    }

    .vcw-modal-body {
        padding: 16px;
    }

    .vcw-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }

    .vcw-modal-table th {
        width: 100px;
    }

    .vcw-block-form {
        flex-direction: column;
        align-items: stretch;
    }

    .vcw-block-select {
        min-width: 100%;
    }
}

/* ─── Gastformular ─────────────────────────────── */

.vcw-guest-form .form-row {
    margin-bottom: 12px;
}

.vcw-guest-form .form-row label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

/* ─── Info-Anzeige ─────────────────────────────── */

.vcw-withdrawal-info {
    margin: 16px 0;
}

.vcw-not-withdrawable {
    color: #999;
}
