/* =============================================================
   Added to Bag Popup – Frontend Styles
   ============================================================= */

/*
 * NO-SCROLL FIX:
 * The popup is always in the DOM (inserted on page load).
 * Hidden via `visibility:hidden` + `pointer-events:none` only.
 * NO `display:none`, NO `hidden` attribute, NO `role="dialog"`.
 * Showing it only toggles a CSS class → browser never scrolls.
 */
.gs-popup {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13);
    font-weight: 300;
    font-family: 'Gotham', sans-serif !important;
    font-size: 14px;
    color: #1a1a1a;
    overflow-anchor: none;

    /* Hidden state — visibility keeps it out of tab order & AT,
       transform slides it right, opacity fades it.
       None of these trigger a browser scroll. */
    visibility: hidden;
    opacity: 0;
    transform: translateX(calc(100% + 32px));
    transition: opacity 0.28s ease,
                transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0s linear 0.32s;
    pointer-events: none;
}

.gs-popup--visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.28s ease,
                transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0s linear 0s;
    pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────────────── */
.gs-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #eeeeee;
}

.gs-popup__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1a1a1a;
}

.gs-popup__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #888888;
    padding: 0 2px;
    transition: color 0.15s ease;
}

.gs-popup__close:hover { color: #111111; }

/* ── Product items ───────────────────────────────────────────── */
.gs-popup__items {
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.gs-popup__items::-webkit-scrollbar { width: 4px; }
.gs-popup__items::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.gs-popup__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    animation: gs-fade-in 0.22s ease forwards;
}

.gs-popup__item:last-child { border-bottom: none; }

@keyframes gs-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gs-popup__item-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.gs-popup__item-info { flex: 1; min-width: 0; }

.gs-popup__item-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #111111;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-popup__item-attr { font-size: 12px; color: #777777; margin-bottom: 5px; }

.gs-popup__item-price { font-size: 14px; font-weight: 700; color: #1a1a1a; }

/* ── Footer ──────────────────────────────────────────────────── */
.gs-popup__footer {
    padding: 12px 16px;
    border-top: 1px solid #eeeeee;
}

.gs-popup__view-bag {
    display: block;
    width: 100%;
    padding: 11px 0;
    background: #1a1a1a;
    color: #ffffff !important;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 2px;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.gs-popup__view-bag:hover { background: #333333; }

/* ── Notice banner ───────────────────────────────────────────── */
.gs-popup__notice {
    padding: 10px 16px;
    font-size: 13px;
    text-align: center;
    color: #555555;
    background: #f5f5f5;
    line-height: 1.4;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gs-popup__notice:empty { display: none; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .gs-popup {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(calc(100% + 16px));
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    }
    .gs-popup--visible { transform: translateY(0); }
    .gs-popup__items { max-height: 50vh; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .gs-popup { width: 300px; top: 16px; right: 16px; }
}