/* Themeoption emits :root values from the Admin. Override them on the same
   element with higher specificity so aliases also resolve to this palette. */
html:root {
    --bf-ink: #111;
    --bf-hover: #333;
    --bf-on-ink: #fff;
    --bf-tint: #f2f2f2;
    --theme__color__primary: var(--bf-ink);
    --link__color: var(--bf-ink);
    --link__hover__color: var(--bf-hover);
    --topbarbg: var(--bf-ink);
    --topbarcolor: var(--bf-on-ink);
    --topbarhovercolor: #ddd;
    --footer-links-color: var(--bf-ink);
    --button__color: var(--bf-on-ink);
    --button__background: var(--bf-ink);
    --button__hover__background: var(--bf-hover);
    --button__hover__color: var(--bf-on-ink);
    --button-secondary-bg: var(--bf-ink);
    --button-primary__background: var(--bf-ink);
    --button-primary__border: 1px solid var(--bf-ink);
    --button-primary__color: var(--bf-on-ink);
    --button-primary__hover__background: var(--bf-hover);
    --button-primary__hover__border: 1px solid var(--bf-hover);
    --button-primary__hover__color: var(--bf-on-ink);
}

/* The checkout module defines its own colors for identification, shipping
   and payment. Keep layout and button states, and replace just the palette. */
.action.primary,
.action.tocart,
.action.checkout,
.checkout-cart-index .form-cart .action.continue,
body.checkout-index-index #checkout .actions-identification .actions-toolbar .action.primary,
body.checkout-index-index #shipping-method-buttons-container .action.continue.primary,
body.checkout-index-index .checkout-payment-method .payment-method-content > .actions-toolbar > .primary .action.primary {
    --bf-action-color: var(--bf-ink);
    background-color: var(--bf-action-color);
    border-color: var(--bf-action-color);
    color: var(--bf-on-ink);
}

.action.primary:is(:hover, :active),
.action.tocart:is(:hover, :active),
.action.checkout:is(:hover, :active),
.checkout-cart-index .form-cart .action.continue:is(:hover, :active),
body.checkout-index-index #checkout .actions-identification .actions-toolbar .action.primary:is(:hover, :active),
body.checkout-index-index #shipping-method-buttons-container .action.continue.primary:is(:hover, :active),
body.checkout-index-index .checkout-payment-method .payment-method-content > .actions-toolbar > .primary .action.primary:is(:hover, :active) {
    --bf-action-color: var(--bf-hover);
}

/* These two rules replace colors marked !important by the checkout module. */
body.catalog-product-view[class*=" product-"] .product-info-main .box-tocart .action.tocart.primary:hover {
    background-color: var(--bf-hover) !important;
}

body.checkout-index-index .form-account-create .actions-toolbar .action.primary {
    background-color: var(--bf-action-color) !important;
    border-color: var(--bf-action-color) !important;
}

.action:is(.primary, .tocart, .checkout):focus-visible,
.checkout-cart-index .form-cart .action.continue:focus-visible {
    outline: 2px solid var(--bf-ink);
    outline-offset: 3px;
}

.checkout-index-index input[type="radio"],
.checkout-index-index input[type="checkbox"] {
    accent-color: var(--bf-ink);
}

/* The order comment can render as plain text or as a disclosure control. */
.checkout-index-index #checkout .payment-option.comment .payment-option-title > span {
    color: var(--bf-ink);
}

.checkout-index-index #checkout .payment-option.comment .action-toggle:hover {
    color: var(--bf-hover);
    text-decoration: underline;
}

/* Content and modules with hardcoded or inline colors. */
#html-body .section-top-header .content__top--header--banner > [data-content-type="row"] {
    background-color: var(--bf-ink) !important;
    color: var(--bf-on-ink);
}

.ui-menu-item :is(.item-label-363, .item-label-362) {
    background-color: var(--bf-badge-yellow) !important;
    color: var(--bf-shell) !important;
}

.ui-menu-item :is(.item-label-363, .item-label-362)::after {
    border-color: var(--bf-badge-yellow) transparent !important;
}

.ui-menu-item :is(.item-label-363, .item-label-362)::before {
    border-color: var(--bf-badge-yellow) !important;
}

