/**
 * Miele design layer for Shoptimizer.
 *
 * Moved from WP "Additional CSS" (custom_css post 206) so the design is versioned,
 * cacheable and loaded once instead of inlined into every page. Rule order is kept
 * from the original because the cascade depends on it; this file is enqueued after
 * every other stylesheet (same position Additional CSS had), and Kirki's inline
 * CSS still prints after it.
 */

/* ==========================================================================
   Fonts: Miele Elements, self-hosted WOFF2 (Latin + Latin Ext subset)
   ========================================================================== */

@font-face{font-family:"Miele Elements Casnic";font-style:normal;font-weight:200;font-display:swap;src:url("../fonts/MieleElementsOffice-ExtraLight.woff2") format("woff2");}
@font-face{font-family:"Miele Elements Casnic";font-style:normal;font-weight:300;font-display:swap;src:url("../fonts/MieleElementsOffice-Light.woff2") format("woff2");}
@font-face{font-family:"Miele Elements Casnic";font-style:italic;font-weight:300;font-display:swap;src:url("../fonts/MieleElementsOffice-LightItalic.woff2") format("woff2");}
@font-face{font-family:"Miele Elements Casnic";font-style:normal;font-weight:400;font-display:swap;src:url("../fonts/MieleElementsOffice-Regular.woff2") format("woff2");}
@font-face{font-family:"Miele Elements Casnic";font-style:italic;font-weight:400;font-display:swap;src:url("../fonts/MieleElementsOffice-Italic.woff2") format("woff2");}
@font-face{font-family:"Miele Elements Casnic";font-style:normal;font-weight:700;font-display:swap;src:url("../fonts/MieleElementsOffice-Bold.woff2") format("woff2");}
@font-face{font-family:"Miele Elements Casnic";font-style:italic;font-weight:700;font-display:swap;src:url("../fonts/MieleElementsOffice-BoldItalic.woff2") format("woff2");}

/* ==========================================================================
   Header: desktop (header-5, centred logo, black search)
   ========================================================================== */

@media (min-width: 993px) {
    .site-header .site-branding {
        position: absolute;
        top: 29px;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        width: auto;
        line-height: 1;
        z-index: 10;
    }

    .main-navigation ul.menu li.full-width {
        margin-left: 15px;
    }

    .main-navigation ul li.full-width>.sub-menu-wrapper>.container>ul.sub-menu>li:last-child {
        border-right: 0.1px solid #606060;
    }

    .site-header .col-full {
        max-width: 100% !important;
    }

    .site-header .site-search {
        margin-left: 3em;
        flex-grow: 0;
    }

    .shoptimizer-primary-navigation {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .site-search input[type=search] {
        border: 0;
        background: #000000;
        border: none;
        color: white;
    }

    .main-navigation ul.menu li.full-width>.sub-menu-wrapper {
        background: #000000;
        border: none;
    }

    .secondary-navigation .menu-item {
        padding: 2px;
        border-left: none;
    }

    .secondary-navigation ul li a {
        position: relative;
        display: block;
        padding: 2px;
        color: #111;
        font-size: 11px;
    }

    .header-5 .shoptimizer-cart .cart-contents .amount {
        font-size: 12px;
        display: contents;
    }
}

/* ==========================================================================
   Header: mobile
   ========================================================================== */

@media (max-width: 992px) {
    /* .site-header prefix: must beat the old 45px rule while it is still in prod Additional CSS */
    .site-header .custom-logo-link img {
        padding: 0px;
        height: 40px !important;
    }

    /* Logo pinned to the top of the (taller) header, black strip underneath as on miele.ro */
    .site-header .site-branding .custom-logo-link {
        margin-bottom: auto;
        line-height: 0;
    }

    /* Keep the header sticky while the menu drawer is open. The theme only makes it sticky on
       body:not(.mobile-toggled), so when scrolled down it jumped away as the menu opened.
       The drawer (z 102) and overlay (z 101) are outside the header and still cover it. */
    .mobile-toggled.sticky-m .site-header {
        position: sticky;
        top: 0;
        z-index: 9;
    }

    /* Search: 44px tap target, clear of the cart's tap area (cart sits at right: 15px) */
    .site-header button.mobile-search-toggle {
        right: 62px;
        width: 44px;
        justify-content: center;
    }

    .menu-primary-menu-container>ul>li>a,
    .shoptimizer-cart .cart-contents {
        font-size: 16px !important;
    }
}

/* ==========================================================================
   Mega menu
   ========================================================================== */

.main-navigation ul.menu li.menu-item-has-children.full-width>.sub-menu-wrapper li.menu-item-has-children>a,
.main-navigation ul.menu li.menu-item-has-children.full-width>.sub-menu-wrapper li.heading>a,
.main-navigation ul.menu li.menu-item-has-children.full-width>.sub-menu-wrapper li.nolink>span {
    color: #ffffff !important;
}

.main-navigation ul li.full-width>.sub-menu-wrapper>.container>ul.sub-menu>li {
    border-left: 0.1px solid #606060;
}

/* ==========================================================================
   Blocks, footer payments, sidebar
   ========================================================================== */

.superblockslider {
    position: relative;
    left: 50%;
    right: 50%;
    width: 100vw !important;
    margin-left: -50vw;
    margin-right: -50vw;
}

.header-5 .shoptimizer-cart a.cart-contents {
    border: none;
}

.pay-Payments {
    display: block;
    margin-right: -10px;
    margin-left: -10px;
    text-align: center;
}

@media only screen and (min-width: 768px) {
    .pay-Payments_Items {
        width: 100%;
        text-align: left;
    }
}

ul.pay-Payments_Items {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.pay-Payments_Item {
    margin: 0 5px;
}

.pay-Payments_Item svg {
    width: 48px;
    height: 32px;
}

.util-ScreenReaderOnly {
    position: relative;
}

.wc-block-grid__product-onsale {
    background-color: #4b0000 !important;
    color: white !important;
    border: none !important;
}

#secondary .widget:last-child {
    padding-bottom: 0;
    border: none;
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 4px;
}

div#secondary {
    position: sticky;
    top: 150px;
    z-index: 1;
}

