:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
    --buyit-purple: #0a84e3;
    --buyit-accent: #0a84e3;
    --brand-accent: #0a84e3;
    --buyit-brand-blue-strong: #1e4fb7;
    --buyit-brand-blue-light: #58c6ff;
    --buyit-search-bg: color-mix(in oklab, #ffffff 90%, #0a84e3 10%);
    --buyit-search-border: color-mix(in oklab, rgba(21, 45, 91, .30) 38%, #0a84e3 62%);
    --buyit-search-text: #12315f;
    --buyit-search-muted: rgba(18, 49, 95, .58);
    --buyit-search-btn-bg: linear-gradient(135deg, #0a84e3, #58c6ff);
    --buyit-search-btn-bg-hover: linear-gradient(135deg, #0878cf, #48b8f7);
    --buyit-search-icon: #ffffff;
    --buyit-ctrl-bg: color-mix(in oklab, #ffffff 88%, #0a84e3 12%);
    --buyit-ctrl-bg-hover: color-mix(in oklab, #ffffff 74%, #0a84e3 26%);
    --buyit-ctrl-bg-active: color-mix(in oklab, #ffffff 55%, #0a84e3 45%);
    --buyit-ctrl-border: color-mix(in oklab, rgba(22, 45, 85, .28) 42%, #0a84e3 58%);
    --buyit-ctrl-border-strong: color-mix(in oklab, rgba(22, 45, 85, .36) 30%, #0a84e3 70%);
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: light;
}

:root[data-theme="light"],
:root[data-theme="dark"] {
    background-color: #d6e7f4;
}

:root[data-theme="light"] html,
:root[data-theme="dark"] html,
:root[data-theme="light"] body,
:root[data-theme="dark"] body {
    background: transparent !important;
    min-height: 100vh;
    min-height: 100dvh;
}

:root[data-theme="light"]::before,
:root[data-theme="dark"]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("../img/buyit-tlo-jasne.webp");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

@supports (-webkit-touch-callout: none) {

    :root[data-theme="light"]::before,
    :root[data-theme="dark"]::before {
        top: -2px;
        bottom: -2px;
    }
}

.buyit-switch,
button.buyit-switch,
.site-header .buyit-switch {
    display: none !important;
}

.site-branding .logo--light {
    display: inline-block !important;
}

#masthead .site-branding .custom-logo-link,
#masthead .site-branding .custom-logo-link img,
#masthead .site-branding img.logo--light,
#masthead .site-branding img.custom-logo,
#masthead .ast-site-identity img {
    max-height: clamp(32px, 2.4vw, 52px) !important;
    height: auto !important;
    width: auto !important;
    max-width: min(90vw, 430px) !important;
}

.site-branding .logo--dark,
.buyit-cat-thumb-img--dark {
    display: none !important;
}

.buyit-cat-thumb-img--light {
    display: block !important;
}

.ast-header-woo-cart .ast-icon.icon-cart {
    background-image: url("../img/shopping-cart-black.svg") !important;
}

.ast-header-account-link.ast-account-action-link.ast-header-account-type-icon {
    background-image: url("../img/my-account-black.svg") !important;
}

.buyit-header-search-form,
.buyit-header-search-form .buyit-header-search-input,
.buyit-header-search-form .buyit-header-search-category {
    color: var(--buyit-search-text) !important;
}

.buyit-header-search-form .buyit-header-search-input::placeholder {
    color: var(--buyit-search-muted) !important;
}

.buyit-header-search-form .buyit-header-search-submit {
    background: var(--buyit-search-btn-bg) !important;
    color: var(--buyit-search-icon) !important;
}

.buyit-header-search-form .buyit-header-search-submit:hover,
.buyit-header-search-form .buyit-header-search-submit:focus-visible {
    background: var(--buyit-search-btn-bg-hover) !important;
}

body.buyit-shop-layout-page .buyit-view-btn,
:where(.woocommerce nav.woocommerce-pagination a.page-numbers, nav.navigation.pagination a.page-numbers),
:where(.woocommerce nav.woocommerce-pagination span.page-numbers, nav.navigation.pagination span.page-numbers),
:where(button, input[type="submit"], .woocommerce a.button, .woocommerce button.button, .woocommerce input.button) {
    border-color: var(--buyit-ctrl-border) !important;
    background: var(--buyit-ctrl-bg) !important;
}

body.buyit-shop-layout-page .buyit-view-btn:hover,
body.buyit-shop-layout-page .buyit-view-btn.is-active,
:where(.woocommerce nav.woocommerce-pagination a.page-numbers, nav.navigation.pagination a.page-numbers):hover,
:where(.woocommerce nav.woocommerce-pagination span.current, nav.navigation.pagination span.current),
:where(button, input[type="submit"], .woocommerce a.button, .woocommerce button.button, .woocommerce input.button):hover {
    border-color: var(--buyit-ctrl-border-strong) !important;
    background: var(--buyit-ctrl-bg-hover) !important;
}

:where(.woocommerce nav.woocommerce-pagination span.current, nav.navigation.pagination span.current) {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0a84e3, #1e4fb7) !important;
}

:where(input, textarea, select):focus,
:where(.woocommerce form .form-row :is(input, textarea, select)):focus,
:where(.woocommerce form .form-row :is(input, textarea, select)):focus-visible,
:where(.select2-container--default .select2-selection--single):focus,
:where(.select2-container--default .select2-selection--single):focus-visible {
    border-color: rgba(10, 132, 227, .55) !important;
    box-shadow: 0 0 0 3px rgba(10, 132, 227, .22) !important;
}

:root[data-theme="dark"] .ast-header-woo-cart .widget_shopping_cart,
:root[data-theme="dark"] .ast-header-woo-cart .widget_shopping_cart * {
    color: #111 !important;
}

:root {
    --buyit-mini-cart-w: 336px;
    --buyit-mini-thumb: 62px;
}

.ast-header-woo-cart .ast-mini-cart,
.ast-site-header-cart .ast-mini-cart,
.ast-woocommerce-mini-cart-wrapper .ast-mini-cart,
#astra-mobile-cart-drawer,
.astra-cart-drawer {
    width: min(var(--buyit-mini-cart-w), calc(100vw - 24px)) !important;
    max-width: min(var(--buyit-mini-cart-w), calc(100vw - 24px)) !important;
}

#astra-mobile-cart-drawer.active,
.astra-cart-drawer.active {
    width: min(var(--buyit-mini-cart-w), calc(100vw - 24px)) !important;
    max-width: min(var(--buyit-mini-cart-w), calc(100vw - 24px)) !important;
}

/* Keep mini-cart item layout aligned with base theme (BuyIT). */

/* Reserve space for remove button so it never overlaps product title. */
:where(.ast-header-woo-cart, .ast-site-header-cart, .ast-woocommerce-mini-cart-wrapper, #astra-mobile-cart-drawer, .astra-cart-drawer) .widget_shopping_cart .woocommerce-mini-cart li.mini_cart_item {
    position: relative;
    padding-right: 2rem !important;
}

:where(.ast-header-woo-cart, .ast-site-header-cart, .ast-woocommerce-mini-cart-wrapper, #astra-mobile-cart-drawer, .astra-cart-drawer) .widget_shopping_cart .woocommerce-mini-cart li.mini_cart_item > a:not(.remove) {
    padding-right: .25rem !important;
}

:where(.ast-header-woo-cart, .ast-site-header-cart, .ast-woocommerce-mini-cart-wrapper, #astra-mobile-cart-drawer, .astra-cart-drawer) .widget_shopping_cart .woocommerce-mini-cart li.mini_cart_item > a.remove {
    right: 0 !important;
}

:where(.ast-header-woo-cart, .ast-site-header-cart, .ast-woocommerce-mini-cart-wrapper, #astra-mobile-cart-drawer, .astra-cart-drawer) .widget_shopping_cart .woocommerce-mini-cart__buttons.buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .62rem !important;
}

:where(.ast-header-woo-cart, .ast-site-header-cart, .ast-woocommerce-mini-cart-wrapper, #astra-mobile-cart-drawer, .astra-cart-drawer) .widget_shopping_cart .woocommerce-mini-cart__buttons.buttons a {
    width: 100% !important;
    max-width: none !important;
    min-height: 52px !important;
    border-radius: 13px !important;
    padding: .76rem 1rem !important;
    justify-content: center !important;
}

@media (max-width: 1024px) {

    #masthead .site-branding .custom-logo-link,
    #masthead .site-branding .custom-logo-link img,
    #masthead .site-branding img.logo--light,
    #masthead .site-branding img.custom-logo,
    #masthead .ast-site-identity img {
        max-height: clamp(30px, 2.8vw, 44px) !important;
        max-width: min(92vw, 360px) !important;
    }

}

@media (max-width: 768px) {

    #masthead .site-branding .custom-logo-link,
    #masthead .site-branding .custom-logo-link img,
    #masthead .site-branding img.logo--light,
    #masthead .site-branding img.custom-logo,
    #masthead .ast-site-identity img {
        max-height: clamp(28px, 8vw, 36px) !important;
        max-width: min(92vw, 290px) !important;
    }

    :root {
        --buyit-mini-cart-w: 320px;
        --buyit-mini-thumb: 58px;
    }
}
