/* =============================================================
   GLP-1 Lineup Widget v1.6.0
   Hims-style: full-bleed carousel, arrows overlay on edges,
   smooth JS-only drag with momentum snap.
   ============================================================= */

/* ── Section ─────────────────────────────────────────────────── */
.glp1-lineup-section {
    width: 100%;
    box-sizing: border-box;
    /* No overflow:hidden here — let the carousel wrapper handle clipping.
       Hidden on the section cuts off box-shadows and the arrow buttons. */
}
.glp1-lineup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 28px;
    line-height: 1.2;
}
.glp1-lineup-subtitle {
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
    font-size: 1rem;
}

/* ── Carousel wrapper — clips drag overflow, arrows overlay on edges ── */
.glp1-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ── Carousel — full width, no padding eating into it ─────────── */
.glp1-carousel {
    overflow-x: scroll;
    overflow-y: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 20px 0;
    box-sizing: border-box;
    cursor: grab;
    /* Desktop: no CSS snap — JS handles snap after mouse drag.
       Mobile/tablet: CSS snap added below via media query.    */
    touch-action: pan-y;
    will-change: scroll-position;
}
.glp1-carousel::-webkit-scrollbar { display: none; }
.glp1-carousel.glp1-grabbing {
    cursor: grabbing;
    user-select: none;
}

/* Mobile + tablet: CSS scroll-snap for silky native swipe.
   proximity = snaps when close to a card, but doesn't lock every pixel. */
@media (hover: none), (max-width: 1024px) {
    .glp1-carousel {
        scroll-snap-type: x proximity;
        -webkit-scroll-snap-type: x proximity;
        /* Allow horizontal finger swipe — browser owns this gesture */
        touch-action: pan-x pan-y;
    }
    .glp1-product-card {
        scroll-snap-align: start;
        scroll-snap-stop: normal;
    }
}

/* ── Track ────────────────────────────────────────────────────── */
.glp1-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 16px;
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box;
    width: max-content;
    min-width: 100%;
    /* GPU compositing for the track so cards don't repaint on scroll */
    will-change: transform;
}

/* ── Product Card ─────────────────────────────────────────────── */
.glp1-product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
    touch-action: inherit;
    transition: transform 0.35s ease, background 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}
.glp1-product-card:focus-visible {
    outline: 3px solid rgba(255,255,255,0.8);
    outline-offset: 3px;
}

/* ── Image Wrap ───────────────────────────────────────────────── */
.glp1-product-image-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    flex-shrink: 0;
    overflow: hidden; /* clips hover image to card image area */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Badge Row ────────────────────────────────────────────────── */
.glp1-card-top {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    pointer-events: none;
}
.glp1-card-top > * { pointer-events: auto; }
.glp1-badges-left {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
}

/* ── FDA Badge ────────────────────────────────────────────────── */
.glp1-fda-badge-wrap {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    pointer-events: none;
}
.glp1-fda-badge-wrap > * { pointer-events: auto; }

/* ── Badges ───────────────────────────────────────────────────── */
.glp1-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.6;
    position: relative;
}

/* ── FDA Badge circle ─────────────────────────────────────────── */
.glp1-fda-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.6);
    color: #fff;
    text-align: center;
    flex-shrink: 0;
    padding: 4px;
    box-sizing: border-box;
    line-height: 1.1;
}
.glp1-fda-arc-text { font-size: 0.38rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; margin-bottom: 1px; }
.glp1-fda-main  { font-size: 0.9rem; font-weight: 900; letter-spacing: 0.02em; line-height: 1; }
.glp1-fda-sub   { font-size: 0.3rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.8; margin-top: 2px; }
.glp1-fda-badge--custom { border: none; background: transparent; width: auto; height: auto; padding: 0; border-radius: 0; }
.glp1-fda-img   { display: block; width: 60px; height: auto; object-fit: contain; }

/* ── Image Inner ──────────────────────────────────────────────── */
.glp1-img-inner {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    max-width: 100%; max-height: 100%;
    padding: 18px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(calc(-50% + var(--glp1-img-x, 0px)), calc(-50% + var(--glp1-img-y, 0px))) scale(var(--glp1-img-scale, 1));
    transform-origin: center center;
    transition: transform 0.3s ease;
    /* Allow animation (float/bounce) to move image beyond its bounds */
    overflow: visible;
}