/* Stack block grids on mobile */
@media (max-width: 993px) {
    body .is-layout-grid {
        grid-template-columns: 1fr !important;
    }
}

.mykuiba-image {
    max-width: 100px;
}

p.raa-estimated-delivery-notice {
    font-size: 12px;
}

/* ==========================================================================
   Primary menu font size on narrow desktops
   (these win over the old copies in the shoptimizer_extended_discounts_css option)
   ========================================================================== */

@media screen and (min-width: 1200px) and (max-width: 1320px) {
    .menu-primary-menu-container > ul > li > a, .shoptimizer-cart .cart-contents {
        letter-spacing: 0 !important;
        font-size: 12px !important;
    }
}

@media screen and (min-width: 993px) and (max-width: 1200px) {
    .menu-primary-menu-container > ul > li > a, .shoptimizer-cart .cart-contents {
        letter-spacing: 0px !important;
        font-size: 10px !important;
    }
}

/* ==========================================================================
   Product grid, badges, availability button
   ========================================================================== */

.woocommerce-LoopProduct-link img.gallery-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
}

a.raa-open-availability-popup {
    background-color: #df9a38 !important;
    color: #000000 !important;
}

.product-details-wrapper .product-label {
    padding: 7px 7px !important;
    font-size: 16px !important;
}

.ckit-badge {opacity: 1 !important;}

/* ==========================================================================
   Navigation bar: desktop (black, sticky)
   ========================================================================== */

@media (min-width: 993px) {
    .col-full-nav {
        width: 100%;
        background-color: #000;
        border-top: 1px solid transparent;
        height: 60px;
        min-height: 60px;
        display: flex;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 999;
    }
}

/* ==========================================================================
   Widgets, social login, product images
   ========================================================================== */

.widget-area .widget a {
    padding-right: 10px !important;
}

.widget.woocommerce li .count {
    right: -20px !important;
}

.google-login-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    background-color: #fff;
    color: #444;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
}

.google-login-button:hover {
    background-color: #f7f7f7;
    border-color: #999;
}

.woocommerce-image__wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.shoptimizer-plp-image-wrapper {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 300px;
    height: auto;
    overflow: hidden;
    position: relative;
    display: block;
}

@media (max-width: 780px) {
    .order-mobile-first {
        order: -1;
    }
}

