/*
 * Essentials carousel positioned inside WooCommerce product grids.
 */

ul.products .box-essentials-carousel {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    margin: 34px 0 40px;
    padding: 0;
    list-style: none;
}

.box-essentials-carousel__panel {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 24px;
    background:
        radial-gradient(
            circle at top right,
            rgba(36, 103, 180, 0.12),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            #f8fafc 0%,
            #ffffff 55%,
            #f2f6fb 100%
        );
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
}

.box-essentials-carousel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.box-essentials-carousel__heading {
    max-width: 620px;
}

.box-essentials-carousel__eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--box-primary, #2467b4);
}

.box-essentials-carousel__heading h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: #111827;
}

.box-essentials-carousel__heading p {
    max-width: 560px;
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.65;
    color: #64748b;
}

.box-essentials-carousel__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 15px;
}

.box-essentials-carousel__view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition:
        transform 180ms ease,
        background-color 180ms ease;
}

.box-essentials-carousel__view-all:hover {
    transform: translateY(-1px);
    background: var(--box-primary, #2467b4);
    color: #ffffff;
}

.box-essentials-carousel__view-all svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.box-essentials-carousel__arrows {
    display: flex;
    gap: 8px;
}

.box-essentials-carousel__arrows button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 50%;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
}

.box-essentials-carousel__arrows button:hover {
    transform: translateY(-2px);
    border-color: var(--box-primary, #2467b4);
    color: var(--box-primary, #2467b4);
}

.box-essentials-carousel__arrows svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.box-essentials-carousel__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: smooth;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
}

.box-essentials-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.box-essentials-carousel__track {
    display: flex;
    align-items: stretch;
    gap: 18px;
    min-width: max-content;
}

.box-essentials-carousel__item {
    width: calc(
        (
            min(1200px, calc(100vw - 120px))
            - 54px
        ) / 4
    );
    max-width: 275px;
    min-width: 230px;
    scroll-snap-align: start;
}

.box-essentials-carousel__item > * {
    height: 100%;
}

@media (max-width: 991px) {
    ul.products .box-essentials-carousel {
        margin: 28px 0 34px;
    }

    .box-essentials-carousel__panel {
        padding: 24px;
        border-radius: 20px;
    }

    .box-essentials-carousel__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .box-essentials-carousel__actions {
        width: 100%;
        justify-content: space-between;
    }

    .box-essentials-carousel__item {
        width: min(42vw, 260px);
        min-width: min(42vw, 260px);
    }
}

@media (max-width: 600px) {
    ul.products .box-essentials-carousel {
        margin: 24px 0 30px;
    }

    .box-essentials-carousel__panel {
        margin-inline: -4px;
        padding: 20px 16px;
        border-radius: 18px;
    }

    .box-essentials-carousel__heading h2 {
        font-size: 27px;
    }

    .box-essentials-carousel__heading p {
        font-size: 14px;
    }

    .box-essentials-carousel__view-all {
        min-height: 42px;
        padding-inline: 15px;
    }

    .box-essentials-carousel__arrows button {
        width: 42px;
        height: 42px;
    }

    .box-essentials-carousel__track {
        gap: 13px;
    }

    .box-essentials-carousel__item {
        width: 72vw;
        min-width: 72vw;
        max-width: 280px;
    }
}


/*
 * Theme-controlled dark mode.
 * Covers themes that do not rely on prefers-color-scheme.
 */
body.dark-mode .box-essentials-carousel__panel,
body.dark .box-essentials-carousel__panel,
html.dark .box-essentials-carousel__panel,
[data-theme="dark"] .box-essentials-carousel__panel {
    border-color: rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(
            circle at top right,
            rgba(36, 103, 180, 0.18),
            transparent 38%
        ),
        linear-gradient(
            145deg,
            #111820 0%,
            #0d1319 55%,
            #101922 100%
        );
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.28);
}

body.dark-mode .box-essentials-carousel__heading h2,
body.dark .box-essentials-carousel__heading h2,
html.dark .box-essentials-carousel__heading h2,
[data-theme="dark"] .box-essentials-carousel__heading h2 {
    color: #f8fafc;
}

body.dark-mode .box-essentials-carousel__heading p,
body.dark .box-essentials-carousel__heading p,
html.dark .box-essentials-carousel__heading p,
[data-theme="dark"] .box-essentials-carousel__heading p {
    color: #aeb9c6;
}

body.dark-mode .box-essentials-carousel__eyebrow,
body.dark .box-essentials-carousel__eyebrow,
html.dark .box-essentials-carousel__eyebrow,
[data-theme="dark"] .box-essentials-carousel__eyebrow {
    color: #59a8ff;
}

body.dark-mode .box-essentials-carousel__view-all,
body.dark .box-essentials-carousel__view-all,
html.dark .box-essentials-carousel__view-all,
[data-theme="dark"] .box-essentials-carousel__view-all {
    background: #f8fafc;
    color: #0b1117;
}

body.dark-mode .box-essentials-carousel__arrows button,
body.dark .box-essentials-carousel__arrows button,
html.dark .box-essentials-carousel__arrows button,
[data-theme="dark"]
.box-essentials-carousel__arrows button {
    border-color: rgba(255, 255, 255, 0.13);
    background: #17212b;
    color: #f8fafc;
}

body.dark-mode .box-essentials-carousel__item,
body.dark .box-essentials-carousel__item,
html.dark .box-essentials-carousel__item,
[data-theme="dark"] .box-essentials-carousel__item {
    color: #f8fafc;
}

body.dark-mode
.box-essentials-carousel__item a,
body.dark
.box-essentials-carousel__item a,
html.dark
.box-essentials-carousel__item a,
[data-theme="dark"]
.box-essentials-carousel__item a,

body.dark-mode
.box-essentials-carousel__item
.woocommerce-loop-product__title,
body.dark
.box-essentials-carousel__item
.woocommerce-loop-product__title,
html.dark
.box-essentials-carousel__item
.woocommerce-loop-product__title,
[data-theme="dark"]
.box-essentials-carousel__item
.woocommerce-loop-product__title {
    color: #f8fafc;
}

body.dark-mode
.box-essentials-carousel__item .price,
body.dark
.box-essentials-carousel__item .price,
html.dark
.box-essentials-carousel__item .price,
[data-theme="dark"]
.box-essentials-carousel__item .price {
    color: #d5dce5;
}


/* ==========================================================
   Essentials carousel — explicit light mode
   ========================================================== */

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__panel {
    border-color: rgba(15, 23, 42, 0.09);
    background:
        radial-gradient(
            circle at top right,
            rgba(36, 103, 180, 0.11),
            transparent 36%
        ),
        linear-gradient(
            145deg,
            #f8fafc 0%,
            #ffffff 55%,
            #f1f5f9 100%
        );
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.10);
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__heading h2 {
    color: #0f172a;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__heading p {
    color: #64748b;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__eyebrow {
    color: #2467b4;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__view-all {
    background: #0f172a;
    color: #ffffff;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__arrows button {
    border-color: rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #0f172a;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item {
    color: #0f172a;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item a,

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item h2,

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item h3,

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item
.woocommerce-loop-product__title {
    color: #111827;
}

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item .price,

html:not(.dark):not([data-theme="dark"])
body:not(.dark):not(.dark-mode):not([data-theme="dark"])
.box-essentials-carousel__item .price * {
    color: #334155;
}