body .criashop-buying-groups-widget .criashop-buying-group-no-image,
body .criashop-buying-groups-widget .criashop-buying-group-placeholder .criashop-buying-group-coming-soon-image {
    background-color: var(--bf-ink);
    color: var(--bf-on-ink);
    text-shadow: none;
}

body .cart-top .scd__countdown {
    background-color: var(--bf-tint);
}

#m-cookienotification .m-button:not(.m-accept):not(.m-decline) {
    background-color: var(--bf-ink) !important;
    color: var(--bf-on-ink) !important;
    box-shadow: inset 0 0 0 1px #888;
}

#m-cookienotification .m-button:not(.m-accept):not(.m-decline):hover {
    background-color: var(--bf-hover) !important;
}

/* Invert the storefront chrome without changing the Admin palette or CMS rows. */
html:root {
    --bf-brand-blue: #078fcd;
    --bf-badge-yellow: #fef004;
    --bf-shell: #0c0c0c;
    --bf-shell-raised: #222;
    --bf-shell-text: #f7f7f7;
    --bf-shell-muted: #c2c2c2;
    --bf-shell-border: #383838;
}

header.page-header,
.page-header .header-container.layout-7,
.page-header .sticky-header,
.page-header .header-container.layout-7 .header_bottom {
    --header__background-color: var(--bf-shell);
    --header_sticky_bg: var(--bf-shell);
    --navigation__background: var(--bf-shell);
    background-color: var(--bf-shell);
}

.page-header .header-container.layout-7 {
    --header-icons-color: var(--bf-shell-text);
    --counter_qty-color: var(--bf-shell);
    --navigation-level0-item__color: var(--bf-shell-text);
    --navigation-desktop-level0-item__hover__color: var(--bf-shell-muted);
}

.page-header .header__action .header-icon,
.page-header .header-icon :is(.text-icons, .text-account, .content-cart, .total-mini-cart-price, .price),
.page-header .nav-toggle,
.page-header .main-nav .level0 > a,
.page-header .vertical-menu-container .title-menu-dropdown {
    color: var(--bf-shell-text);
}

.page-header .header_bottom .elementor-image-box-description a {
    /* The WhatsApp label has a text color assigned inline by the CMS. */
    color: var(--bf-shell-text) !important;
}

.page-header .header-container .header-icon :is(.text-icons-top, .my-cart) {
    color: var(--bf-shell-muted);
}

.page-header .header__action .header-icon > svg {
    color: var(--bf-shell-text);
}

.page-header .header__action .header-icon:is(:hover, :focus-visible) > svg,
.page-header .header__action-default > li:hover .header-icon > svg,
.page-header .nav-toggle:is(:hover, :focus-visible) svg,
.page-header .header__action .setting-view label:is(:hover, :focus-visible) svg,
.page-header .header__action .header-icon:is(:hover, :focus-visible)::before {
    color: var(--bf-brand-blue);
}

.page-header .nav-toggle:is(:hover, :focus-visible) svg {
    fill: currentColor;
}

.page-header .header-icon .counter.qty {
    --counter_qty-bg: var(--bf-badge-yellow);
    background-color: var(--bf-badge-yellow);
    color: var(--bf-shell);
}

body:not(.checkout-index-index) .page-footer .mobile-bottom-link :is(.count, .counter.qty) {
    --counter_qty-bg: var(--bf-shell-text);
    background-color: var(--bf-shell-text);
    color: var(--bf-shell);
}

.page-header .header-icon .counter.qty :is(.counter-number, .total-mini-cart-item) {
    color: var(--bf-shell);
}

.page-header .header__search .search_type_defaut {
    --form-background-color: var(--bf-shell-raised);
}

.page-header .header__search .search_type_defaut .search-form:not(.type-list-categories),
.page-header .header-container.layout-7 .vertical-menu-container .title-menu-dropdown {
    background-color: var(--bf-shell-raised);
    color: var(--bf-shell-text);
}

.page-header .header__search #search-form :is(input.input-text, .field-by-cat-search input) {
    color: var(--bf-shell-text);
}

.page-header .header__search #search-form .field-by-cat-search .chosen-single {
    color: var(--bf-shell-text);
}

.page-header .header__search .field-by-cat-search .chosen-single b {
    filter: brightness(0) invert(1);
}

.page-header .header__search input::placeholder {
    color: var(--bf-shell-muted);
    opacity: 1;
}