/* ── Product Images ───────────────────────────────────────────── */
.glp1-product-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 14px 28px rgba(0,0,0,0.25));
    transition: opacity 0.32s ease;
    will-change: transform;
    /* Prevent native browser image-drag from killing carousel drag */
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    draggable: false;
}
.glp1-img-default { opacity: 1; }
.glp1-img-hover {
    /* Positioned relative to .glp1-product-image-wrap (the nearest
       position:relative ancestor), NOT .glp1-img-inner.
       This way overflow:visible on img-inner doesn't affect hover img sizing,
       and the hover img always covers the full image area cleanly.            */
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center center;
    opacity: 0;
    filter: drop-shadow(0 14px 28px rgba(0,0,0,0.25));
    transition: opacity 0.32s ease;
    pointer-events: none;
    transform: none !important;
    animation: none !important;
    z-index: 2;
}
.glp1-gif-canvas {
    display: block;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 14px 28px rgba(0,0,0,0.25));
}
.glp1-gif-img { display: none; }
.glp1-img-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
/* Theme reset — many themes set img { max-width:100%; height:auto } */
.glp1-product-image-wrap img.glp1-product-img { max-width: none; height: 100%; }

/* ── Product Info ─────────────────────────────────────────────── */
.glp1-product-info { padding: 16px 18px 20px; }
.glp1-product-name { font-size: 1.2rem; font-weight: 800; color: #fff; margin: 0 0 5px; line-height: 1.2; }
.glp1-product-price { font-size: 0.82rem; color: rgba(255,255,255,0.88); margin: 0 0 2px; }
.glp1-product-subtitle { font-size: 0.78rem; font-weight: 500; color: rgba(255,255,255,0.62); margin: 0; }

/* ── Hover image scale ─────────────────────────────────────────── */
/* Only scale the default img — hover img must not be scaled/animated */
.glp1-product-card:hover .glp1-img-inner .glp1-img-default,
.glp1-product-card:hover .glp1-img-inner .glp1-gif-canvas,
.glp1-product-card:hover .glp1-img-inner .glp1-img-placeholder {
    transform: scale(1.04);
    transition: transform 0.3s ease;
}

/* ── Navigation arrows — absolutely positioned over carousel edges */
/* Hims-style: arrows float on top of the carousel, not beside it  */
.glp1-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    min-width: 42px; max-width: 42px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    color: #fff; cursor: pointer;
    align-self: center;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    padding: 0;
    box-sizing: border-box;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.glp1-prev { left: 12px; }
.glp1-next { right: 12px; }
.glp1-nav-btn:hover  { transform: translateY(-50%) scale(1.08); }
.glp1-nav-btn:active { transform: translateY(-50%) scale(0.93); }
.glp1-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; transform: translateY(-50%); }
.glp1-nav-btn .glp1-arrow-fallback {
    font-size: 18px; line-height: 1; color: inherit;
    transition: color 0.2s ease;
    /* prevent the text from shifting the button dimensions */
    display: flex; align-items: center; justify-content: center;
}
.glp1-nav-btn .glp1-arrow-icon {
    width: 18px; height: 18px;
    object-fit: contain; display: block;
    transition: opacity 0.2s ease;
}

/* ── Dots ─────────────────────────────────────────────────────── */
.glp1-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.glp1-dot {
    width: 8px; height: 8px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.3); cursor: pointer; padding: 0;
    transition: background 0.25s ease, width 0.25s ease, border-radius 0.25s ease;
}
.glp1-dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 767px) {
    .glp1-lineup-title { font-size: 1.35rem; }

    /* Arrows hidden on mobile — swipe is the UX */
    .glp1-nav-btn { display: none; }

    /* Slightly smaller dot indicators */
    .glp1-dot { width: 6px; height: 6px; }
    .glp1-dot.active { width: 18px; }

    .glp1-product-image-wrap { height: 220px; }

    .glp1-product-info { padding: 12px 14px 18px; }
    .glp1-product-name { font-size: 1.05rem; }
}

