/* ============================================================
   Rankbeta — Product Showcase Widget
   Card: [bottle col LEFT, flush to edge, z-index:2] | [text RIGHT]
   Bottle has zero padding so its image sits against the card's
   left border — it visually "covers" the card left edge.
   clip-path on viewport so bottle top-overflow is never cut.
   ============================================================ */

.rb-ps-section,
.elementor-widget-rankbeta_ps,
.elementor-widget-rankbeta_ps .elementor-widget-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.rb-ps-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.rb-ps-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.rb-ps-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 72px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 52px;
}

/* ============================================================
   HEADER
   ============================================================ */
.rb-ps-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.rb-ps-label {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 15px;
    letter-spacing: 0.5px;
    display: inline-block;
}
.rb-ps-heading {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.15;
}
.rb-ps-subtext {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.75;
    max-width: 540px;
}

/* ============================================================
   CAROUSEL WRAPPER  [ ← Prev ] [ Viewport ] [ Next → ]
   CSS Grid: 9% left arrow lane | 1fr viewport | 9% right arrow lane.
   Each arrow sits in its own dedicated column so the first card's
   bottle (which overflows left of the viewport) never touches the arrow.
   padding-top creates visible space for the bottle top-overflow.
   ============================================================ */
.rb-ps-carousel-wrap {
    display: grid;
    grid-template-columns: 9% 1fr 9%;
    align-items: center;
    width: 100%;
    padding-top: 90px;   /* matches bottle overflow amount */
}

/* Left arrow: pinned to the LEFT of its 9% lane — bottle overflow
   sits in the gap between the arrow's right edge and the viewport */
.rb-ps-carousel-wrap > .rb-ps-arrow:first-child {
    justify-self: start;
}

/* Right arrow: pinned to the RIGHT of its 9% lane */
.rb-ps-carousel-wrap > .rb-ps-arrow:last-child {
    justify-self: end;
}

/* ============================================================
   VIEWPORT
   KEY FIX: clip-path instead of overflow:hidden.
   - Left/Right clips the sliding track (carousel works ✓)
   - Top: -200px allows bottle to overflow upward without cutting (✓)
   - Bottom: 0 clips normally
   ============================================================ */
.rb-ps-viewport {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: visible;                          /* do NOT use overflow:hidden */
    clip-path: inset(-200px 0px 0px -20px);       /* top: bottle overflow ↑ | left: -20px lets first card bottle render fully */
}

/* ── Track ──
   JS sets gap and translateX in pixels for exact card sizing.
   --rb-card-width is calculated by JS: (viewportWidth - gap*(perView-1)) / perView
   ── */
