/**
 * KS Confirm — project-wide confirmation modal.
 *
 * Reusable across the whole project (not cart-specific). Trigger it either
 * programmatically — window.KSConfirm.open({ title, message, tone, ... })
 * which returns a Promise<boolean> — or declaratively with a
 * data-ks-confirm="message" attribute on any link/button/submit.
 *
 * Every value is a --ksc-* custom property so the look can be retuned live
 * from Customizer → Additional CSS without touching this file.
 *
 * @package KS_Variation_Manager
 * @since   2.10.0
 */

:root {
    --ksc-overlay: rgba(20, 20, 20, 0.55);
    --ksc-bg: #fff;
    --ksc-text: #1a1a1a;
    --ksc-muted: #6a6a6a;
    --ksc-border: #e6e6e6;
    --ksc-radius: 14px;
    --ksc-z: 100000;                                 /* above the side cart (99999) */
    --ksc-accent: var(--bt-color-primary, #d35400);  /* "primary" tone confirm button */
    --ksc-danger: #e04434;                           /* "danger" tone confirm button */
    --ksc-danger-soft: #fdece9;                      /* danger icon halo */
    --ksc-transition: 0.18s ease;
    --ksc-max-width: 340px;
}

/* ── Overlay ── */
.ks-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--ksc-z);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--ksc-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--ksc-transition), visibility var(--ksc-transition);
    -webkit-tap-highlight-color: transparent;
}

.ks-confirm-overlay.ks-confirm-open {
    opacity: 1;
    visibility: visible;
}

/* ── Box ── */
.ks-confirm-box {
    width: 100%;
    max-width: var(--ksc-max-width);
    background: var(--ksc-bg);
    color: var(--ksc-text);
    border-radius: var(--ksc-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    padding: 26px 24px 22px;
    text-align: center;
    transform: translateY(10px) scale(0.97);
    transition: transform var(--ksc-transition);
}

.ks-confirm-open .ks-confirm-box {
    transform: none;
}

/* ── Icon ── */
.ks-confirm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #f1f1f1;
    color: var(--ksc-accent);
}

.ks-confirm-icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.ks-confirm-danger .ks-confirm-icon {
    background: var(--ksc-danger-soft);
    color: var(--ksc-danger);
}

/* ── Text ── */
.ks-confirm-title {
    margin: 0 0 6px 0;
    padding-bottom: 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ksc-text);
}

.ks-confirm-message {
    margin: 0 0 20px;
    padding-bottom: 8px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ksc-muted);
}

/* ── Actions (stacked; primary/confirm action on top) ──
 * Button visuals come from the shared .ks-btn component (ks-buttons.css):
 *   confirm → .ks-btn.ks-btn--primary   |   cancel → .ks-btn.ks-btn--secondary
 * The "danger" tone is signalled by the red icon halo above, not by recolouring
 * the confirm button, so every confirm button stays consistent with add-to-cart. */
.ks-confirm-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: 4px;
}
