/*
  Roomvo visualizer launch UI: shared button + PDP corner / PDP bar / product-card contexts.
  Loaded by snippets/roomvo-button.liquid (deduped via skip_styles, like cg-card-product.scss).
  Roomvo's script exclusively controls the visibility of .roomvo-stimr buttons —
  these styles never touch the visibility property.
*/

.roomvo-container{

    /* Default look: light grey, turning black when the button itself is hovered.
       The desktop PDP bar is the one exception (see below). */
    .roomvo-btn{display: flex; align-items: center; justify-content: center; gap: 1rem; background: #F2F2F3; color: #231F20; border: none; border-radius: 8px; padding: 1rem 1.8rem; font-family: inherit; font-size: 1.6rem; font-weight: 400; line-height: 1; cursor: pointer; transition: background 0.2s, color 0.2s;

        .roomvo-btn__icon{width: 2.2rem; height: auto; flex: 0 0 auto;}

        &:hover{background: #231F20; color: #FFF;}

    }

    /* Cards and the PDP bar carry a second, short label for mobile. */
    .roomvo-btn__txt--short{display: none;}

}


/* --- PDP: corner button over the main product image (desktop + mobile) --- */

.roomvo-container--corner{

    /* Mirrors .badge-item's mobile stacking: under 991px the badges wrapper
       loses its z-index, so the button must lift itself above the slides. */
    position: relative; z-index: 10;

    .roomvo-btn{

        @media(max-width:991px){font-size: 1.3rem; padding: 0.8rem 1.2rem; gap: 0.7rem;

            .roomvo-btn__icon{width: 1.8rem;}

        }

    }

}


/* --- PDP: bar below the media gallery (desktop + mobile) --- */

.roomvo-pdp-bar{display: none; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 1.5rem; padding: 2rem 2.4rem; background: rgba(35, 31, 32, 0.08); border-radius: 8px;

    /* Surfaced by cg-product.js only when Roomvo reveals the button inside it,
       so products without a simulation never show an empty bar. */
    &.is-active{display: flex;}

    .roomvo-pdp-bar__text{display: flex; flex-direction: column; gap: 0.4rem;

        .roomvo-pdp-bar__title{font-weight: 700; font-size: 1.8rem; line-height: 1.2;}

        .roomvo-pdp-bar__subtitle{font-size: 1.6rem; line-height: 1.2;}

    }

    /* Desktop keeps the original black button; the mobile bar uses the default grey one. */
    @media(min-width:992px){

        .roomvo-container--bar .roomvo-btn{background: #231F20; color: #FFF;

            &:hover{background: #F2F2F3; color: #231F20;}

        }

    }

    /* Mobile: a compact bar. Title and subtitle take exactly one line each (the
       font shrinks with the viewport on narrow phones), and the button carries
       the short label. */
    @media(max-width:991px){padding: 0.8rem 1.2rem; gap: 1rem; margin-top: 1rem;

        .roomvo-pdp-bar__text{gap: 0.2rem; min-width: 0;

            .roomvo-pdp-bar__title{font-size: min(1.4rem, 3.5vw); white-space: nowrap;}

            .roomvo-pdp-bar__subtitle{font-size: min(1.2rem, 3.2vw); white-space: nowrap;}

        }

        .roomvo-container--bar{flex: 0 0 auto;

            .roomvo-btn{font-size: 1.4rem; padding: 0.7rem 1.2rem; gap: 0.6rem;

                .roomvo-btn__icon{width: 1.9rem;}

            }

            .roomvo-btn__txt--full{display: none;}

            .roomvo-btn__txt--short{display: inline;}

        }

    }

}


/* --- Product cards ---
   Desktop: full-width button at the bottom of the image, revealed on hover.
   Mobile: always-visible small pill in the top-right corner of the image. */

/* Desktop bottom offset = 5px above the slider dots. The dots sit inside
   .product-card-slider (aspect 3/4, so 16/15 of this 4/5 image box and
   overflowing it by 1/15) at bottom: 8% of the slider, and are 12px tall:
   8% * 16/15 - 100%/15 is their bottom edge measured from the image box,
   + 12px is their top edge. The gap is px, not rem, because the dots are px
   and the root font size shrinks on smaller desktops. Keep in sync with
   cg-card-product-media.scss.
   z-index 6 puts the button above everything else on the card image: the
   country badge (auto), the Israel badge (4) and the Black Friday label (5). */
.roomvo-container--card{display: none; position: absolute; bottom: calc(8% * 16 / 15 - 100% / 15 + 12px + 5px); right: 1.2rem; left: 1.2rem; z-index: 6; pointer-events: none;

    .roomvo-btn{width: 100%; opacity: 0; transition: opacity 0.2s, background 0.2s, color 0.2s;}

}

@media(hover: hover) and (min-width: 992px){

    /* The container is the sizing context for the button's fluid font size. */
    .roomvo-container--card{display: block; container-type: inline-size;

        /* Always one row: label (6.8em) + icon + gap + padding come to about
           9.8em, so 9.9cqw of the container is the largest font that still
           fits. Wide cards keep the regular 1.6rem; narrow ones shrink. The
           button is full width with centred content, so the smaller side
           padding does not change how wide cards look. */
        .roomvo-btn{font-size: min(1.6rem, 9.9cqw); padding: calc(0.625em + 4px) 0.5em; gap: 0.625em; white-space: nowrap;

            /* Resting (hidden) state: pushed down and transparent. This transition
               is the exit, the exact mirror of the entrance below: same duration,
               the bounce curve reversed, fading out as it slides down. */
            transform: translateY(2rem); transition: opacity 0.45s ease-in, transform 0.45s cubic-bezier(0.36, 0, 0.66, -0.56), background 0.2s, color 0.2s;

            .roomvo-btn__icon{width: 1.375em;}

        }

    }

    .card-prod-wrap:hover .roomvo-container--card{pointer-events: auto;

        /* Entrance: fade in while sliding up from the bottom of the image; the
           curve overshoots slightly, which gives the small bounce at the end. */
        .roomvo-btn{opacity: 1; transform: none; transition: opacity 0.45s ease-out, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, color 0.2s;}

    }

    @media(prefers-reduced-motion: reduce){

        .roomvo-container--card .roomvo-btn{transform: none;}

    }

}

@media(max-width: 991px){

    /* The container spans the top of the image only so that its width can size
       the pill (cqw); it takes no taps itself. The pill sits in the top-right
       corner, level with the Black Friday label on the left (0.6rem from the
       top and the side, see bf-label.liquid) and about the label's height,
       which also scales with the card width. */
    .roomvo-container--card{display: flex; justify-content: flex-start; top: 0.6rem; right: 0.6rem; left: 0.6rem; bottom: auto; container-type: inline-size;

        .roomvo-btn{width: auto; opacity: 1; pointer-events: auto; font-size: 0.9rem; font-size: 6.2cqw; padding: 0.28em 0.5em; gap: 0.4em; border-radius: 0.4em;

            .roomvo-btn__icon{width: 1.3em;}

        }

        .roomvo-btn__txt--full{display: none;}

        .roomvo-btn__txt--short{display: inline;}

    }

}
