/* ============================================================
   Rhima Header Styling
   ============================================================ */

/* Icon Bar */
.rhima-icon-bar {
    background: transparent;
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    transition: all 0.3s ease;
}

/* Admin bar offset */
.admin-bar .rhima-icon-bar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .rhima-icon-bar {
        top: 46px;
    }
}

.rhima-icon-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.rhima-icon-bar-inner {
    max-width: var(--dmn-site-width, 1400px);
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.rhima-icon-bar-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.rhima-icon-bar-icons a,
.rhima-icon-bar-icons button,
.rhima-icon-bar-icons .dryve-header-cart {
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.rhima-icon-bar-icons .dryve-header-cart {
    margin-left: 0;
}

/* Cart Count Badge */
.rhima-cart-link {
    position: relative;
}

.rhima-cart-link .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #d50000;
    color: #ffffff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rhima-cart-link .cart-count[data-count="0"] {
    display: none;
}

.rhima-menu-toggle {
    display: none !important;
}

.rhima-sticky-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dmn-text, #333);
    cursor: pointer;
    padding: 8px;
}

/* Aparte uitklapknop naast een menulink (A1a, 11-09-2026).
   Op desktop onzichtbaar: daar opent het submenu op hover en navigeert de link al.
   Onder 900px was de pagina achter een ouder-item onbereikbaar omdat de link zelf de
   klik afving; die rol is nu van deze knop, zodat de link weer naar de pagina gaat. */
.rhima-submenu-toggle {
    display: none;
}

@media (max-width: 900px) {
    .rhima-menu li.menu-item-has-children {
        position: relative;
    }

    /* ruimte vrijhouden zodat de knop de tekst niet overlapt */
    .rhima-menu li.menu-item-has-children > a {
        padding-right: 56px;
    }

    .rhima-submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0;
        right: 0;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .rhima-submenu-toggle svg {
        transition: transform 0.2s ease;
    }

    .rhima-submenu-toggle[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }
}

@media (max-width: 900px) {
    .rhima-menu-toggle {
        display: none !important;
    }

    .rhima-sticky-menu-toggle {
        display: flex;
        color: #fff;
    }

    .rhima-header.scrolled .rhima-sticky-menu-toggle {
        color: var(--dmn-text, #333);
    }
}

.rhima-icon-bar-icons a:hover,
.rhima-icon-bar-icons button:hover {
    opacity: 0.7;
}

.rhima-language-switcher {
    color: #ffffff;
}

/* Search Modal */
.rhima-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rhima-search-modal.active {
    display: flex;
    opacity: 1;
}

.rhima-search-modal-inner {
    position: relative;
    width: 90%;
    max-width: 600px;
}

.rhima-search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    transition: opacity 0.2s ease;
}

.rhima-search-close:hover {
    opacity: 0.7;
}

.rhima-search-form {
    display: flex;
    gap: 10px;
}

.rhima-search-form input[type="search"] {
    flex: 1;
    padding: 20px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: var(--dmn-button-radius, 4px);
    background: #ffffff;
}

