/* partial_alinks.css — FULL DROP-IN REPLACEMENT (GRID VERSION)
   • Keeps your look/gradients/tokens
   • Fixed+transform center (no open-shift)
   • Retailers in a responsive GRID: 3→2→1 columns
   • Logo slots sized to prevent layout jank
*/

/* ───────────────────────── Popup container ───────────────────────── */
.affiliate-popup {
    position: fixed;
    left: 50vw;
    top: 50vh;
    transform: translate(-50%, -50%);
    width: min(42rem, calc(100vw - 2rem));
    max-height: min(82vh, calc(100vh - 7rem));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;

    background: linear-gradient(180deg, #1c1c1e, #141416) border-box;
    border: 1px solid var(--section-medium-background-color, rgba(255, 255, 255, .06));
    border-radius: var(--card-radius2, 10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
    color: var(--white-color-1, #fff);
    z-index: 97525;
    font-family: var(--identity-font, 'Open Sans', Arial, Helvetica, sans-serif);
    contain: layout paint;
    will-change: transform;
}

@media (max-width:600px) {
    .affiliate-popup {
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 6rem);
    }
}

/* ───────────────────────── Header (drag bar) ─────────────────────── */
.popup-header {
    cursor: move;
    background: linear-gradient(180deg, #27272a, #202024);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--section-medium-background-color, rgba(255, 255, 255, .06));
}

.popup-header h3 {
    margin: 0;
    font: var(--font-weight7, 700) var(--ft-20-19, 1.15rem)/1.2 var(--identity-font, sans-serif);
    letter-spacing: -.25px;
    color: #f2f2f3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-popup-btn {
    background: transparent;
    color: #e9e9ea;
    border: none;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 6px 9px;
    border-radius: 8px;
}

.close-popup-btn:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.close-popup-btn:focus-visible {
    outline: 2px solid var(--card-color, #394cc8);
    outline-offset: 3px;
}

/* ───────────────────────── Content sections ──────────────────────── */
.popup-content {
    padding: 16px 18px;
    display: grid;
    gap: 18px;
}

.popup-lead {
    margin: 0 0 8px;
    color: var(--grey-color-3, #b0b0b0);
    font: 400 var(--ft-14-13, .95rem)/1.2 var(--identity-font, sans-serif);
}

/* ───────── Primary seller CTA (gradient matches site) ───────────── */


/* ───────── Primary seller CTA — LOGO LEFT, NAME CENTERED (FULL BLOCK REPLACEMENT) ───────── */
.primary-seller-btn {
    --logo-slot: 112px;
    /* fixed logo track */
    display: grid;
    grid-template-columns: var(--logo-slot) 1fr var(--logo-slot);
    align-items: center;
    justify-items: center;
    /* centers content in its grid cell */
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    /* uniform padding; grid handles spacing */
    background: linear-gradient(90deg, var(--card-accent, #394cc8), var(--card-color, #00aeff));
    color: #fff;
    border: none;
    border-radius: 10px;
    letter-spacing: .2px;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .2s ease, filter .15s ease;
}

.primary-seller-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(var(--card-rgb, 57, 76, 200), .45);
    filter: brightness(1.02);
}

/* If the logo fails and .no-logo is added, remove the side tracks so text still centers */
.primary-seller-btn.no-logo {
    grid-template-columns: 0 1fr 0;
}

/* LOGO: locked to hard-left track */
.primary-seller-btn .retailer-logo-wrap {
    grid-column: 1;
    justify-self: start;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* keep whole button clickable */
}

.primary-seller-btn .retailer-logo {
    height: 22px;
    padding: 0 4px;
    width: auto;
    object-fit: contain;
}

/* NAME: lives in the center track and stays truly centered */
.primary-seller-btn .retailer-name {
    grid-column: 2;
    justify-self: center;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-seller-btn .retailer-name {
    font: 500 var(--ft-18-16, .95rem)/1.25 var(--identity-font);
}

/* ───────── Retailers GRID (3→2→1 columns) ───────────────────────── */
/* ───────── Retailers GRID (3→2→1 columns) — CARD LAYOUT UPDATE (name under logo) ───────── */
.retailer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width:920px) {
    .retailer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Vertical stack: logo on top, name below */
.retailer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    background: var(--section-medium-background-color);
    border-radius: 10px;
    padding: 6px 12px;
    min-height: 90px;
    gap: 8px;
    transition: background-color .15s ease, border-color .15s ease, transform .08s ease;
}

.retailer-card:hover {
    background: var(--section-light-background-color);
    transform: translateY(-1px);
}

.retailer-card:focus-visible {
    outline: 2px solid var(--card-color, #394cc8);
    outline-offset: 2px;
}

/* fixed logo slot prevents jank */
.retailer-card .retailer-logo-wrap {
    width: 112px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.retailer-card .retailer-logo {
    height: 26px;
    width: auto;
    object-fit: contain;
}

/* Name under logo */
.retailer-name {
    color: var(--white-color-1);
    font: 400 var(--ft-16-15, .95rem)/1.25 var(--identity-font);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.retailer-grid .retailer-logo {
    height: 22px;
}

/* ───────── Amazon search (button image provided) ─────────────────── */
/* partial_alinks.css — FULL DROP-IN (AMAZON SEARCH BLOCK ONLY) */
.amazon-search {
    border-top: 1px solid var(--section-medium-background-color, rgba(255, 255, 255, .06));
    padding-top: 12px;
}

.amazon-search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.amazon-search-input {
    width: 100%;
    height: 40px;
    background: #1a1a1c;
    color: #f1f1f2;
    font: 400 var(--ft-14-13, .85rem)/1 var(--identity-font);
    border: 1px solid var(--section-light-background-color, rgba(255, 255, 255, .08));
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
    font-family: var(--identity-font);
}

.amazon-search-input:focus {
    border-color: rgba(var(--card-rgb, 57, 76, 200), .8);
    box-shadow: 0 0 0 3px rgba(var(--card-rgb, 57, 76, 200), .25);
}

.amazon-search-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    background: #ff9900;
    color: #111;
    border: none;
    border-radius: 10px;
    padding: 0 14px;
    letter-spacing: -.25px;
    font: 700 var(--ft-16-15, .95rem)/1 var(--identity-font);
    cursor: pointer;
    transition: filter .15s ease, transform .08s ease;
    text-decoration: none;
}

.amazon-search-btn:hover {
    filter: brightness(1.10);
}

/* Wrap for image + SVG overlay */
.amazon-logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    width: 34px;
    /* matches provided webp width for consistent overlay fit */
    flex: 0 0 auto;
}

/* Base image */
.amazon-logo {
    display: block;
    height: 22px;
    width: 84px;
    object-fit: contain;
}

/* SVG overlay — BLACK */
.amazon-logo-overlay {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    color: #000;
    /* ensure pure black */
    pointer-events: none;
    /* don't block clicks */
    opacity: 0.95;
    /* slight blend over webp; adjust if needed */
}

/* Keep text tidy next to the logo */
.amazon-search-btn>span:last-child {
    white-space: nowrap;
}

.amazon-search-note {
    margin: 8px 0 0;
    font: 400 var(--ft-14-13, .85rem)/1.35 var(--identity-font);
    color: var(--grey-color-3, #b0b0b0);
}

.amazon-search-note a {
    color: var(--card-color, var(--site-start-color));
}

.amazon-search-note a:hover {
    text-decoration: underline
}

/* ───────── Resizer handle ───────────────────────────────────────── */
.popup-resizer {
    width: 16px;
    height: 16px;
    position: absolute;
    bottom: 6px;
    right: 6px;
    cursor: se-resize;
    opacity: .65;
}

.popup-resizer::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .05));
    mask-image: radial-gradient(circle at 100% 100%, #000 44%, transparent 46%),
        linear-gradient(135deg, transparent 48%, #000 49% 51%, transparent 52%);
}

/* ───────── Button feedback (spinner / error pulse) ─────────────── */
.small-card-buy-button.spinning::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: .25em;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: egs-spin .8s linear infinite;
}

@keyframes egs-spin {
    to {
        transform: rotate(360deg);
    }
}

.small-card-buy-button.flash-error {
    animation: egs-flash 600ms ease-in-out 2;
}

@keyframes egs-flash {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(255, 77, 77, .35);
    }
}

/* Active state ring (matches your theme) */
.alink.active .small-card-buy-button {
    outline: 2px solid var(--card-color, #394cc8);
    outline-offset: 2px;
}

/* Motion safety */
@media (prefers-reduced-motion:reduce) {

    .primary-seller-btn,
    .retailer-card,
    .amazon-search-btn {
        transition: none;
    }
}















/* partial_alinks.css — AFFILIATE POPUP OPEN/CLOSE ANIMATIONS (FULL DROP‑IN SECTION)
   • Desktop: crisp pop-in (slight overshoot) / pop-out fade
   • Mobile (≤600px): sheet-style slide up/down
   • Respects your existing center/drag logic. If the popup was moved (data-drag-anchored="true"),
     it uses anchored variants that don’t rely on translate(-50%,-50%).
   • Reduced motion: disables animations automatically.
*/

:root {
    --ap-open-dur: 380ms;
    --ap-close-dur: 240ms;
    --ap-ease: cubic-bezier(.2, .8, .2, 1);
    --ap-ease-out: cubic-bezier(.22, .61, .36, 1);
}

/* During animation we hint the compositor for butter-smooth frames */
.affiliate-popup.is-opening,
.affiliate-popup.is-closing {
    will-change: transform, opacity;
}

/* Default desktop animation names (centered transform path). */
.affiliate-popup.is-opening {
    animation: apPopIn var(--ap-open-dur) var(--ap-ease) both;
}

.affiliate-popup.is-closing {
    animation: apPopOut var(--ap-close-dur) var(--ap-ease-out) both;
}

/* If the user has dragged the popup before (pixel-anchored), use scale-only variants. */
.affiliate-popup[data-drag-anchored="true"].is-opening {
    animation-name: apAnchoredIn;
}

.affiliate-popup[data-drag-anchored="true"].is-closing {
    animation-name: apAnchoredOut;
}

/* Mobile: change to sheet-style slide up/down. */
@media (max-width:600px) {
    .affiliate-popup.is-opening {
        animation-name: apSheetIn;
    }

    .affiliate-popup.is-closing {
        animation-name: apSheetOut;
    }

    .affiliate-popup[data-drag-anchored="true"].is-opening {
        animation-name: apAnchoredSheetIn;
    }

    .affiliate-popup[data-drag-anchored="true"].is-closing {
        animation-name: apAnchoredSheetOut;
    }
}

/* ── Keyframes: desktop (centered) ─────────────────────────────── */
@keyframes apPopIn {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(.92);
        filter: saturate(.9) blur(.3px);
    }

    60% {
        transform: translate(-50%, -50%) scale(1.02);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: none;
    }
}

@keyframes apPopOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -46%) scale(.96);
    }
}

/* ── Keyframes: desktop when pixel‑anchored (no center translate) ─ */
@keyframes apAnchoredIn {
    from {
        opacity: 0;
        transform: scale(.96);
        filter: saturate(.9) blur(.3px);
    }

    60% {
        transform: scale(1.02);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: none;
    }
}

@keyframes apAnchoredOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(.96);
    }
}

/* ── Keyframes: mobile sheet (centered final) ──────────────────── */
@keyframes apSheetIn {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 24vh)) scale(1);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes apSheetOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 24vh)) scale(1);
    }
}

/* ── Keyframes: mobile sheet when pixel‑anchored ───────────────── */
@keyframes apAnchoredSheetIn {
    from {
        opacity: 0;
        transform: translateY(24vh) scale(1);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes apAnchoredSheetOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(24vh) scale(1);
    }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {

    .affiliate-popup.is-opening,
    .affiliate-popup.is-closing {
        animation: none !important;
    }
}