/* EP Last Product Modal v1.2.0 */

#ep-lpm-root {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 20, 30, 0.72);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ep-lpm-fadein .2s ease both;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
#ep-lpm-root.ep-lpm-visible { display: flex; }
@keyframes ep-lpm-fadein { from { opacity:0 } to { opacity:1 } }

.ep-lpm-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    animation: ep-lpm-slidein .32s cubic-bezier(.22,.68,0,1.15) both;
    font-family: 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
    font-size: 14px;
    color: #1a2535;
    box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.12);
}
@keyframes ep-lpm-slidein {
    from { transform: translateY(32px) scale(.97); opacity:0 }
    to   { transform: translateY(0) scale(1); opacity:1 }
}

/* -------------------------------------------------------
 * Header — glassmorphism
 * ----------------------------------------------------- */
.ep-lpm-header {
    background: rgba(245, 166, 35, 0.92);
    backdrop-filter: blur(12px) saturate(1.6);
    -webkit-backdrop-filter: blur(12px) saturate(1.6);
    border-radius: 16px 16px 0 0;
    padding: 11px 16px 0 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: nowrap;
    position: relative;
    overflow: hidden;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
}

/* subtle shine overlay */
.ep-lpm-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
    border-radius: 16px 16px 0 0;
}

.ep-lpm-pulse {
    width: 8px; height: 8px;
    border-radius: 50%; background: #fff; flex-shrink: 0;
    animation: ep-lpm-pulse 1.8s ease infinite;
    position: relative; z-index: 1;
}
@keyframes ep-lpm-pulse {
    0%,100% { opacity:1; transform:scale(1) }
    50%      { opacity:.4; transform:scale(.72) }
}
.ep-lpm-header-label {
    font-size: 11px; font-weight: 700; color: #fff;
    text-transform: uppercase; letter-spacing: .09em;
    position: relative; z-index: 1;
    padding-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* -------------------------------------------------------
 * Progress bar
 * ----------------------------------------------------- */
.ep-lpm-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255,255,255,.25);
    overflow: hidden;
    transition: opacity .3s ease;
}
.ep-lpm-progress-bar {
    height: 100%;
    width: 0%;
    background: rgba(255,255,255,.9);
    border-radius: 2px;
}

/* -------------------------------------------------------
 * Body
 * ----------------------------------------------------- */
.ep-lpm-body { display: flex; min-height: 0; }

.ep-lpm-photo {
    width: 175px; min-width: 175px;
    background: #f8f9fb;
    border-right: 1px solid #f0f1f3;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px 14px; gap: 10px; flex-shrink: 0;
}
.ep-lpm-photo img {
    width: 118px; height: 118px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #eaedf0;
    background: #fff; padding: 6px;
}
.ep-lpm-sku { font-size: 10px; color: #aab0ba; text-align: center; word-break: break-all; }

.ep-lpm-info {
    flex: 1; padding: 18px 22px;
    display: flex; flex-direction: column; gap: 11px;
    overflow: hidden;
    min-height: 0;
}
.ep-lpm-brand  { font-size: 10px; color: #f5a623; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.ep-lpm-name   { font-size: 15px; font-weight: 700; color: #1a2535; line-height: 1.4; }
.ep-lpm-desc   { font-size: 12.5px; color: #6b7280; line-height: 1.6; }
.ep-lpm-divider { border: none; border-top: 1px solid #f0f1f3; margin: 0; }

.ep-lpm-row   { display: flex; gap: 20px; flex-wrap: wrap; }
.ep-lpm-block { display: flex; flex-direction: column; gap: 3px; }
.ep-lpm-lbl   { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: #b0b8c4; font-weight: 600; }
.ep-lpm-val   { font-size: 13px; font-weight: 600; color: #1a2535; }
.ep-lpm-green { color: #16a34a; }
.ep-lpm-red   { color: #dc2626; }

/* Price counter — monospace feel for counting digits */
.ep-lpm-price {
    font-size: 24px; font-weight: 800; color: #f5a623;
    line-height: 1.1; letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
.ep-lpm-price-alt { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.ep-lpm-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.ep-lpm-badge  { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 5px; }
.ep-lpm-badge-vol { background: #ffffff; color: #065f46; border: 1px solid #a9b3ae; }
.ep-lpm-badge-pro { background: #ffffff; color: #225cff; border: 1px solid #0963d6; }

/* -------------------------------------------------------
 * Footer
 * ----------------------------------------------------- */
.ep-lpm-footer {
    border-top: 1px solid #f0f1f3;
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
    background: #fafbfc;
    border-radius: 0 0 16px 16px;
}
.ep-lpm-timestamp { font-size: 10.5px; color: #b0b8c4; font-style: italic; }
.ep-lpm-btns { display: flex; gap: 8px; }

.ep-lpm-btn-close {
    background: transparent; color: #6b7280;
    border: 1.5px solid #e5e7eb; border-radius: 9px;
    padding: 8px 16px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all .15s;
    font-family: 'Inter','Segoe UI',system-ui,sans-serif;
}
.ep-lpm-btn-close:hover { background: #f3f4f6; color: #374151; border-color: #d1d5db; }

.ep-lpm-btn-cta {
    background: #f5a623; color: #fff;
    border: none; border-radius: 9px;
    padding: 8px 20px; font-size: 12.5px; font-weight: 700;
    cursor: pointer; transition: background .15s, transform .12s;
    text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
    font-family: 'Inter','Segoe UI',system-ui,sans-serif;
    box-shadow: 0 2px 8px rgba(245,166,35,.35);
}
.ep-lpm-btn-cta:hover  { background: #e8950f; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,166,35,.45); }
.ep-lpm-btn-cta:active { transform: translateY(0); }

/* -------------------------------------------------------
 * Reveal animations
 * ----------------------------------------------------- */
.ep-lpm-line {
    overflow: hidden;
    max-height: 0; opacity: 0; transform: translateY(6px);
    transition: max-height .22s ease, opacity .22s ease, transform .22s ease;
}
.ep-lpm-line-visible { max-height: 300px; opacity: 1; transform: translateY(0); }

.ep-lpm-photo-hidden  { opacity: 0; max-height: 0; overflow: hidden; transform: translateX(-12px); transition: opacity .4s ease, transform .4s ease, max-height .4s ease; }
.ep-lpm-photo-reveal  { opacity: 1; max-height: 400px; transform: translateX(0); }

.ep-lpm-footer-hidden { opacity: 0; max-height: 0; overflow: hidden; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease, max-height .25s ease; }
.ep-lpm-footer-reveal { opacity: 1; max-height: 120px; transform: translateY(0); }

/* -------------------------------------------------------
 * Mobile
 * ----------------------------------------------------- */
@media (max-width: 540px) {
    .ep-lpm-modal, .ep-lpm-header { border-radius: 14px 14px 0 0; }
    .ep-lpm-footer { border-radius: 0 0 14px 14px; }
    .ep-lpm-body { flex-direction: column; }
    .ep-lpm-photo {
        width: 100%; min-width: unset;
        flex-direction: row; justify-content: flex-start;
        padding: 14px 18px; gap: 14px;
        border-right: none; border-bottom: 1px solid #f0f1f3;
    }
    .ep-lpm-photo img { width: 68px; height: 68px; }
    .ep-lpm-info { padding: 14px 18px; }
    .ep-lpm-footer { flex-direction: column; align-items: flex-start; }
    .ep-lpm-btns { width: 100%; }
    .ep-lpm-btn-cta { flex: 1; justify-content: center; }
}
