/**
 * WooCommerce Herroepingsknop — Frontend styles
 *
 * Fully self-contained: all styles are scoped to .wh-hk to prevent
 * theme interference. No dependency on WooCommerce or WordPress classes.
 *
 * @package WH_Herroepingsknop
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Scoped reset
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk,
.wh-hk *,
.wh-hk *::before,
.wh-hk *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    vertical-align: baseline;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wh-hk {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: #1a1a2e;
    margin: 28px 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Card (wrapper)
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f8 100%);
    border: 1px solid #d8dce6;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.wh-hk__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #4a6cf7;
    border-radius: 10px 0 0 10px;
}

.wh-hk__card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    background: #e8ecf8;
    color: #4a6cf7;
}

.wh-hk__card-body {
    flex: 1;
    min-width: 0;
}

.wh-hk__card-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a6cf7;
    margin-bottom: 4px;
}

.wh-hk__card-text {
    font-size: 14px;
    line-height: 1.55;
    color: #444;
    margin-bottom: 14px;
}

.wh-hk__card-text strong {
    font-weight: 700;
    color: #1a1a2e;
}

.wh-hk__card-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #d8dce6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
    flex-shrink: 0;
}

.wh-hk__days-left {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: #4a6cf7;
}

.wh-hk__days-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8fa8;
    margin-top: 2px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Buttons (fully independent)
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    background: none;
}

.wh-hk__btn:focus-visible {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

.wh-hk__btn svg {
    flex-shrink: 0;
}

/* Primary (blue) */
.wh-hk__btn--primary {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
}

.wh-hk__btn--primary:hover {
    background: #3b5de7;
    border-color: #3b5de7;
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.35);
    transform: translateY(-1px);
}

.wh-hk__btn--primary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Danger (red) */
.wh-hk__btn--danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.wh-hk__btn--danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
    transform: translateY(-1px);
}

.wh-hk__btn--danger:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.wh-hk__btn--danger:disabled {
    background: #b0b8c9;
    border-color: #b0b8c9;
    color: #fff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Ghost (outline) */
.wh-hk__btn--ghost {
    background: transparent;
    color: #555;
    border-color: #ccd0d8;
}

.wh-hk__btn--ghost:hover {
    background: #f4f5f7;
    border-color: #b0b8c9;
    color: #333;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Modal
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wh-hk__modal[hidden] {
    display: none !important;
}

.wh-hk__modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 35, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.wh-hk__modal-dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0,0,0,0.05);
    animation: wh-hk-slide-up 0.25s ease-out;
}

@keyframes wh-hk-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal header ── */
.wh-hk__modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #eef0f4;
}

.wh-hk__modal-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: #fff3cd;
    color: #d4860a;
}

.wh-hk__modal-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.wh-hk__modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    outline: none;
    padding: 0;
    flex-shrink: 0;
}

.wh-hk__modal-close:hover {
    background: #f4f5f7;
    color: #333;
}

.wh-hk__modal-close:focus-visible {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

/* ── Order summary ── */
.wh-hk__modal-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 16px 24px;
    background: #f8f9fc;
    border-radius: 8px;
    border: 1px solid #eef0f4;
    overflow: hidden;
}

.wh-hk__modal-summary-row {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid #eef0f4;
}

.wh-hk__modal-summary-row:nth-child(odd) {
    border-right: 1px solid #eef0f4;
}

.wh-hk__modal-summary-row:nth-last-child(-n+2) {
    border-bottom: none;
}

.wh-hk__modal-summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8fa8;
    margin-bottom: 2px;
}

.wh-hk__modal-summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── Item selection list ── */
.wh-hk__modal-items {
    margin: 0 24px 16px;
}

.wh-hk__modal-items > .wh-hk__label {
    margin-bottom: 10px;
}

.wh-hk__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    -webkit-user-select: none;
    user-select: none;
    font-size: 14px;
    line-height: 1.45;
    color: #333;
}

.wh-hk__item:hover {
    background: #f8f9fc;
    border-color: #d8dce6;
}

.wh-hk__item--all {
    background: #f4f5f7;
    border-color: #d8dce6;
    font-weight: 600;
    margin-bottom: 10px;
}

.wh-hk__item .wh-hk__checkbox-box {
    margin-top: 2px;
}

.wh-hk__item-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.wh-hk__item-name {
    font-weight: 500;
    color: #1a1a2e;
    word-break: break-word;
}

.wh-hk__item-meta {
    font-size: 12px;
    color: #8a8fa8;
    margin-top: 2px;
}

/* Unchecked item style */
.wh-hk__item:has(.wh-hk__checkbox:not(:checked)) {
    opacity: 0.55;
}

/* ── Partial withdrawal notice ── */
.wh-hk__notice--partial {
    background: #f0f6fc;
    border: 1px solid #a8cff0;
    color: #135e96;
    margin-bottom: 12px;
}

/* ── Confirmation checkbox ── */
.wh-hk__modal-confirm {
    margin: 0 24px 16px;
    padding: 14px 16px;
    background: #fffbf0;
    border: 1px solid #f5dea3;
    border-radius: 8px;
}

.wh-hk__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    -webkit-user-select: none;
    user-select: none;
}

/* Hide native checkbox */
.wh-hk__checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Custom checkbox box */
.wh-hk__checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 1px;
    border: 2px solid #c0c5d0;
    border-radius: 5px;
    background: #fff;
    transition: all 0.15s ease;
    color: transparent;
}

.wh-hk__checkbox:checked + .wh-hk__checkbox-box {
    background: #4a6cf7;
    border-color: #4a6cf7;
    color: #fff;
}

