/*!
 * True Makeup Theme — modal.css
 *
 * Add-to-cart modal overlay that pops up after a shop-loop card
 * fires its add-to-cart button. Includes the shared page-overlay
 * backdrop and the SVG loader spinner. The modal markup lives
 * inside base.twig; toggling visibility is handled in JS.
 */


/* ─── Body lock when a modal is open ─────────────────────── */

.modal-active {
    position: relative;
    overflow: hidden;
}


/* ─── Outer wrapper + backdrop ───────────────────────────── */

.modal-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.modal-wrapper .overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-wrapper.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}


/* ─── Modal card ─────────────────────────────────────────── */

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    z-index: 9000;
    overflow: auto;
    visibility: hidden;
    opacity: 0;
    transform: translate3d(-50%, -48%, 0);
    transition: 0.3s ease;
}

@media (min-width: 1024px) {
    .modal {
        width: 620px;
        height: auto;
    }
}

.modal.is-active {
    visibility: visible;
    opacity: 1;
    transform: translate3d(-50%, -50%, 0);
}


/* ─── Close button row ───────────────────────────────────── */

.modal__close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    padding: 0 2px;
}

.modal__close button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    min-width: 0;
    padding: 0;
    background-color: #fff;
    border: none;
    cursor: pointer;
}

.modal__close button:hover { background-color: #f0f0f0; }


/* ─── Card header strip ──────────────────────────────────── */

.modal__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 15px;
    background-color: var(--color-primary-container);
    border-radius: 5px;
    color: #000;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
}

.modal__header img {
    width: 18px;
    margin-right: 10px;
}


/* ─── Body wrapper ───────────────────────────────────────── */

.modal__body {
    margin-top: 8px;
    padding: 12px 12px 80px;
    background: #fff;
    border-radius: 5px;
}

@media (min-width: 768px) {
    .modal__body { padding: 32px 32px 48px; }
}


/* ─── Product summary (name + qty + price) ──────────────── */

.modal__product {
    display: flex;
    flex-wrap: wrap;
    padding: 0 0 16px;
    border-bottom: 2px solid var(--ep-blush-block);
}

.modal__product figure {
    width: 100px;
    height: 100px;
    margin: 0 0 16px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

@media (min-width: 768px) {
    .modal__product figure {
        width: 150px;
        height: 150px;
        margin: 0;
    }
}

.modal__product figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.modal__product .modal-details {
    flex: 1;
    padding-left: 16px;
    text-align: left;
    font-family: var(--font-primary);
}

.modal__product .name,
.modal__product .qty,
.modal__product .price {
    display: flex;
    font-size: 14px;
}

.modal__product .qty   { margin: 4px 0; }
.modal__product .price {
    font-size: 18px;
    font-weight: 700;
}


/* ─── Action buttons row ─────────────────────────────────── */

.modal-actions {
    width: 100%;
    margin-top: 16px;
}

.modal-actions .button,
.modal-actions a.button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    margin-bottom: 10px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.modal-actions .button--basket {
    background-color: var(--color-primary-container);
    color: #000;
}
.modal-actions .button--basket:hover {
    background-color: var(--color-secondary-container);
}

.modal-actions .button--checkout {
    background-color: #000;
    color: #fff;
}
.modal-actions .button--checkout:hover {
    background-color: var(--color-secondary-container);
    color: #000;
}

.modal-actions .button--continue {
    background-color: transparent;
    color: #000;
    border: 2px solid #000;
}
.modal-actions .button--continue:hover {
    color:        var(--ep-secondary);
    border-color: var(--ep-secondary);
}


/* ─── Cross-sell row ─────────────────────────────────────── */

.modal__products            { padding: 16px 0 0; }
.modal__products > h3 {
    margin: 10px 0;
    color: #000;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-align: center;
    text-transform: uppercase;
}


/* ─── Shared page overlay (modal + filter panels) ────────── */

.page-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background-color: #000;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.page-overlay.is-active {
    visibility: visible;
    opacity: 0.4;
}


/* ─── SVG loader spinner ─────────────────────────────────── */

.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 8100;
    transform: translate(-50%, -50%);
}
.loader.is-active   { display: block; }
.loader svg         { width: 100px; height: 100px; }