.rhima-search-form button {
    padding: 20px 30px;
    background: var(--dmn-secondary, #FFD500);
    color: var(--dmn-primary, #004AAD);
    border: none;
    border-radius: var(--dmn-button-radius, 4px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.rhima-search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Header */
.rhima-header {
    background: transparent;
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding-top: 36px;
}

.rhima-header.scrolled {
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    padding-top: 0 !important;
}

.rhima-header.scrolled .rhima-header-logo img {
    filter: none;
}

.rhima-header.scrolled .rhima-menu a {
    color: var(--dmn-text, #333);
}

.rhima-header.scrolled .rhima-menu a:hover,
.rhima-header.scrolled .rhima-menu .current-menu-item a {
    color: var(--dmn-primary, #004AAD);
}

.rhima-header-inner {
    max-width: var(--dmn-site-width, 1400px);
    margin: 0 auto;
    padding: 50px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.rhima-header-logo img {
    height: 50px;
    width: auto;
}

.rhima-nav {
    flex: 1;
}

.rhima-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: flex-end;
}

.rhima-menu li {
    margin: 0;
    position: relative;
}

/* ============================================================
   Desktop Sub-menu Dropdown
   ============================================================ */
.rhima-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: var(--dmn-image-radius, 8px);
    min-width: 250px;
    padding: 10px 0;
    margin-top: 8px;
    z-index: 1000;
    list-style: none;
}

/* Invisible hover bridge so cursor can reach the dropdown without it closing.
   Iets hoger dan de margin-top van 8px, zodat een schuine muisbeweging over het
   gat niet halverwege buiten beeld valt. */
.rhima-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

/* Apple-style: blur the page body when a dropdown is open.
   :has() requires Chrome 105+, Safari 15.4+, Firefox 121+ — older browsers
   simply skip this and only get the dropdown's own backdrop-filter. */
@supports selector(:has(*)) {
    body > *:not(.rhima-header):not(.site-header):not(script):not(style):not(noscript) {
        transition: filter 0.25s ease;
    }
    body:has(.rhima-menu li.menu-item-has-children:hover > .sub-menu) > *:not(.rhima-header):not(.site-header):not(script):not(style):not(noscript) {
        filter: blur(6px);
    }
}

/* Show on hover (desktop only) */
@media (min-width: 901px) {
    .rhima-menu li.menu-item-has-children:hover > .sub-menu {
        display: block;
    }

    /* --- Sluitvertraging op de hoofd-dropdown ---------------------------------
       Het menu klapte direct dicht zodra de cursor de <li> verliet — schiet je er
       net naast op weg naar beneden, dan ben je hem kwijt (melding Jethro 28-07).

       display: none/block kan niet vertraagd worden, dus de TOP-LEVEL dropdown
       staat voortaan altijd op display:block en wordt met visibility/opacity
       getoond. visibility springt na .3s (bij openen: direct), opacity faded.
       De geneste flyouts blijven bewust op display staan: die zijn in de
       boom-modus position:static en zouden anders ruimte innemen terwijl ze
       onzichtbaar zijn.

       Let op: transform hier herhalen — de basisregel centreert met
       translateX(-50%) en een transform-declaratie overschrijft die volledig. */
    .rhima-menu > li.menu-item-has-children > .sub-menu {
        display: block;
        visibility: hidden;
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
        transition: opacity .18s ease, transform .18s ease, visibility 0s linear .3s;
    }

    .rhima-menu > li.menu-item-has-children:hover > .sub-menu,
    .rhima-menu > li.menu-item-has-children > .sub-menu:hover {
        visibility: visible;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        transition: opacity .18s ease, transform .18s ease, visibility 0s;
    }
}

.rhima-menu .sub-menu li {
    display: block;
    padding: 0;
    position: relative;
}

/* --- Sub-submenu: tree structure (expand below, not flyout) --- */
.rhima-menu .sub-menu .sub-menu {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    box-shadow: none;
    border-radius: 0;
    min-width: 0;
    margin-top: 0;
    padding: 0;
    padding-left: 12px;
    border-left: 2px solid var(--dmn-primary, #004AAD);
    background: #ffffff;
}

/* Nested sub-submenu items */
.rhima-menu .sub-menu .sub-menu a {
    padding: 8px 15px;
    font-size: 13px;
}

/* Arrow for submenu parents inside dropdown */
.rhima-menu .sub-menu li.menu-item-has-children > a::after {
    content: '▸';
    font-size: 11px;
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.rhima-menu .sub-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(90deg);
}

/* --- Desktop: sub-submenu klapt naar RECHTS uit (flyout) i.p.v. naar beneden.
   Mobiel (<=900px) blijft de accordeon-/boomstructuur hieronder. --- */
@media (min-width: 901px) {
    .rhima-menu .sub-menu .sub-menu {
        position: absolute;
        top: 0;
        left: 100%;
        margin: 0;
        padding: 10px 0;
        padding-left: 0;
        border-left: none;
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: var(--dmn-image-radius, 8px);
        min-width: 220px;
        z-index: 1001;
    }
    /* Tekst weer normale grootte (in boom-modus was dit 13px) */
    .rhima-menu .sub-menu .sub-menu a {
        padding: 10px 20px;
        font-size: 14px;
    }
    /* Pijl blijft naar rechts wijzen (geen 90°-rotatie bij flyout) */
    .rhima-menu .sub-menu li.menu-item-has-children:hover > a::after {
        transform: none;
    }
}

.rhima-menu .sub-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--dmn-text, #333) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-transform: none;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.rhima-menu .sub-menu a:hover {
    color: var(--dmn-primary, #004AAD) !important;
}

/* Arrow indicator for top-level parent menu items */
.rhima-menu > li.menu-item-has-children > a::after {
    content: '▼';
    font-size: 9px;
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.rhima-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.rhima-menu a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s ease;
    text-transform: uppercase;
}

.rhima-menu a:hover,
.rhima-menu .current-menu-item a {
    color: #fff;
}

.rhima-cta-button {
    background: var(--dmn-primary, #FFD500);
    color: #ffffff;
    padding: var(--dmn-button-padding, 12px 24px);
    border-radius: var(--dmn-button-radius, 4px);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
    text-transform: uppercase;
}

.rhima-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;

}

/* Page Hero */
.rhima-page-hero {
    position: relative;
    min-height: 550px;
    display: flex;
    align-items: center;
    padding-top: 140px;
    margin: 0;
}

.rhima-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.rhima-hero-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* PIM product-/categorie-cutouts: volledig in beeld i.p.v. vullend bijsnijden */
.rhima-hero-image.is-cutout {
    object-fit: contain;
    object-position: right center;
    padding: 40px 0;
}

.rhima-hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
}

.rhima-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(130deg,
        var(--dmn-secondary, #FFD500) 0%,
        var(--dmn-secondary, #FFD500) 50%,
        color-mix(in srgb, var(--dmn-secondary, #FFD500) 60%, transparent) 78%,
        transparent 100%);
}

.rhima-hero-content {
    position: relative;
    z-index: 2;
    max-width: var(--dmn-site-width, 1400px);
    margin: 0 auto;
    padding: 200px 0px;
    width: 100%;
}

.rhima-breadcrumbs {
    margin: 10px 0px 20px 0px;
}

.rhima-breadcrumbs a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 12px;
}

.rhima-breadcrumbs a:hover {
    color: #ffffff;
}

.rhima-breadcrumbs span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.rhima-breadcrumbs .last {
    color: var(--dmn-primary, #FFD500);
}

.rhima-breadcrumbs .separator {
    padding: 0 10px;
}

.rhima-hero-title {
    font-size: var(--dmn-h1-size, 3em);
    font-weight: var(--dmn-h1-weight, 700);
    color: #ffffff !important;
    margin: 30px 0 15px 0;
    line-height: 1.2;
}

.rhima-hero-subtitle {
    font-size: var(--dmn-text, 1.2em);
    color: #fff !important;
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

.rhima-hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 3;
    transform: scaleX(-1);
}

.rhima-hero-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Responsive */

@media (min-width: 901px) and (max-width: 1200px) {
    .rhima-header-inner {
        padding-left: 30px;
        padding-right: 30px;
    }

    .rhima-home-hero {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (max-width: 900px) {
    .rhima-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 10000;
        overflow-y: auto;
        padding: 60px 20px 20px;
    }

    .rhima-menu a:hover,
    .rhima-menu .current-menu-item a {
        color: var(--dmn-text, #333);
    }

    .rhima-nav.active {
        right: 0;
    }

    .rhima-menu {
        flex-direction: column;
        gap: 0;
    }

    .rhima-menu li {
        width: 100%;
    }

    .rhima-menu a {
        color: var(--dmn-text, #333);
        padding: 5px 0;
        display: block;
    }

    /* Mobile sub-menu: accordion style */
    .rhima-menu .sub-menu {
        position: static;
        transform: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        min-width: 0;
        padding: 0;
        margin-top: 0;
        padding-left: 15px;
        border-left: 2px solid var(--dmn-primary, #004AAD);
    }

    .rhima-menu .sub-menu a {
        color: var(--dmn-text, #333) !important;
        padding: 8px 0;
        font-size: 14px;
    }

    .rhima-menu .sub-menu a:hover {
        background: transparent;
        color: var(--dmn-primary, #004AAD) !important;
    }

    /* Arrow rotation for active state */
    .rhima-menu li.menu-item-has-children > a.active::after {
        transform: rotate(180deg);
    }

    .rhima-menu a:hover {
        color: var(--dmn-primary, #004AAD);
    }

    .rhima-header-inner {
        flex-wrap: wrap;
        padding: 20px;
    }

    .rhima-nav {
        order: 3;
        width: 100%;
        display: none;
    }

    .rhima-nav.active {
        display: block;
    }

    .rhima-menu {
        flex-direction: column;
        gap: 15px;
        padding: 20px 0;
    }

    /* Hero responsive */
    .rhima-page-hero {
        min-height: 400px;
        padding-top: 100px;
    }

    .rhima-hero-image {
        width: 80%;
        object-position: center right;
    }
    .rhima-hero-image.is-cutout {
        padding: 24px 0;
    }

    .rhima-hero-overlay {
        background: linear-gradient(130deg,
            var(--dmn-secondary, #FFD500) 0%,
            var(--dmn-secondary, #FFD500) 55%,
            color-mix(in srgb, var(--dmn-secondary, #FFD500) 60%, transparent) 82%,
            transparent 100%);
    }

    .rhima-hero-content {
        padding: 100px var(--dmn-container-padding, 30px) 80px;
    }

    .rhima-hero-title {
        font-size: 2em;
    }

    .rhima-hero-subtitle {
        font-size: 1em;
    }

    .rhima-hero-wave {
        height: 80px;
    }
}

/* Tablet and mobile - transparent icon bar */
@media (max-width: 900px) {

    .rhima-icon-bar,
    .rhima-icon-bar.hidden,
    .rhima-icon-bar:not(.scrolled) {
        background: transparent !important;
    }

    .rhima-icon-bar-inner {
        background: transparent !important;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 0px !important;
    }
}

@media (max-width: 600px) {
    .rhima-icon-bar-icons {
        gap: 10px;
    }

    .rhima-icon-bar-inner {
        gap: 5px;
    }

    .rhima-header-logo img {
        height: 40px;
    }

    /* Remove body padding on mobile */
    body {
        padding-top: 0 !important;
    }

    /* Header transparent on mobile (not scrolled) */
    .rhima-header {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* White background when scrolled */
    .rhima-header.scrolled {
        background: #ffffff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }

    /* Hero mobile */
    .rhima-page-hero {
        min-height: 350px;
        padding-top: 80px;
    }

    .rhima-hero-image {
        width: 100%;
        object-position: center;
    }

    .rhima-hero-background::after {
        display: none;
    }

    .rhima-hero-overlay {
        background: linear-gradient(130deg,
            var(--dmn-secondary, #FFD500) 0%,
            var(--dmn-secondary, #FFD500) 55%,
            color-mix(in srgb, var(--dmn-secondary, #FFD500) 60%, transparent) 82%,
            transparent 100%);
        opacity: 0.9;
    }

    .rhima-hero-content {
        padding: 120px 20px;
    }

    .rhima-hero-title {
        font-size: 1.8em;
    }

}

/* Mobile menu close button */
.rhima-menu-close {
    display: none;
}

@media (max-width: 900px) {
    .rhima-menu-close {
        display: block;
        position: absolute;
        top: 45px;
        right: 30px;
        background: #fff;
        border: none;
        font-size: 32px;
        color: var(--dmn-text, #333);
        cursor: pointer;
        padding: 5px;
        line-height: 1;
    }

    .rhima-mobile-cta {
        margin-top: 20px;
        padding-top: 0px;
    }

    .rhima-mobile-cta .rhima-cta-button {
        width: 100%;
        text-align: center;
    }
}

/* Hide desktop CTA on mobile */
@media (max-width: 900px) {
    .rhima-header-cta {
        display: none;
    }
}

/* Hide mobile CTA on desktop */
.rhima-mobile-cta {
    display: none;
}

@media (max-width: 900px) {
    .rhima-mobile-cta {
        display: block;
    }
}