.rb-ps-track {
    display: flex;
    gap: 16px;                    /* default — overridden by JS from data-card-gap */
    will-change: transform;
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   CARD
   No outer padding — gap between cards is set on the track.
   Width set by JS (--rb-card-width) so 3 cards fill 100%.
   ============================================================ */
.rb-ps-card {
    flex: 0 0 var(--rb-card-width, calc(100% / 3));
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   CARD INNER — flex ROW: [img-col LEFT] | [text-col RIGHT]
   The img-col has zero padding so the bottle image sits flush
   against the card's left border — it visually covers the left
   rounded corner, creating the reference-image "overlap" effect.

   CSS custom properties let Elementor controls override each
   value independently without fighting each other.
   ============================================================ */
.rb-ps-card-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    position: relative;
    overflow: visible;

    /* ── Bottle position / transform vars ────────────────────
       --rb-img-col-base : base flex-width of the bottle column
       --rb-bottle-left  : left offset (Elementor DIMENSIONS LEFT input;
                           negative = bottle pops LEFT out of card and
                           img-col flex-basis shrinks so text shifts right)
       --rb-bottle-scale : scale transform on the bottle image
       --rb-bottle-rotate: rotate transform on the bottle image
    ── */
    --rb-img-col-base:  120px;
    --rb-bottle-left:   0px;
    --rb-bottle-scale:  1;
    --rb-bottle-rotate: 0deg;
    --rb-card-radius:   10px;

    /* Background is output by Elementor Group_Control_Background
       (golden gradient by default via fields_options in the PHP widget).
       Fallback below in case Elementor styles have not yet loaded. */
    background:    linear-gradient( 145deg, #2e2100 0%, #130e00 100% );
    border-radius: var(--rb-card-radius);
}

/* ============================================================
   IMAGE COLUMN  — flex child, flush LEFT in the card row.
   ZERO padding so the bottle image is against the card's left
   border — it visually covers the left rounded corner.
   z-index: 2 puts bottle in front of the card background.
   overflow: visible + margin-top: -90px on img-wrap lets the
   bottle top escape above the card (into carousel-wrap padding).
   ============================================================ */
.rb-ps-img-col {
    /*
     * flex-basis = base-width + left-offset.
     * When --rb-bottle-left is negative (bottle popping left), the basis
     * shrinks by that amount — the text-col automatically fills the freed
     * space, so content shifts right proportionally.
     */
    flex: 0 0 calc(var(--rb-img-col-base) + var(--rb-bottle-left));
    margin-left: var(--rb-bottle-left);   /* negative = bottle extends LEFT of card */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;  /* pin bottle bottom to card bottom */
    padding: 0;                 /* ZERO padding — flush to card edge */
    position: relative;
    z-index: 2;
    overflow: visible;
}

/* The image wrap overflows ABOVE the card-inner.
   margin-top default: -90px (matches bottle_margin TOP default).
   Elementor DIMENSIONS selector overrides this inline. */
.rb-ps-img-wrap {
    width: 100%;
    height: 240px;               /* Elementor: Bottle Height */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    margin-top: -90px;
}

.rb-ps-img-wrap img {
    display: block;
    width: auto;
    max-width: 100%;           /* fills the column — was 90px fixed, now fluid */
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    position: relative;
    z-index: 2;
    /*
     * Transform vars set by Elementor controls.
     * transform-origin: bottom center keeps the bottle pinned to card bottom
     * while scaling / rotating (reference image: large bottles anchored at base).
     */
    transform: scale(var(--rb-bottle-scale)) rotate(var(--rb-bottle-rotate));
    transform-origin: bottom center;
}

/* Radial glow behind bottle */
.rb-ps-img-glow {
    position: absolute;
    border-radius: 50%;
    width: 120%;
    padding-bottom: 120%;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0.16;
    pointer-events: none;
    filter: blur(24px);
    background-color: #C9A052;
}

/* ============================================================
   TEXT COLUMN  — right side of the card row.
   Small left padding provides a gap between bottle and text.
   ============================================================ */
.rb-ps-text-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 22px 20px 22px 14px;
    gap: 8px;                    /* Elementor: Details Gap */
}

/* ── Each detail item: individual margin controls via Elementor ── */
.rb-ps-card-category {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin: 0;
    opacity: 0.8;
}

.rb-ps-card-divider {
    width: 32px;
    height: 1px;
    background-color: rgba(201,160,82,0.55);
    flex-shrink: 0;
    margin: 0;
}

.rb-ps-card-name {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
}

.rb-ps-card-desc {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 11px;
    line-height: 1.65;
}

.rb-ps-card-price {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.rb-ps-card-btn {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    transition: background-color 0.25s ease, color 0.25s ease,
                border-color 0.25s ease, transform 0.25s ease;
}

/* ============================================================
   BUTTON HOVER ANIMATIONS  (Elementor prefix_class: rb-btn-anim-)
   ============================================================ */
.rb-btn-anim-grow   .rb-ps-card-btn:hover { transform: scale(1.06); }
.rb-btn-anim-shrink .rb-ps-card-btn:hover { transform: scale(0.94); }
.rb-btn-anim-float  .rb-ps-card-btn:hover { transform: translateY(-5px); }
.rb-btn-anim-pulse  .rb-ps-card-btn:hover { animation: rb-btn-pulse 0.4s ease; }
.rb-btn-anim-bounce .rb-ps-card-btn:hover { animation: rb-btn-bounce 0.5s ease; }

@keyframes rb-btn-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.07); }
}
@keyframes rb-btn-bounce {
    0%, 100% { transform: translateY(0); }
    40%      { transform: translateY(-8px); }
    70%      { transform: translateY(-4px); }
}

/* ============================================================
   NAVIGATION ARROWS  — gold circular, flank carousel
   ============================================================ */
.rb-ps-arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #C9A052;
    border: 1px solid rgba(201,160,82,0.5);
    background: rgba(201,160,82,0.06);
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease,
                transform 0.2s ease;
    opacity: 0.85;
    align-self: center;
    margin-top: 45px;      /* visually center with card body (below overflow) */
    flex-shrink: 0;
    /*
     * CRITICAL: position + z-index ensure the arrow renders above the
     * viewport's clip-path area. The viewport uses clip-path: inset(-200px 0 0 -20px)
     * which extends its pointer-event region 20 px into the prev-arrow column —
     * without z-index the viewport silently swallows prev-arrow clicks.
     */
    position: relative;
    z-index: 3;
}
.rb-ps-arrow:hover {
    opacity: 1;
    background: rgba(201,160,82,0.14);
    border-color: rgba(201,160,82,0.9);
    transform: scale(1.08);
}
.rb-ps-arrow svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* ============================================================
   NAV DOTS
   ============================================================ */
