/**
 * La Bodeteka Delivery – WooCommerce Product Carousel (luxe cards)
 * ================================================================
 * Paired with woo-add-to-cart.css (the shared quick-view popup).
 *
 * IMPORTANT FOR MAINTAINERS:
 * Never add `transform`, `will-change`, `filter`, `contain` or `perspective`
 * to .lbdw-root, .lbdw-stage, .lbdw-track or .lbdw-card (nor to any ancestor
 * of them): every card contains the quick-view modal, which is position:fixed
 * and would break inside a transformed ancestor. Transforms below are only
 * applied to leaf elements that never contain the modal (images, arrows,
 * dots).
 *
 * Defaults here are kept in sync with the widget control defaults. The
 * Elementor-generated CSS overrides them only once the user customizes a
 * control (Elementor selectors are always more specific).
 */

.lbdw-root {
    --lbdw-cols: 4;
    --lbdw-gap: 20px;
    --lbdw-radius: 16px;
    --lbdw-arrow-size: 44px;
    --lbdw-rows: 1;
    position: relative;
    width: 100%;
}

.lbdw-root *,
.lbdw-root *::before,
.lbdw-root *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------------------
 * Stage & track (native scroll-snap engine, zero dependencies)
 * ------------------------------------------------------------------ */
.lbdw-stage {
    position: relative;
}

.lbdw-track {
    display: flex;
    align-items: stretch;
    gap: var(--lbdw-gap);
    /* Vertical breathing room so card shadows are not clipped:
       the negative margins cancel the padding (no layout shift). */
    margin: -18px 0 -34px;
    padding: 18px 0 34px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.lbdw-track::-webkit-scrollbar {
    display: none;
}

.lbdw-track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

/* ---------------------------------------------------------------------
 * Grid mode (layout_mode = grid): static rows, no slider behaviour.
 * Rows beyond the chosen count are hidden by woo-carousel.js (grid
 * capacity = columns x rows); without JS every product simply wraps.
 * ------------------------------------------------------------------ */
.lbdw-grid .lbdw-track {
    display: grid;
    grid-template-columns: repeat(var(--lbdw-cols, 4), minmax(0, 1fr));
    grid-auto-rows: auto;
    overflow: visible;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

/* Live grid info (columns × rows and visible products). */
.lbdw-grid-info {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(17, 17, 17, 0.6);
    text-align: center;
}

.lbdw-grid-info.is-empty,
.lbdw-grid-info.is-hidden {
    display: none;
}

.lbdw-grid .lbdw-card {
    flex: none; /* width comes from the grid track, not flex-basis */
    scroll-snap-align: none;
}

/* ---------------------------------------------------------------------
 * Card
 * ------------------------------------------------------------------ */
.lbdw-card {
    flex: 0 0 calc((100% - (var(--lbdw-gap) * (var(--lbdw-cols) - 1))) / var(--lbdw-cols));
    min-width: 0;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid rgba(17, 17, 17, 0.07);
    border-radius: var(--lbdw-radius);
    box-shadow: 0 2px 10px rgba(17, 17, 17, 0.05);
    /* Shadow/border only — never transform (see file header). */
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.lbdw-card:hover {
    border-color: rgba(176, 138, 86, 0.35);
    box-shadow: 0 14px 34px rgba(17, 17, 17, 0.12);
}

.lbdw-media {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--lbdw-radius) var(--lbdw-radius) 0 0;
    aspect-ratio: 1 / 1;
    background: #f6f4f1;
    text-decoration: none;
}

.lbdw-media img,
.lbdw-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.lbdw-zoom .lbdw-card:hover .lbdw-media img {
    transform: scale(1.06);
}

.lbdw-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 11px;
    border-radius: 999px;
    background: #b08a56;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(176, 138, 86, 0.35);
    pointer-events: none;
}

.lbdw-oos {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.78);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
 * Card body content
 * ------------------------------------------------------------------ */
.lbdw-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    text-align: center;
}