@media (max-width: 480px) {
    .glp1-product-image-wrap { height: 190px; }
}

/* =============================================================
   IMAGE HOVER ANIMATIONS
   ============================================================= */
@keyframes glp1-bounce {
    0%,100% { transform: translateY(0);     animation-timing-function: cubic-bezier(0.215,0.61,0.355,1); }
    20%     { transform: translateY(-20px); animation-timing-function: cubic-bezier(0.755,0.05,0.855,0.06); }
    40%     { transform: translateY(8px);   animation-timing-function: cubic-bezier(0.215,0.61,0.355,1); }
    55%     { transform: translateY(-14px); animation-timing-function: cubic-bezier(0.755,0.05,0.855,0.06); }
    70%     { transform: translateY(5px); }
    82%     { transform: translateY(-6px); }
    92%     { transform: translateY(2px); }
}
@keyframes glp1-float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-16px); }
}
@keyframes glp1-pulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.12); }
}
@keyframes glp1-shake {
    0%,100% { transform: translateX(0); }
    12%     { transform: translateX(-9px); }
    24%     { transform: translateX(9px); }
    36%     { transform: translateX(-7px); }
    48%     { transform: translateX(7px); }
    60%     { transform: translateX(-4px); }
    72%     { transform: translateX(4px); }
    84%     { transform: translateX(-2px); }
}
@keyframes glp1-swing {
    0%,100% { transform: rotate(0deg); }
    20%     { transform: rotate(13deg); }
    40%     { transform: rotate(-9deg); }
    60%     { transform: rotate(6deg); }
    80%     { transform: rotate(-3deg); }
}
@keyframes glp1-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes glp1-rubber {
    0%,100% { transform: scaleX(1)    scaleY(1); }
    15%     { transform: scaleX(1.28) scaleY(0.72); }
    30%     { transform: scaleX(0.76) scaleY(1.28); }
    45%     { transform: scaleX(1.16) scaleY(0.86); }
    60%     { transform: scaleX(0.94) scaleY(1.06); }
    75%     { transform: scaleX(1.06) scaleY(0.94); }
}
@keyframes glp1-jello {
    0%,11%,100% { transform: skewX(0)       skewY(0); }
    22%         { transform: skewX(-13deg)  skewY(-13deg); }
    33%         { transform: skewX(6.5deg)  skewY(6.5deg); }
    44%         { transform: skewX(-3.3deg) skewY(-3.3deg); }
    55%         { transform: skewX(1.6deg)  skewY(1.6deg); }
    66%         { transform: skewX(-0.8deg) skewY(-0.8deg); }
    77%         { transform: skewX(0.4deg)  skewY(0.4deg); }
    88%         { transform: skewX(-0.2deg) skewY(-0.2deg); }
}
@keyframes glp1-wobble {
    0%,100% { transform: translateX(0)     rotate(0deg); }
    15%     { transform: translateX(-20px) rotate(-6deg); }
    30%     { transform: translateX(16px)  rotate(5deg); }
    45%     { transform: translateX(-10px) rotate(-3.5deg); }
    60%     { transform: translateX(7px)   rotate(2.5deg); }
    75%     { transform: translateX(-3px)  rotate(-1.5deg); }
}
@keyframes glp1-tada {
    0%              { transform: scale(1)   rotate(0deg); }
    5%,15%          { transform: scale(0.9) rotate(-3deg); }
    10%,20%         { transform: scale(0.9) rotate(3deg); }
    25%,35%,55%,65% { transform: scale(1.1) rotate(3deg); }
    30%,40%,50%,60% { transform: scale(1.1) rotate(-3deg); }
    70%             { transform: scale(1.1) rotate(3deg); }
    100%            { transform: scale(1)   rotate(0deg); }
}
@keyframes glp1-flip {
    0%   { transform: perspective(500px) rotateY(0deg); }
    40%  { transform: perspective(500px) rotateY(-180deg) scale(1.08); }
    100% { transform: perspective(500px) rotateY(-360deg); }
}