.rb-ps-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}
.rb-ps-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    background-color: rgba(201,160,82,0.3);
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.rb-ps-dot.rb-ps-dot--active {
    background-color: #C9A052;
    transform: scale(1.4);
}

/* ============================================================
   ENTRANCE ANIMATIONS
   ============================================================ */
.rb-ps-header {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.75s cubic-bezier(0.22,1,0.36,1),
                transform 0.75s cubic-bezier(0.22,1,0.36,1);
}
.rb-ps-img-wrap {
    opacity: 0;
    transform: translateY(44px);
    transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1),
                transform 0.9s cubic-bezier(0.22,1,0.36,1);
    will-change: opacity, transform;
}
.rb-ps-card-inner {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
                transform 0.7s cubic-bezier(0.22,1,0.36,1);
    will-change: opacity, transform;
}

/* Stagger per visible card (3 at a time) */
.rb-ps-card:nth-child(1) .rb-ps-img-wrap   { transition-delay: 0.04s; }
.rb-ps-card:nth-child(2) .rb-ps-img-wrap   { transition-delay: 0.18s; }
.rb-ps-card:nth-child(3) .rb-ps-img-wrap   { transition-delay: 0.32s; }
.rb-ps-card:nth-child(4) .rb-ps-img-wrap   { transition-delay: 0.04s; }
.rb-ps-card:nth-child(5) .rb-ps-img-wrap   { transition-delay: 0.18s; }
.rb-ps-card:nth-child(6) .rb-ps-img-wrap   { transition-delay: 0.32s; }
.rb-ps-card:nth-child(1) .rb-ps-card-inner { transition-delay: 0.34s; }
.rb-ps-card:nth-child(2) .rb-ps-card-inner { transition-delay: 0.48s; }
.rb-ps-card:nth-child(3) .rb-ps-card-inner { transition-delay: 0.62s; }
.rb-ps-card:nth-child(4) .rb-ps-card-inner { transition-delay: 0.34s; }
.rb-ps-card:nth-child(5) .rb-ps-card-inner { transition-delay: 0.48s; }
.rb-ps-card:nth-child(6) .rb-ps-card-inner { transition-delay: 0.62s; }

.rb-ps-section.rb-ps-entered .rb-ps-header,
.rb-ps-section.rb-ps-entered .rb-ps-img-wrap,
.rb-ps-section.rb-ps-entered .rb-ps-card-inner {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .rb-ps-inner    { padding: 60px 24px; gap: 36px; }
    .rb-ps-img-col  { flex: 0 0 96px; }
    .rb-ps-img-wrap { height: 200px; }
    .rb-ps-img-wrap img { max-width: 76px; }
}
/* ── Tablet / phablet: 2 cards (768 ↓) ── */
@media (max-width: 767px) {
    .rb-ps-inner          { padding: 48px 16px; gap: 28px; }
    .rb-ps-carousel-wrap  { padding-top: 60px; grid-template-columns: 36px 1fr 36px; }
    /* 2-card sizes — smaller bottle column so two cards fit */
    .rb-ps-img-col        { flex: 0 0 80px; }
    .rb-ps-img-wrap       { height: 190px; margin-top: -60px; }
    .rb-ps-img-wrap img   { max-width: 70px; }
    .rb-ps-text-col       { padding: 16px 12px 16px 10px; gap: 6px; }
    .rb-ps-card-name      { font-size: 13px; }
    .rb-ps-card-price     { font-size: 15px; }
    .rb-ps-card-desc      { font-size: 10px; }
    .rb-ps-card-btn       { font-size: 9px; letter-spacing: 1.5px; }
    .rb-ps-arrow          { width: 32px; height: 32px; margin-top: 30px; }
    .rb-ps-arrow svg      { width: 13px; height: 13px; }
    /* Mobile: skip entrance */
    .rb-ps-header,
    .rb-ps-img-wrap,
    .rb-ps-card-inner {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ── Very small phones (<480px): 1 card to avoid cramping ── */
@media (max-width: 479px) {
    .rb-ps-carousel-wrap  { padding-top: 70px; grid-template-columns: 40px 1fr 40px; }
    .rb-ps-img-col        { flex: 0 0 100px; }
    .rb-ps-img-wrap       { height: 220px; margin-top: -70px; }
    .rb-ps-img-wrap img   { max-width: 80px; }
    .rb-ps-text-col       { padding: 18px 14px 18px 10px; gap: 7px; }
    .rb-ps-card-name      { font-size: 15px; }
    .rb-ps-card-price     { font-size: 17px; }
    .rb-ps-card-desc      { font-size: 11px; }
    .rb-ps-card-btn       { font-size: 10px; }
    .rb-ps-arrow          { width: 36px; height: 36px; margin-top: 35px; }
    .rb-ps-arrow svg      { width: 14px; height: 14px; }
}
