/* Beacon Featured Products — Elementor widget styles */

/* Let the widget shrink inside Elementor's flex containers so the mobile
   carousel scrolls internally instead of stretching the page width. */
.elementor-widget-beacon_featured,
.elementor-widget-beacon_featured > .elementor-widget-container {
    min-width: 0;
    max-width: 100%;
}

.beacon-featured {
    width: 100%;
    /* Header row (title + link) and the product grid below it. */
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 16px;
    row-gap: 28px;
}

.beacon-featured__title {
    grid-column: 1;
}

.beacon-featured__all {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.beacon-featured__grid {
    grid-column: 1 / -1;
}

.beacon-featured__title {
    margin: 0;
    font-size: 44px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1f2421;
}

.beacon-featured__all {
    font-size: 15px;
    font-weight: 600;
    color: #1f2421;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.beacon-featured__all:hover {
    color: #f25a0c;
}

.beacon-featured__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.beacon-fp {
    background: #f6f6f5;
    border-radius: 16px;
    padding: 24px 20px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.beacon-fp__rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    /* Reserve the row's height so cards stay aligned even when a product
       has no rating (the row renders empty). */
    min-height: 16px;
}

.beacon-fp__stars {
    --rating: 0;
    display: inline-block;
    font-size: 15px;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.beacon-fp__stars::before {
    content: "\2605\2605\2605\2605\2605";
    letter-spacing: 2px;
    background: linear-gradient(
        90deg,
        #f0bf61 calc(var(--rating) / 5 * 100%),
        #d8d8d6 calc(var(--rating) / 5 * 100%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.beacon-fp__rating-text {
    font-size: 13px;
    color: #464543;
}

.beacon-fp__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 220px;
    margin-bottom: 18px;
}

.beacon-fp__media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
}

.beacon-fp__sale {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    background: #f25a0c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 22px;
    border-radius: 4px;
}

.beacon-fp__name {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #464543;
}

.beacon-fp__name a {
    color: inherit;
    text-decoration: none;
}

.beacon-fp__name a:hover {
    color: #f25a0c;
}

.beacon-fp__price {
    font-size: 20px;
    font-weight: 700;
    color: #1f2421;
    margin-bottom: 18px;
}

.beacon-fp__price del {
    color: #979797;
    font-weight: 500;
    margin-right: 8px;
}

.beacon-fp__price ins {
    text-decoration: none;
}

.beacon-fp__btn {
    margin-top: auto;
    display: inline-block;
    background: #efe2d3;
    color: #2b2b2b !important;
    border: none;
    border-radius: 999px;
    padding: 13px 40px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.beacon-fp__btn:hover {
    background: #e6d3bd;
}

.beacon-fp__btn.added {
    opacity: 0.85;
}

/* Responsive fallback (column counts are also controlled per-device in Elementor) */
@media (max-width: 1024px) {
    .beacon-featured__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .beacon-featured__title {
        font-size: 36px;
    }
}

@media (max-width: 767px) {
    /* Stack on mobile and move the "browse all" link below the products. */
    /* Hard stop against horizontal page overflow on mobile: clip at the
       widget boundary; the carousel grid below scrolls on its own. */
    .elementor-widget-beacon_featured > .elementor-widget-container {
        overflow-x: hidden;
    }
    .beacon-featured {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
        min-width: 0;
    }
    .beacon-featured__title {
        order: 1;
        font-size: 30px;
    }
    .beacon-featured__grid {
        order: 2;
    }
    .beacon-featured__all {
        order: 3;
        justify-self: center;
        align-self: center;
        margin-top: 22px;
    }

    /* Horizontal scroll / swipe carousel — only when the toggle is on.
       !important overrides Elementor's per-device "Columns" grid setting. */
    .beacon-featured--hscroll .beacon-featured__grid {
        display: flex !important;
        grid-template-columns: none !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding-bottom: 10px;
        scrollbar-width: none; /* Firefox */
        /* Keep the carousel from stretching the page width. min-width:0
           lets this flex item shrink to the container and scroll internally. */
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .beacon-featured--hscroll .beacon-featured__grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .beacon-featured--hscroll .beacon-fp {
        flex: 0 0 80%;
        max-width: 80%;
        scroll-snap-align: start;
    }
}