/* ==========================================================================
   Availability table (raa-availability-stocks): rendered as cards at every width
   ========================================================================== */

.raa-availability-table {
    width: 100%;
    border-collapse: collapse;
}

.raa-availability-table th,
.raa-availability-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.raa-availability-table,
.raa-availability-table thead,
.raa-availability-table tbody,
.raa-availability-table th,
.raa-availability-table td,
.raa-availability-table tr {
    display: block;
}

.raa-availability-table thead {
    display: none;
}

/* Each row is a 2-column grid: location, availability */
.raa-availability-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #fafafa;
}

.raa-availability-table td {
    border: none;
    padding: 4px 0;
}

.raa-availability-table td:first-child {
    font-weight: 600;
}

.raa-availability-table td:last-child {
    text-align: right;
    color: green;
}

/* ==========================================================================
   FacetWP
   ========================================================================== */

.facet-label {
    font-size: 16px;
}

.facetwp-display-value {
    font-size: 14px;
}

.facetwp-counter {
    font-size: 14px;
}

.facetwp-slider-label {
    font-size: 14px;
}

input.facetwp-slider-reset.facetwp-hidden {
    background-color: #dc9814;
    color: #000000;
}

/* ==========================================================================
   Cookie consent (raa-cookie-consent-plugin)
   ========================================================================== */

div#popup-content {
    color: black;
}

#cookie-customize-popup {
    background: #ffffff;
}

#customize-consent {
    background-color: #dc9814;
    color: #000000;
}

#cookie-consent-banner {
    background: #ffffff;
    color: #000000;
    font-weight: 500;
    position: fixed;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    padding: 20px;
    text-align: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-radius: 15px;
}

.consent-link {
    color: #8c0014;
}

/* ==========================================================================
   Weight overrides for Kirki-coloured elements
   ========================================================================== */

.price ins, .commercekit-ajs-product-price, .commercekit-ajs-product-price ins, .widget-area .widget.widget_categories a:hover, #secondary .widget ul li a:hover, #secondary.widget-area .widget li.chosen a, .widget-area .widget a:hover, #secondary .widget_recent_comments ul li a:hover, .woocommerce-pagination .page-numbers li .page-numbers.current, div.product p.price, body:not(.mobile-toggled) .main-navigation ul.menu li.full-width.menu-item-has-children ul li.highlight > a, body:not(.mobile-toggled) .main-navigation ul.menu li.full-width.menu-item-has-children ul li.highlight > a:hover, #secondary .widget ins span.amount, #secondary .widget ins span.amount span, .search-results article h2 a:hover {
    font-weight: 500;
}

.showroomimage {border-radius: 10px;}

/* ==========================================================================
   Footer social icons
   ========================================================================== */

.footer-social {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-social .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform .2s ease, opacity .2s ease;
    color: #ffffff !important;
}

.footer-social svg {
    color: #ffffff !important;
    fill: currentColor;
}

