/* ==========================================================================
   WooCommerce Widerrufsbutton – Frontend Styles (Modal-Version)
   ========================================================================== */

/* ==========================================================================
   Trigger-Button (im Footer / Shortcode)
   ========================================================================== */

button.wc-widerruf-trigger,
.wc-widerruf-trigger {
    display: inline-block !important;
    padding: 18px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    color: #fff !important;
    background-color: #c0392b !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    margin: 8px 0 !important;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.25) !important;
}

.wc-widerruf-trigger:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.4);
}

.wc-widerruf-trigger:focus {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

/* ==========================================================================
   Modal Overlay (dunkler Hintergrund)
   ========================================================================== */

.wc-widerruf-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.wc-widerruf-overlay.active {
    display: flex;
}

/* ==========================================================================
   Modal-Fenster (zentriert)
   ========================================================================== */

.wc-widerruf-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px 35px 30px;
    box-sizing: border-box;
    animation: wc-widerruf-modal-in 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

@keyframes wc-widerruf-modal-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Schließen-Button (X) */
.wc-widerruf-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    line-height: 1;
    padding: 0;
}

.wc-widerruf-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ==========================================================================
   Modal-Inhalt
   ========================================================================== */

.wc-widerruf-modal h2 {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    padding-right: 30px;
}

.wc-widerruf-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 22px;
}

/* ==========================================================================
   Formularfelder
   ========================================================================== */

.wc-widerruf-form {
    margin-top: 5px;
}

.wc-widerruf-field {
    margin-bottom: 18px;
}

.wc-widerruf-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
    color: #2c3e50;
}

.wc-widerruf-field .required {
    color: #c0392b;
}

.wc-widerruf-field .optional {
    color: #aaa;
    font-weight: 400;
    font-size: 12px;
}

.wc-widerruf-field input[type="text"],
.wc-widerruf-field input[type="email"],
.wc-widerruf-field select {
    width: 100%;
    padding: 11px 13px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    font-family: inherit;
}

.wc-widerruf-field input:focus,
.wc-widerruf-field select:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
    outline: none;
    background: #fff;
}

.wc-widerruf-field input::placeholder {
    color: #bbb;
}

/* Hinweisbox */
.wc-widerruf-hinweis {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 20px 0;
    font-size: 13px;
}

.wc-widerruf-hinweis p {
    margin: 0;
}

/* ==========================================================================
   Buttons im Modal
   ========================================================================== */

.wc-widerruf-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.wc-widerruf-button {
    display: inline-block;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

/* Hinweis personalisierte Produkte */
.wc-widerruf-personalisiert {
    background: #f0f4ff;
    border: 1px solid #b8ccf5;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #3a5a9c;
}

.wc-widerruf-personalisiert p {
    margin: 0;
}

.wc-widerruf-button:focus {
    outline: 3px solid #4a90d9;
    outline-offset: 2px;
}

.wc-widerruf-button-primary {
    color: #fff;
    background-color: #c0392b;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.25);
}

.wc-widerruf-button-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
}

.wc-widerruf-button-secondary {
    color: #666;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
}

.wc-widerruf-button-secondary:hover {
    background-color: #e4e4e4;
}

/* ==========================================================================
   Erfolgsmeldung im Modal
   ========================================================================== */

.wc-widerruf-erfolg {
    text-align: center;
    padding: 10px 0;
}

.wc-widerruf-erfolg-icon {
    font-size: 56px;
    color: #27ae60;
    margin-bottom: 10px;
    line-height: 1;
}

.wc-widerruf-erfolg h2 {
    color: #27ae60;
    font-size: 20px;
    margin-bottom: 12px;
    padding-right: 0;
    text-align: center;
}

.wc-widerruf-erfolg p {
    font-size: 14px;
    color: #555;
}

.wc-widerruf-datum {
    background: #eaf7ee;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin: 12px 0;
}

.wc-widerruf-hinweis-klein {
    color: #999;
    font-size: 12px;
    margin-top: 15px;
}

/* ==========================================================================
   Fehlermeldung im Modal
   ========================================================================== */

.wc-widerruf-fehler {
    padding: 15px;
    background: #fdf0f0;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.wc-widerruf-fehler-icon {
    font-size: 32px;
    color: #e74c3c;
    margin-bottom: 5px;
}

.wc-widerruf-fehler p {
    margin: 5px 0;
    font-size: 14px;
    color: #721c24;
}

/* ==========================================================================
   Scrollbar im Modal
   ========================================================================== */

.wc-widerruf-modal::-webkit-scrollbar {
    width: 6px;
}

.wc-widerruf-modal::-webkit-scrollbar-track {
    background: transparent;
}

.wc-widerruf-modal::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 580px) {
    .wc-widerruf-overlay {
        padding: 10px;
    }

    .wc-widerruf-modal {
        padding: 25px 20px 20px;
        border-radius: 12px;
        max-height: 95vh;
    }

    .wc-widerruf-modal h2 {
        font-size: 19px;
    }

    .wc-widerruf-button {
        padding: 11px 20px;
        font-size: 14px;
    }

    .wc-widerruf-buttons {
        flex-direction: column-reverse;
    }

    .wc-widerruf-buttons .wc-widerruf-button {
        width: 100%;
        text-align: center;
    }
}