.wh-hk__checkbox:focus-visible + .wh-hk__checkbox-box {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

.wh-hk__checkbox-text {
    flex: 1;
}

/* ── Reason textarea ── */
.wh-hk__modal-reason {
    margin: 0 24px 20px;
}

.wh-hk__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.wh-hk__textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #fff;
    border: 1px solid #ccd0d8;
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.wh-hk__textarea:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.wh-hk__textarea::placeholder {
    color: #aaa;
}

/* ── Modal actions ── */
.wh-hk__modal-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px 22px;
    border-top: 1px solid #eef0f4;
}

/* ── Modal message ── */
.wh-hk__modal-message {
    margin: 16px 24px 24px;
    padding: 16px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.wh-hk__modal-message[hidden] {
    display: none !important;
}

.wh-hk__modal-message--success {
    background: #eafbec;
    border: 1px solid #4caf50;
    color: #1b6e1f;
}

.wh-hk__modal-message--success::before {
    content: "✓ ";
    font-weight: 700;
}

.wh-hk__modal-message--error {
    background: #fef0f0;
    border: 1px solid #ef5350;
    color: #8b1a1c;
}

.wh-hk__modal-message--error::before {
    content: "✕ ";
    font-weight: 700;
}

/* Success state — clean layout when form is hidden */
.wh-hk__modal-dialog--success .wh-hk__modal-header {
    border-bottom: none;
    padding-bottom: 8px;
}

.wh-hk__modal-dialog--success .wh-hk__modal-summary {
    margin-bottom: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Notice (already withdrawn)
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.55;
}

.wh-hk__notice--done {
    background: #eafbec;
    border: 1px solid #b7e5ba;
    color: #1b6e1f;
}

.wh-hk__notice-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.wh-hk__notice-text {
    flex: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Spinner
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wh-hk-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes wh-hk-spin {
    to { transform: rotate(360deg); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Responsive
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 560px) {
    .wh-hk__card {
        flex-wrap: wrap;
        padding: 18px 18px 18px 22px;
    }

    .wh-hk__card-badge {
        position: absolute;
        top: 14px;
        right: 14px;
        min-width: 48px;
        height: 48px;
    }

    .wh-hk__card-icon {
        display: none;
    }

    .wh-hk__card-text {
        padding-right: 60px;
    }

    .wh-hk__btn {
        width: 100%;
        justify-content: center;
    }

    .wh-hk__modal-dialog {
        border-radius: 14px 14px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }

    .wh-hk__modal {
        align-items: flex-end;
        padding: 0;
    }

    .wh-hk__modal-summary {
        grid-template-columns: 1fr;
    }

    .wh-hk__modal-summary-row:nth-child(odd) {
        border-right: none;
    }

    .wh-hk__modal-summary-row:last-child {
        border-bottom: none;
    }

    .wh-hk__modal-actions {
        flex-direction: column;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Dashboard notice (My Account home)
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__dashboard-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf8 100%);
    border: 1px solid #c5cee8;
    border-radius: 10px;
    margin-bottom: 24px;
}

.wh-hk__dashboard-notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    background: #dde3f5;
    color: #4a6cf7;
}

.wh-hk__dashboard-notice-body {
    flex: 1;
    min-width: 0;
}

.wh-hk__dashboard-notice-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a6cf7;
    margin-bottom: 4px;
}

.wh-hk__dashboard-notice-text {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 12px;
}

.wh-hk__dashboard-notice-orders {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wh-hk__dashboard-order-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #d8dce6;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a2e;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wh-hk__dashboard-order-link:hover {
    border-color: #4a6cf7;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.12);
}

.wh-hk__dashboard-order-number {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.wh-hk__dashboard-order-remaining {
    font-size: 12px;
    color: #8a8fa8;
    flex: 1;
}

.wh-hk__dashboard-order-link svg {
    color: #b0b8c9;
    flex-shrink: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Order list: "Ontbinden" action button
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.woocommerce-orders-table__cell-order-actions .wh_hk_withdraw a,
.woocommerce-orders-table__cell-order-actions a.wh_hk_withdraw {
    background: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

.woocommerce-orders-table__cell-order-actions .wh_hk_withdraw a:hover,
.woocommerce-orders-table__cell-order-actions a.wh_hk_withdraw:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Scroll highlight animation
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk--highlight .wh-hk__card {
    animation: wh-hk-pulse 1.5s ease;
}

@keyframes wh-hk-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 108, 247, 0.5); }
    50%  { box-shadow: 0 0 0 8px rgba(74, 108, 247, 0); }
    100% { box-shadow: none; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  Guest lookup form
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.wh-hk__guest-card {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d8dce6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.wh-hk__guest-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #f8f9fc, #f1f3f8);
    border-bottom: 1px solid #eef0f4;
}

.wh-hk__guest-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    background: #e8ecf8;
    color: #4a6cf7;
}

.wh-hk__guest-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.wh-hk__guest-card-subtitle {
    font-size: 13px;
    color: #8a8fa8;
    line-height: 1.4;
}

.wh-hk__guest-form {
    padding: 24px;
}

.wh-hk__guest-field {
    margin-bottom: 16px;
}

.wh-hk__input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: #333;
    background: #fff;
    border: 1px solid #ccd0d8;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.wh-hk__input:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.wh-hk__input::placeholder {
    color: #aaa;
}

.wh-hk__guest-actions {
    margin-top: 8px;
}

.wh-hk__guest-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.wh-hk__guest-message[hidden] {
    display: none !important;
}

.wh-hk__guest-message--error {
    background: #fef0f0;
    border: 1px solid #ef5350;
    color: #8b1a1c;
}

.wh-hk__guest-message--success {
    background: #eafbec;
    border: 1px solid #4caf50;
    color: #1b6e1f;
}

.wh-hk__guest-withdraw {
    padding: 24px;
    border-top: 1px solid #eef0f4;
}
