/* =========================================
   Approval Modal — Core Make My
   Two-step confirmation before add-to-cart.
   ========================================= */

/* --- Overlay --- */

/* Scrim (background + blur) comes from `.core-modal-scrim` in core-modal.css;
   this block carries only the positioning and the fade transition. */
.core-approval-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease);
    pointer-events: none;
}

.core-approval-overlay.core-active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Modal --- */

/* Panel chrome (background, border, radius, shadow) comes from
   `.core-modal-panel` in core-modal.css; only sizing and motion are local. */
.core-approval-modal {
    max-width: 800px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    color: var(--ink-soft);
    transform: translateY(10px);
    transition: transform var(--dur-base) var(--ease);
}

.core-approval-overlay.core-active .core-approval-modal {
    transform: translateY(0);
}

/* --- Header --- */

/* Padding, divider and title type come from the shared `.core-modal-header`
   / `.core-modal-title` (core-modal.css). */

/* --- 3D Preview Slot --- */

.core-approval-modal__preview {
    flex: 1;
    min-height: 400px;
    margin: 16px 20px;
    background: var(--paper-sunk);
    border-radius: var(--r-sm);
    position: relative;
    overflow: hidden;
}

/* Ensure relocated 3D container fills the slot */
.core-approval-modal__preview .core-3d-container {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    inset: 0;
}

/* --- Footer --- */

/* Padding and divider come from the shared `.core-modal-footer`; this footer
   stacks its checkbox above the actions rather than setting them in a row. */
.core-approval-modal__footer {
    display: block;
}

/* --- Checkbox --- */

.core-approval-modal__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--fs-13);
    color: var(--ink-soft);
    cursor: pointer;
    margin-bottom: 16px;
    line-height: 1.4;
}

.core-approval-modal__checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* --- Actions --- */

.core-approval-modal__actions {
    display: flex;
    gap: 10px;
}

.core-approval-modal__actions .core-btn {
    flex: 1;
}

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

@media (max-width: 640px) {
    .core-approval-modal {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        max-width: none;
    }

    .core-approval-modal__preview {
        min-height: 250px;
        margin: 12px 16px;
    }


    .core-approval-modal__actions {
        flex-direction: column;
    }
}

/* --- Accessibility --- */

/* Reduced motion is handled globally — Theme/assets/css/main.css's
   `*, *::before, *::after` reset under `prefers-reduced-motion: reduce`
   zeroes every animation/transition duration with `!important`. */

@media (prefers-contrast: high) {
    .core-approval-modal {
        border: 2px solid #000;
    }
}