.footer-social .icon:hover,
.footer-social .icon:focus-visible {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* ==========================================================================
   Product gallery, visibility utilities, checkout
   ========================================================================== */

@media (max-width: 768px) {
    .woocommerce-product-gallery__image:not(.flex-active-slide) img {
        padding: 25px;
    }
}

@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

.woocommerce-checkout.min-ck:not(.woocommerce-order-received) .site-header {
    border-bottom: none !important;
}

/* ==========================================================================
   Product search results: brand font everywhere
   (was an inline <style> in functions.php pointing at an undefined family)
   ========================================================================== */

body.search.post-type-archive-product :is(body, a, p, h1, h2, h3, h4, h5, h6, span, li, strong, em, div, button, input, textarea, label),
body.search.post-type-archive-product {
    font-family: "Miele Elements Casnic", sans-serif !important;
}

/* ==========================================================================
   Mobile menu: drill-down panels (see assets/js/mobile-nav.js)
   Colours follow the Customizer mobile menu settings: black panel, white text.
   ========================================================================== */

@media (max-width: 992px) {
    /* Full-width drawer (theme default is a 300px panel sliding from the left) */
    .col-full-nav {
        left: -100%;
        width: 100%;
    }

    .mobile-toggled .col-full-nav {
        left: 0;
    }

    /* Close X moves from outside the 300px drawer to its top-right corner */
    .mobile-menu.close-drawer {
        left: auto;
        right: 6px;
    }

    .miele-drilldown .sub-menu-wrapper {
        display: none;
    }

    .miele-drilldown li.menu-item-has-children > .caret {
        display: none !important;
    }

    .miele-drilldown li.menu-item-has-children > a {
        position: relative;
        padding-right: 30px !important;
    }

    /* Right caret, same mask technique as the theme's own menu carets */
    .miele-drilldown li.menu-item-has-children > a::after {
        content: "" !important;
        display: block !important;
        position: absolute;
        top: 50%;
        right: 0;
        width: 18px;
        height: 18px;
        margin: 0;
        background-color: currentColor;
        transform: translateY(-50%);
        -webkit-mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 5L16 12L9 19' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
                mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 5L16 12L9 19' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
        -webkit-mask-position: center;
                mask-position: center;
        -webkit-mask-repeat: no-repeat;
                mask-repeat: no-repeat;
        -webkit-mask-size: contain;
                mask-size: contain;
    }

    .miele-drilldown .sub-menu-wrapper.miele-panel {
        display: block;
        position: fixed !important;
        z-index: 103;
        top: 0;
        bottom: 0;
        left: 0 !important;
        width: 100%;
        margin: 0 !important;
        padding: 0 15px 2rem !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        background-color: #000;
        color: #fff;
        border: 0 !important;
        visibility: hidden;
        opacity: 0 !important;
        transform: translateX(24px) !important;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s !important;
    }

    .admin-bar .miele-drilldown .sub-menu-wrapper.miele-panel {
        z-index: 100001;
    }

    .miele-drilldown li.miele-panel-open > .sub-menu-wrapper.miele-panel {
        visibility: visible;
        opacity: 1 !important;
        transform: none !important;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s !important;
    }

    .miele-panel .container {
        padding: 0;
    }

    .miele-panel ul.sub-menu > li > a {
        display: block;
        width: 100% !important;
        padding: 0.6rem 0 !important;
        font-size: 15px;
        color: #fff !important;
        font-weight: 400 !important;
        opacity: 1;
    }

    .miele-panel-head {
        position: sticky;
        top: 0;
        z-index: 1;
        margin: 0 -15px 0.5rem;
        padding: 0.75rem 15px 0.75rem;
        background-color: inherit;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .miele-panel-head {
        padding-right: 56px;
    }

    .miele-panel-back {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 0.35rem 0;
        background: none;
        border: 0;
        color: inherit;
        font: inherit;
        font-size: 14px;
        cursor: pointer;
    }

    .miele-panel-back::before {
        content: "";
        width: 8px;
        height: 8px;
        border-bottom: 1.5px solid currentColor;
        border-left: 1.5px solid currentColor;
        transform: rotate(45deg);
    }

    .miele-panel-title {
        display: block;
        margin-top: 0.35rem;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .miele-panel-all > a {
        font-weight: 700;
    }

    /* Wishlist + account, appended to the mobile menu in functions.php */
    .shoptimizer-mobile-menu li.miele-mobile-utility.miele-utility-first {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .shoptimizer-mobile-menu li.miele-mobile-utility > a {
        display: flex !important;
        align-items: center;
        gap: 10px;
    }

    .shoptimizer-mobile-menu li.miele-mobile-utility svg {
        flex: none;
        width: 20px;
        height: 20px;
    }

    .shoptimizer-mobile-menu li.miele-mobile-utility .rbp-wishlist-header-count {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: #8c0014;
        color: #fff;
        font-size: 11px;
        line-height: 18px;
        text-align: center;
    }
}

@media (max-width: 992px) and (prefers-reduced-motion: reduce) {
    .miele-drilldown .sub-menu-wrapper.miele-panel,
    .miele-drilldown li.miele-panel-open > .sub-menu-wrapper.miele-panel {
        transition: none !important;
    }
}

/* ==========================================================================
   Mobile search: dim the page below the header while the search panel is open
   (the header is sticky with z-index 9 and holds the search panel, so it stays bright)
   ========================================================================== */

@media (max-width: 992px) {
    body.m-search-toggled::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 8;
        background: rgba(0, 0, 0, 0.5);
    }

    body.m-search-toggled .site-header {
        position: sticky;
        top: 0;
        z-index: 9;
    }
}

/* ==========================================================================
   CommerceKit live search dropdown: same card as the Customer 360 quick results
   ("Cele mai cumpărate", raa-miele-360customer/assets/search-suggest.js)
   ========================================================================== */

.site-search .commercekit-ajs-results {
    top: calc(100% + 4px) !important;
    left: 0;
    box-sizing: border-box;
    min-width: 300px;
    max-width: calc(100vw - 2em);
    min-height: 0;
    padding: 10px 0;
    overflow-x: hidden;
    background: #fff;
    color: #111;
    text-align: left;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.site-search .commercekit-ajs-results.has-viewall-button {
    padding-bottom: 10px;
}

.site-search .commercekit-ajs-suggestions {
    width: auto !important;
    background: transparent;
    border: 0;
}

.site-search .commercekit-ajs-suggestions::before {
    content: "Produse";
    display: block;
    margin: 0 14px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #666;
}

.site-search .commercekit-ajs-suggestions:has(> .autocomplete-no-suggestion:first-child)::before {
    display: none;
}

.site-search .commercekit-ajs-suggestions > .autocomplete-suggestion,
.site-search .commercekit-ajs-suggestions > .autocomplete-suggestion:last-child {
    margin: 0;
    border-bottom: 0;
}

.site-search .commercekit-ajs-suggestions > .autocomplete-suggestion:hover,
.site-search .commercekit-ajs-suggestions > .autocomplete-suggestion.active,
.site-search .commercekit-ajs-suggestions > .autocomplete-suggestion.autocomplete-selected > a {
    background-color: #f4f4f4;
}

.site-search .autocomplete-suggestion a {
    gap: 10px;
    align-items: center;
    padding: 6px 14px;
    color: #111;
}

/* 40px thumbnail box; an empty box keeps the rows aligned when a product has no image */
.site-search .commercekit-ajs-product .commercekit-ajs-product-image,
.site-search .commercekit-ajs-product:not(:has(.commercekit-ajs-product-image))::before {
    flex: none;
    width: 40px;
    max-width: 40px;
    height: 40px;
    overflow: hidden;
    background: #f6f6f6;
    border-radius: 4px;
    align-self: center;
}

.site-search .commercekit-ajs-product:not(:has(.commercekit-ajs-product-image))::before {
    content: "";
}

.site-search .commercekit-ajs-product .commercekit-ajs-product-image img {
    display: block;
    width: 40px;
    height: 40px;
    padding: 0;
    object-fit: contain;
}

.site-search .commercekit-ajs-product-desc {
    padding: 0;
}

.site-search .commercekit-ajs-product-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.site-search .commercekit-ajs-results span.match-text {
    font-weight: 700;
    text-decoration: none;
}

.site-search .commercekit-ajs-product-price,
.site-search .commercekit-ajs-product-price ins {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: #8c0014;
}

.site-search .commercekit-ajs-product-price del {
    margin-right: 4px;
    color: #999;
}

/* Category suggestions */
.site-search .commercekit-ajs-post .commercekit-ajs-post-title {
    font-size: 13px;
    line-height: 1.3;
}

/* CommerceKit prints the English taxonomy label ("Product Category"): show it in Romanian */
.site-search .commercekit-ajs-post .commercekit-ajs-post-title span.post-type {
    font-size: 0;
    white-space: nowrap;
}

.site-search .commercekit-ajs-post .commercekit-ajs-post-title span.post-type::after {
    content: "Categorie";
    font-size: 10px;
    letter-spacing: 0.04em;
}

/* "Vezi toate rezultatele (N)": a quiet link row instead of the dark bar */
.site-search .commercekit-ajs-view-all-holder {
    width: auto;
}

.site-search .commercekit-ajs-view-all-holder > a {
    height: auto;
    margin: 6px 14px 0;
    padding: 10px 0 0;
    line-height: 1.3;
    background: transparent;
    border-top: 1px solid #eee;
    color: #8c0014;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.site-search .commercekit-ajs-view-all-holder > a:hover {
    color: #5e000d;
    background: transparent;
}
