/**
 * Etechflow_AbandonedCart - Popup modal styles.
 *
 * Theme-neutral: no Magento/Luma/Hyvä CSS framework dependency. Works
 * as-is on both Luma and Hyvä. Merchants who want to restyle should
 * override these classes in their own theme rather than editing here.
 *
 * Architecture (v1.2.0+):
 *   - Container hidden by default; `.is-open` reveals it.
 *   - `.etechflow-popup--<layout>` controls positioning (modal / slide-in /
 *      bottom-bar / top-bar).
 *   - `.etechflow-popup--anim-<animation>` controls entrance animation.
 *   - CSS custom properties (--etechflow-popup-*) provide per-rule color
 *      + size overrides set inline by popup-handler.js.
 *
 * @category   ETechFlow
 * @package    Etechflow_AbandonedCart
 */

/* ============================================================ */
/* Container defaults + CSS variables                            */
/* ============================================================ */

#etechflow-popup-container {
    --etechflow-popup-bg:        #ffffff;
    --etechflow-popup-headline:  #0f172a;
    --etechflow-popup-body:      #374151;
    --etechflow-popup-cta-bg:    #0f172a;
    --etechflow-popup-cta-text:  #ffffff;
    --etechflow-popup-radius:    12px;
    --etechflow-popup-width:     480px;

    display: none;
    position: fixed;
    z-index: 9999;
}

#etechflow-popup-container.is-open {
    display: flex;
}

body.etechflow-popup-open.etechflow-popup--modal-active {
    overflow: hidden;
}

/* ============================================================ */
/* Layout: MODAL (default — centered overlay)                    */
/* ============================================================ */

#etechflow-popup-container.etechflow-popup--modal {
    inset: 0;
    align-items: center;
    justify-content: center;
}

.etechflow-popup--modal .etechflow-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.etechflow-popup--modal .etechflow-popup__dialog {
    position: relative;
    width: 90%;
    max-width: var(--etechflow-popup-width);
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* ============================================================ */
/* Layout: SLIDE-IN (bottom-right corner card)                   */
/* ============================================================ */

#etechflow-popup-container.etechflow-popup--slide_in {
    inset: auto 20px 20px auto;
    width: 360px;
    align-items: stretch;
}

.etechflow-popup--slide_in .etechflow-popup__backdrop {
    display: none;
}

.etechflow-popup--slide_in .etechflow-popup__dialog {
    position: relative;
    width: 100%;
    padding: 22px 20px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ============================================================ */
/* Layout: BOTTOM BAR (full-width strip at page bottom)          */
/* ============================================================ */

#etechflow-popup-container.etechflow-popup--bottom_bar {
    inset: auto 0 0 0;
    align-items: stretch;
    justify-content: stretch;
}

.etechflow-popup--bottom_bar .etechflow-popup__backdrop {
    display: none;
}

.etechflow-popup--bottom_bar .etechflow-popup__dialog {
    position: relative;
    width: 100%;
    padding: 16px 56px 16px 20px;
    border-radius: 0 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
}

.etechflow-popup--bottom_bar .etechflow-popup__headline {
    font-size: 18px;
    text-align: left;
    margin: 0;
    flex: 1;
}

.etechflow-popup--bottom_bar .etechflow-popup__body,
.etechflow-popup--bottom_bar .etechflow-popup__image {
    display: none;
}

.etechflow-popup--bottom_bar .etechflow-popup__cta {
    width: auto;
    margin: 0;
    padding: 10px 26px;
    flex-shrink: 0;
}

.etechflow-popup--bottom_bar .etechflow-popup__close {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

/* ============================================================ */
/* Layout: TOP BAR (full-width strip at page top)                */
/* ============================================================ */

#etechflow-popup-container.etechflow-popup--top_bar {
    inset: 0 0 auto 0;
    align-items: stretch;
    justify-content: stretch;
}

.etechflow-popup--top_bar .etechflow-popup__backdrop {
    display: none;
}

.etechflow-popup--top_bar .etechflow-popup__dialog {
    position: relative;
    width: 100%;
    padding: 16px 56px 16px 20px;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
}

.etechflow-popup--top_bar .etechflow-popup__headline {
    font-size: 18px;
    text-align: left;
    margin: 0;
    flex: 1;
}

.etechflow-popup--top_bar .etechflow-popup__body,
.etechflow-popup--top_bar .etechflow-popup__image {
    display: none;
}

.etechflow-popup--top_bar .etechflow-popup__cta {
    width: auto;
    margin: 0;
    padding: 10px 26px;
    flex-shrink: 0;
}

.etechflow-popup--top_bar .etechflow-popup__close {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

/* ============================================================ */
/* Shared dialog skin (color + radius applied via CSS variables) */
/* ============================================================ */

.etechflow-popup__dialog {
    background: var(--etechflow-popup-bg);
    color: var(--etechflow-popup-body);
    border-radius: var(--etechflow-popup-radius);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.etechflow-popup__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 6px 10px;
}

.etechflow-popup__close:hover {
    color: #111827;
}

.etechflow-popup__image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
    border-radius: 8px;
}

.etechflow-popup__headline {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--etechflow-popup-headline);
    text-align: center;
}

.etechflow-popup__body {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--etechflow-popup-body);
    text-align: center;
}

.etechflow-popup__cta {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    padding: 14px 22px;
    background: var(--etechflow-popup-cta-bg);
    color: var(--etechflow-popup-cta-text);
    font-size: 16px;
    font-weight: 600;
    border: 0;
    border-radius: var(--etechflow-popup-radius);
    cursor: pointer;
    transition: filter 120ms ease-in-out;
}

.etechflow-popup__cta:hover:not(:disabled) {
    filter: brightness(1.1);
}

.etechflow-popup__cta:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.etechflow-popup__result {
    margin: 16px 0 0;
    padding: 12px 16px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #10b981;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.etechflow-popup__result strong {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ============================================================ */
/* Animations (entrance only — exit relies on display:none)      */
/* ============================================================ */

.etechflow-popup--anim-fade_in .etechflow-popup__dialog {
    animation: etechflowFadeIn 220ms ease-out;
}

.etechflow-popup--anim-slide_up .etechflow-popup__dialog {
    animation: etechflowSlideUp 280ms ease-out;
}

.etechflow-popup--anim-zoom_in .etechflow-popup__dialog {
    animation: etechflowZoomIn 220ms ease-out;
}

.etechflow-popup--anim-bounce .etechflow-popup__dialog {
    animation: etechflowBounce 480ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes etechflowFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes etechflowSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes etechflowZoomIn {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

@keyframes etechflowBounce {
    0%   { transform: scale(0.5);  opacity: 0; }
    60%  { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

/* ============================================================ */
/* Mobile responsive                                              */
/* ============================================================ */

@media (max-width: 480px) {
    .etechflow-popup--modal .etechflow-popup__dialog {
        width: 94%;
        padding: 24px 20px 20px;
    }
    .etechflow-popup--modal .etechflow-popup__headline {
        font-size: 20px;
    }
    #etechflow-popup-container.etechflow-popup--slide_in {
        inset: auto 10px 10px 10px;
        width: auto;
    }
    .etechflow-popup--bottom_bar .etechflow-popup__dialog,
    .etechflow-popup--top_bar .etechflow-popup__dialog {
        flex-wrap: wrap;
        padding-right: 44px;
    }
    .etechflow-popup--bottom_bar .etechflow-popup__cta,
    .etechflow-popup--top_bar .etechflow-popup__cta {
        width: 100%;
        margin-top: 8px;
    }
}