.page-header .header__search .search-form button.action.search {
    background-color: var(--bf-shell-text);
    border-color: var(--bf-shell-text);
}

.page-header .header-container.layout-7 .search_type_defaut .action.search > span {
    color: var(--bf-shell);
}

.page-header .header__search .search-form button.action.search:hover {
    background-color: var(--bf-shell-muted);
    border-color: var(--bf-shell-muted);
}

body:not(.checkout-index-index) .page-footer {
    --footer__background-color: var(--bf-shell);
    --footer-title-color: var(--bf-shell-text);
    --footer-links-color: var(--bf-shell-muted);
    --footer-links-hover-color: var(--bf-shell-text);
    --bls_newsletter-input-bg-color: var(--bf-shell-raised);
    --heading__color__base: var(--bf-shell-text);
    --link__color: var(--bf-shell-muted);
    --link__hover__color: var(--bf-shell-text);
    --theme__color__primary: var(--bf-shell-text);
    background-color: var(--bf-shell);
    border-color: var(--bf-shell-border);
}

/* The newsletter and main footer backgrounds are emitted by Page Builder. */
#html-body:not(.checkout-index-index) .page-footer .footer-container [data-content-type="row"]:is(.border_top, :has(.selos-footer)),
body:not(.checkout-index-index) .page-footer .footer-container,
body:not(.checkout-index-index) .page-footer .footer-last-row {
    background-color: var(--bf-shell);
    border-color: var(--bf-shell-border);
}

body:not(.checkout-index-index) .page-footer :is(h2, h3, h4, .footer-title, .static-menu-click) {
    color: var(--bf-shell-text);
}

body:not(.checkout-index-index) .page-footer a[href^="mailto:"] {
    color: var(--bf-shell-muted) !important;
}

body:not(.checkout-index-index) .page-footer [data-content-type="newsletter"] {
    --bls_newsletter-input-bg-color: var(--bf-shell-raised);
}

body:not(.checkout-index-index) .page-footer .elementor-newsletter-wrapper .field-newsletter input {
    background-color: var(--bf-shell-raised);
    border-color: var(--bf-shell-border);
    color: var(--bf-shell-text);
}

body:not(.checkout-index-index) .page-footer .elementor-newsletter-wrapper .field-newsletter input::placeholder {
    color: var(--bf-shell-muted);
    opacity: 1;
}

body:not(.checkout-index-index) .page-footer .elementor-newsletter-wrapper .actions-subscribe button {
    background-color: var(--bf-shell-raised);
    color: var(--bf-shell-text);
    box-shadow: inset 0 0 0 1px #666;
}

body:not(.checkout-index-index) .page-footer .elementor-newsletter-wrapper .actions-subscribe button:hover {
    background-color: var(--bf-hover);
    box-shadow: inset 0 0 0 1px var(--bf-shell-muted);
}

body:not(.checkout-index-index) .page-footer .footer-last-row .criashop img {
    height: auto;
}

body:not(.checkout-index-index) .page-footer .mobile-bottom-link {
    --heading__color__base: var(--bf-shell-text);
    background-color: var(--bf-shell);
    box-shadow: 0 0 0 1px var(--bf-shell-border);
}

body:not(.checkout-index-index) .page-footer .mobile-bottom-link li :is(a, .label) {
    color: var(--bf-shell-text);
}

body:not(.checkout-index-index) .page-footer .mobile-bottom-link li a > svg {
    filter: brightness(0) invert(1);
}

@media (max-width: 1199px) {
    .page-header .navigation.nav-sections {
        --submenu__background: var(--bf-shell);
        --submenu-item__color: var(--bf-shell-text);
        --border-color__base: var(--bf-shell-border);
        background-color: var(--bf-shell);
    }

    .page-header .navigation.nav-sections :is(.level0 > a, .submenu a, .submenu-mobile-title, .menu-mobile-title a, .close-menu-mobile a) {
        color: var(--bf-shell-text);
    }

    .page-header .navigation .menu-mobile-title a {
        background-color: var(--bf-shell-raised);
    }

    .page-header .navigation .menu-mobile-title a.active {
        background-color: var(--bf-shell-text);
        color: var(--bf-shell);
    }
}

/* Both assets share a frame. Keep it stable even when Nivo measures
   a hidden image whose lazy request has not completed yet. */
