/* RT Header (WooCommerce) — Rimanto įrankiai */
.rt-header-wrap { font-family: 'Montserrat', sans-serif; }

/* Fixed (always visible) on both desktop and mobile.
   The header lives in its own HFE template wrapper, so position:sticky has no
   scroll travel — fixed is the reliable approach. A JS hook sets body padding
   so page content never hides underneath. */
.rt-header { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: #111315; }
/* keep header below the WP admin bar for logged-in users */
.admin-bar .rt-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .rt-header { top: 46px; } }

.rt-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0 auto;
    width: 100%;
}

/* Logo */
.rt-header-logo { flex: 0 0 auto; }
.rt-logo-text { font-weight: 700; font-size: 22px; text-decoration: none; line-height: 1; }
.rt-logo-img { display: inline-flex; }
.rt-logo-img img { display: block; }

/* Nav */
.rt-header-nav { flex: 1 1 auto; }
.rt-header-nav .rt-menu,
.rt-header-nav > ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; flex-wrap: wrap;
}
.rt-header-nav li { position: relative; }
.rt-header-nav a {
    text-decoration: none; font-weight: 600; font-size: 15px;
    display: block; padding: 6px 0; transition: color .15s ease;
}
/* Submenus */
.rt-header-nav .sub-menu {
    list-style: none; margin: 0; padding: 8px 0;
    position: absolute; top: 100%; left: 0; min-width: 200px;
    background: #1b1e21; border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: all .18s ease; z-index: 50;
}
.rt-header-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.rt-header-nav .sub-menu a { padding: 8px 16px; }
.rt-header-nav .menu-item-has-children > a::after { content: " ▾"; font-size: 11px; opacity: .7; }

/* Actions */
.rt-header-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 16px; }

/* Search */
.rt-search { position: relative; display: flex; align-items: center; }
.rt-search-toggle, .rt-nav-toggle { background: none; border: 0; cursor: pointer; padding: 6px; color: #fff; display: inline-flex; }
.rt-search-form {
    position: absolute; right: 0; top: calc(100% + 10px);
    background: #1b1e21; padding: 8px; border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    display: none; z-index: 60;
}
.rt-search.rt-open .rt-search-form { display: block; }
.rt-search-form input[type="search"] {
    width: 240px; max-width: 60vw; border: 0; border-radius: 6px;
    padding: 10px 12px; font-size: 14px; background: #2a2e32; color: #fff;
}
.rt-search-form input[type="search"]::placeholder { color: #9aa0a6; }

/* Cart */
.rt-cart { position: relative; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.rt-cart-count {
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #f07922; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    position: absolute; top: -8px; left: 12px;
}
.rt-cart-total { font-size: 14px; font-weight: 600; }

/* CTA */
.rt-cta-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 22px; font-weight: 700; font-size: 14px;
    text-decoration: none; border-radius: 6px; line-height: 1;
    transition: background .15s ease, transform .15s ease; white-space: nowrap;
}
.rt-cta-btn:hover { transform: translateY(-1px); }

/* Hamburger */
.rt-nav-toggle { display: none; flex-direction: column; gap: 4px; }
.rt-nav-toggle span { width: 22px; height: 2px; background: currentColor; display: block; transition: .2s; }
.rt-nav-open .rt-nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.rt-nav-open .rt-nav-toggle span:nth-child(2) { opacity: 0; }
.rt-nav-open .rt-nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile submenu: keep visible/stacked rather than hover-dropdown */
@media (max-width: 1024px) {
    .rt-header-nav .sub-menu {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; padding-left: 16px; background: transparent;
    }
    .rt-header-nav a { padding: 12px 16px; }
}

/* =========================================================================
   Mobile header responsiveness (no horizontal overflow)
   ========================================================================= */
@media (max-width: 1024px) {
    .rt-header { overflow-x: clip; }
    .rt-header-inner {
        flex-wrap: nowrap;
        gap: 12px;
        max-width: 100%;
    }
    /* Logo on the left, all controls pushed to the right */
    .rt-header-logo { margin-right: auto; min-width: 0; }
    .rt-logo-text {
        font-size: 19px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .rt-header-actions { gap: 12px; flex: 0 0 auto; }
    /* Cart total takes too much width on small screens — keep icon + count badge */
    .rt-cart-total { display: none; }
}

@media (max-width: 600px) {
    .rt-header-inner { gap: 10px; padding-left: 16px; padding-right: 16px; }
    .rt-logo-text { font-size: 17px; }
    /* Long CTA button doesn't fit next to the icons on phones */
    .rt-cta-btn { display: none; }
    .rt-header-actions { gap: 10px; }
}

/* Lock background scroll while the full-screen menu is open */
body.rt-nav-locked { overflow: hidden; }