.lbdw-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.lbdw-title a {
    color: #1c1c1c;
    text-decoration: none;
    transition: color 0.25s ease;
}

.lbdw-title a:hover {
    color: #b08a56;
}

.lbdw-rating {
    display: block;
    line-height: 1;
}

.lbdw-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
    color: #c9a15a;
}

.lbdw-star {
    display: block;
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    opacity: 0.35;
}

.lbdw-star.is-on {
    fill: currentColor;
    stroke: currentColor;
    opacity: 1;
}

.lbdw-rating-count {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #9a9a9a;
    vertical-align: 1px;
}

.lbdw-prices {
    display: block;
    line-height: 1.2;
}

.lbdw-price-current {
    font-size: 20px;
    font-weight: 700;
    color: #1c1c1c;
    white-space: nowrap;
}

.lbdw-price-current sup {
    font-size: 0.6em;
}

.lbdw-price-old {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #9a9a9a;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    white-space: nowrap;
}

.lbdw-promo {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #b08a56;
    line-height: 1.4;
}

.lbdw-promo svg {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: -3px;
}

.lbdw-promo-disc {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(176, 138, 86, 0.14);
    color: #96703f;
    font-size: 11px;
    font-weight: 700;
    vertical-align: 1px;
}

.lbdw-excerpt {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #7d7d7d;
    overflow-wrap: break-word;
}

.lbdw-action {
    margin-top: auto;
    padding-top: 4px;
}

/* ---------------------------------------------------------------------
 * Navigation arrows
 * ------------------------------------------------------------------ */
.lbdw-arrow {
    position: absolute;
    top: calc(50% + var(--lbdw-arrow-y, 0px));
    transform: translateY(-50%); /* leaf element – never contains the modal */
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--lbdw-arrow-size);
    height: var(--lbdw-arrow-size);
    padding: 0;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 50%;
    background: #ffffff;
    color: #b08a56;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.14);
    transition: background-color 0.25s ease, color 0.25s ease,
        box-shadow 0.25s ease, opacity 0.25s ease;
}

.lbdw-arrow svg {
    width: 45%;
    height: 45%;
}

.lbdw-arrow:hover {
    background: #b08a56;
    color: #ffffff;
}

.lbdw-arrow:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.lbdw-arrow:focus-visible,
.lbdw-dot:focus-visible {
    outline: 2px solid #b08a56;
    outline-offset: 3px;
}

.lbdw-arrow-prev {
    left: var(--lbdw-arrow-x, 10px);
}

.lbdw-arrow-next {
    right: var(--lbdw-arrow-x, 10px);
}

.lbdw-arrows-sides {
    padding: 0 calc(var(--lbdw-arrow-size) + 14px);
}

/* Sides mode reserves its own gutter: the horizontal offset (which shifts
   arrows over the cards) does not apply here. */
.lbdw-arrows-sides .lbdw-arrow-prev {
    left: 0;
}

.lbdw-arrows-sides .lbdw-arrow-next {
    right: 0;
}

.lbdw-no-arrows .lbdw-arrow {
    display: none;
}

/* ---------------------------------------------------------------------
 * Dots
 * ------------------------------------------------------------------ */
.lbdw-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 8px;
    margin-top: 16px;
}

.lbdw-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 17, 17, 0.22);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.lbdw-dot.is-active {
    background: #b08a56;
    transform: scale(1.25); /* leaf element – never contains the modal */
}

.lbdw-no-dots .lbdw-dots {
    display: none;
}

/* All products fit on screen: hide the navigation entirely (JS toggles). */
.lbdw-root.is-static .lbdw-arrow,
.lbdw-root.is-static .lbdw-dots {
    display: none;
}

/* ---------------------------------------------------------------------
 * Motion preferences
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .lbdw-track {
        scroll-behavior: auto;
    }

    .lbdw-media img,
    .lbdw-card,
    .lbdw-arrow,
    .lbdw-dot,
    .lbdw-title a {
        transition: none !important;
    }

    .lbdw-zoom .lbdw-card:hover .lbdw-media img {
        transform: none;
    }
}