.cms-index-index #slidebanner-1 :is(.banner-nivo-slider-mobile-and-web, .nivo-main-image) {
    width: 100%;
    height: auto !important;
    aspect-ratio: 1040 / 430;
}

@media (max-width: 767px) {
    .cms-index-index #slidebanner-1 :is(.banner-nivo-slider-mobile-and-web, .nivo-main-image) {
        aspect-ratio: 4 / 5;
    }
}

.section-top-header.cns-bf-topbar {
    background-color: #111;
    color: var(--bf-badge-yellow);
    line-height: 1.2;
    padding: 7px 12px;
    text-align: center;
    overflow: hidden;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .22em;
}

.cns-bf-topbar p {
    margin: 0;
}

.cns-bf-topbar__track {
    display: flex;
    width: max-content;
    --bf-ticker-gap: clamp(2.2rem, 3vw, 4.2rem);
    animation: cns-bf-ticker 84s linear infinite;
}

.cns-bf-topbar__group {
    display: flex;
    flex: none;
    min-width: 100vw;
    gap: var(--bf-ticker-gap);
    justify-content: space-between;
    padding-inline-end: var(--bf-ticker-gap);
}

.cns-bf-topbar__item {
    white-space: nowrap;
}

.cns-bf-topbar:hover .cns-bf-topbar__track {
    animation-play-state: paused;
}

@keyframes cns-bf-ticker {
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cns-bf-topbar__track {
        width: 100%;
        animation: none;
    }

    .cns-bf-topbar__group {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding-inline-end: 0;
    }

    .cns-bf-topbar [aria-hidden="true"] {
        display: none;
    }
}


/* The home Page Builder heading has its regular campaign color inline. */
#html-body.cms-index-index [data-pb-style="YW8BSDE"] h2 {
    background-color: var(--bf-brand-blue) !important;
}

/* Decorative stamp on the category listing, above the photo without taking clicks. */
.cns-bf-group-listing ~ :is(.products.wrapper, #layered-ajax-list-products)
.product-item-info > .product_item_images > .product-item-photo {
    display: block;
    position: relative;
}

.cns-bf-group-listing ~ :is(.products.wrapper, #layered-ajax-list-products)
.product-item-info > .product_item_images > .product-item-photo::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset-block-start: 6px;
    inset-inline-end: 6px;
    inline-size: clamp(58px, 42%, 102px);
    aspect-ratio: 208 / 125;
    background: url("../images/black-friday-product-badge.webp") center / contain no-repeat;
    pointer-events: none;
}


/* Keep the detail badge over the gallery and outside its zoom controls. */
.catalog-product-view .product.media:has(> .cns-bf-pdp-badge) {
    position: relative;
}

.catalog-product-view .product.media > .cns-bf-pdp-badge {
    position: absolute;
    z-index: 3;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    inline-size: clamp(88px, 30%, 156px);
    block-size: auto;
    pointer-events: none;
}

/* Group cards: a clear status line and a stamp only on timed campaigns. */
.criashop-buying-groups-widget .criashop-buying-group-item .header-daily-deal-container {
    margin-bottom: 12px;
}
.criashop-buying-groups-widget .criashop-buying-group-item .container-countdown-time {
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.criashop-buying-groups-widget .criashop-buying-group-item .criashop-buying-group-stock-status {
    border: 1px solid #d9e4ec;
    background: #f2f7fa;
    color: #253c4c;
    border-radius: 8px;
    padding: 9px 14px;
    font-weight: 600;
}
.criashop-buying-groups-widget .criashop-buying-group-item .final-text-daily-deal {
    color: #333;
    font-weight: 600;
}
.criashop-buying-groups-widget .criashop-buying-group-item .final-date-daily-deal > * {
    background: #111 !important;
    color: #ffed00 !important;
    border-radius: 6px;
}
.criashop-buying-groups-widget .criashop-buying-group-category-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}
.criashop-buying-groups-widget .criashop-buying-group-item:not(.criashop-buying-group-no-expiry) .criashop-buying-group-category-link::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 10px;
    width: clamp(85px, 26%, 140px);
    aspect-ratio: 208 / 125;
    background: url("../images/black-friday-product-badge.webp") center / contain no-repeat;
    pointer-events: none;
}

/* Nivo uses the source aspect ratio for transition slices; match the visible frame. */
.cms-index-index #slidebanner-1 .nivo-slice > img {
    height: 100% !important;
}
