/**
 * Header Menu Styles
 * EGYEDI PREFIX: headermenu
 */

/* ========================================
   1. OVERLAY
   ======================================== */

.headermenu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.headermenu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   2. OUTER ÉS WRAPPER - STICKY
   ======================================== */

.headermenu-outer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.headermenu-outer.headermenu-scrolled {
    box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.12);
}


body.admin-bar .headermenu-outer {
    top: 32px;
}

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

.headermenu-outer.headermenu-hidden {
    transform: translateY(-100%);
}

.headermenu-spacer {
    display: block;
}

.headermenu-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 10px 0px;
    box-sizing: border-box;
    transition: padding 0.3s ease;
}

/* Kompakt (sticky/scrolled) állapot */
.headermenu-outer.headermenu-scrolled .headermenu-wrapper {
    padding: 8px 0px;
}

.headermenu-outer.headermenu-scrolled .headermenu-logo-img {
    max-height: 50px;
}

/* ========================================
   3. LOGO
   ======================================== */

.headermenu-logo {
    flex-shrink: 0;
    z-index: 10;
}

.headermenu-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.headermenu-logo-img {
    max-height: 71px;
    width: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.headermenu-logo-text {
    font-family: "proxima-nova", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1D2327;
    transition: color 0.3s ease;
}

.headermenu-logo-text:hover {
    color: #ce2424;
}

/* ========================================
   4. JOBB OLDALI WRAPPER
   ======================================== */

.headermenu-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* ========================================
   5. NAVIGÁCIÓ / MENÜ (Desktop)
   ======================================== */

.headermenu-nav {
    display: flex;
    align-items: center;
}

.headermenu-nav-list {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.headermenu-nav-list li {
    margin: 0;
    padding: 0;
    position: relative;
}

.headermenu-nav-list li a {
    font-family: "proxima-nova", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1D2327;
    text-decoration: none;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.headermenu-nav-list li a:hover {
    color: #ce2424;
}

/* Aktív menüpont */
.headermenu-nav-list li.current-menu-item > a,
.headermenu-nav-list li.current_page_item > a {
    color: #ce2424;
}

/* Almenü - elrejtjük a hagyományos dropdownt */
.headermenu-nav-list li ul.sub-menu {
    display: none !important;
}

/* ========================================
   MEGA MENU - ÚJ RENDSZER
   ======================================== */

.headermenu-mega {
    position: fixed;
    top: 80px; /* Header magasság - JS állítja dinamikusan */
    background: #fff;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.headermenu-mega.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.headermenu-mega-inner {
    padding: 20px;
}

.headermenu-mega-title {
    font-family: "proxima-nova", sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #ce2424;
    margin: 0 0 12px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #ce2424;
}

/* Ajánlatok - 3 oszlop */
.headermenu-mega-ajanlatok .headermenu-mega-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* Üzletek - 2 oszlop */
.headermenu-mega-uzletek .headermenu-mega-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

/* Rólunk - 3 oszlop (almenü + 2 kép) */
.headermenu-mega-rolunk .headermenu-mega-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

/* Mega menü oszlop */
.headermenu-mega-col {
    min-width: 0;
}

/* Képek */
.headermenu-mega-img {
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.headermenu-mega-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.headermenu-mega-img img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

/* Gyerek menük lista */
.headermenu-mega-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.headermenu-mega-submenu li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.headermenu-mega-submenu li:last-child {
    border-bottom: none;
}

.headermenu-mega-submenu li a {
    display: block;
    padding: 12px 0;
    font-family: "proxima-nova", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1D2327;
    text-decoration: none;
    transition: all 0.3s ease;
}

.headermenu-mega-submenu li a:hover {
    color: #ce2424;
    padding-left: 10px;
}

/* Üzletek lista */
.headermenu-mega-uzlet-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Hozzám legközelebbi gomb */
.headermenu-mega-uzlet-near-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    margin: 0 0 15px 0;
    padding: 10px 16px;
    background: #fff;
    color: #ce2424;
    border: 1px solid #ce2424;
    border-radius: 8px;
    font-family: "proxima-nova", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.headermenu-mega-uzlet-near-btn:hover {
    background: #ce2424;
    color: #fff;
}

.headermenu-mega-uzlet-near-btn.active {
    background: #ce2424;
    color: #fff;
    cursor: default;
}

.headermenu-mega-uzlet-near-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.headermenu-mega-uzlet-near-btn.loading svg {
    animation: headermenu-spin 1s linear infinite;
}

/* Távolság az üzlet neve mellett */
.headermenu-mega-uzlet-tav {
    float: right;
    font-size: 13px;
    font-weight: 600;
    color: #ce2424;
    background: #fdecec;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Hibaüzenet a hozzám legközelebbi gomb alatt */
.headermenu-mega-uzlet-error {
    background: #fdecec;
    color: #ce2424;
    border: 1px solid #f5c2c2;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: "proxima-nova", sans-serif;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}

.headermenu-mega-uzlet-item {
    display: block;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.headermenu-mega-uzlet-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.headermenu-mega-uzlet-nev {
    font-family: "proxima-nova", sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1D2327;
    margin: 0 0 5px 0;
}

.headermenu-mega-uzlet-cim {
    font-family: "proxima-nova", sans-serif;
    font-size: 13px;
    color: #666;
    margin: 0 0 5px 0;
}

.headermenu-mega-uzlet-status {
    font-family: "proxima-nova", sans-serif;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.headermenu-mega-uzlet-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.headermenu-mega-uzlet-status.open .status-dot {
    background: #22c55e;
}

.headermenu-mega-uzlet-status.closed .status-dot {
    background: #ce2424;
}

.headermenu-mega-uzlet-status.open .status-text {
    color: #22c55e;
}

.headermenu-mega-uzlet-status.closed .status-text {
    color: #ce2424;
}

/* Nyíl ikon mega menüs elemekhez */
.headermenu-nav-list li.headermenu-has-mega > a::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'><path d='M64 88c-1.023 0-2.047-.391-2.828-1.172l-40-40c-1.563-1.563-1.563-4.094 0-5.656s4.094-1.563 5.656 0l37.172 37.172 37.172-37.172c1.563-1.563 4.094-1.563 5.656 0s1.563 4.094 0 5.656l-40 40c-.781.781-1.805 1.172-2.828 1.172z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'><path d='M64 88c-1.023 0-2.047-.391-2.828-1.172l-40-40c-1.563-1.563-1.563-4.094 0-5.656s4.094-1.563 5.656 0l37.172 37.172 37.172-37.172c1.563-1.563 4.094-1.563 5.656 0s1.563 4.094 0 5.656l-40 40c-.781.781-1.805 1.172-2.828 1.172z'/></svg>");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transition: transform 0.3s ease;
}

.headermenu-nav-list li.headermenu-has-mega.active > a::after {
    transform: rotate(180deg);
}

.headermenu-nav-list li.headermenu-has-mega.active > a {
    color: #ce2424;
}

/* ========================================
   6. HAMBURGER GOMB (Mobil)
   ======================================== */

.headermenu-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.headermenu-hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background: #1D2327;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.headermenu-hamburger.active .headermenu-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.headermenu-hamburger.active .headermenu-hamburger-line:nth-child(2) {
    opacity: 0;
}

.headermenu-hamburger.active .headermenu-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   7. OFF-CANVAS MENÜ (Mobil) - JAVÍTOTT
   ======================================== */

.headermenu-offcanvas {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90vw;
    max-width: 400px;
    height: 100%;
    height: 100dvh;
    background: #fff;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.headermenu-offcanvas.active {
    right: 0;
}

.headermenu-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.headermenu-offcanvas-title {
    font-family: "proxima-nova", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1D2327;
}

/* Logo a mobil menü fejlécében */
.headermenu-offcanvas-logo {
    flex: 1;
    display: flex;
    align-items: center;
}

.headermenu-offcanvas-logo .headermenu-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.headermenu-offcanvas-logo .headermenu-logo-img {
    max-height: 50px;
    width: auto;
}

.headermenu-offcanvas-logo .headermenu-logo-text {
    font-family: "proxima-nova", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1D2327;
}

.headermenu-offcanvas-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #1D2327;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.headermenu-offcanvas-close:hover {
    color: #ce2424;
}

.headermenu-offcanvas-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 25px 20px 20px; /* jobb oldalon hely a custom scrollbarnak */
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    /* natív scrollbar elrejtése - mi rajzolunk sajátot */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.headermenu-offcanvas-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Custom mindig látható scrollbar - JS vezérli */
.headermenu-offcanvas-scrollbar {
    position: absolute;
    top: 90px; /* a header alatt - az offcanvas-header magassága */
    right: 6px;
    bottom: 10px;
    width: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    z-index: 5;
    pointer-events: none;
}

.headermenu-offcanvas-scrollbar-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-height: 30px;
    background: #ce2424;
    border-radius: 3px;
    transition: top 0.05s linear;
}

.headermenu-offcanvas-nav .headermenu-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.headermenu-offcanvas-nav .headermenu-nav-list li {
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    position: relative;
}

.headermenu-offcanvas-nav .headermenu-nav-list li:last-child {
    border-bottom: none;
}

.headermenu-offcanvas-nav .headermenu-nav-list li a {
    display: block;
    padding: 15px 0;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Almenük mobilon ALAPBÓL NYITVA, behúzva */
.headermenu-offcanvas-nav .headermenu-nav-list li ul.sub-menu {
    display: block !important;
    list-style: none;
    margin: 0;
    padding: 0 0 5px 15px;
    border-top: 1px solid #f5f5f5;
}

.headermenu-offcanvas-nav .headermenu-nav-list li ul.sub-menu li {
    border-bottom: 1px solid #f5f5f5;
}

.headermenu-offcanvas-nav .headermenu-nav-list li ul.sub-menu li:last-child {
    border-bottom: none;
}

.headermenu-offcanvas-nav .headermenu-nav-list li ul.sub-menu li a {
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.headermenu-offcanvas-nav .headermenu-nav-list li ul.sub-menu li a:hover {
    color: #ce2424;
}

.headermenu-offcanvas-nav .headermenu-nav-list li.headermenu-has-mega > a::after {
    display: none;
}

/* ========================================
   8. LIVE KERESÉS
   ======================================== */

.headermenu-search {
    position: static;
}

.headermenu-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0px 35px;
    height: 40px;
    background: #593f90;
    color: #fff !important;
    font-family: "proxima-nova", sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 30px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}

.headermenu-cta-btn:hover {
    box-shadow: 0 8px 20px #593f9046;
}

.headermenu-cta-ikon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    object-fit: contain;
    vertical-align: middle;
}

/* Csak ikonos kereső gomb a fejlécben */
.headermenu-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
        background: #ce2424;
    color: #fff;
    transition: background 0.2s ease, color 0.2s ease;
}

.headermenu-search-toggle:hover,
.headermenu-search-toggle.active {
        background: #ce2424;
   box-shadow: 0 8px 20px rgba(206, 36, 36, 0.25);
}

.headermenu-search-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Legördülő keresési panel — a fejléc alatt, a wrapper szélessége */
.headermenu-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-radius: 0 0 12px 12px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    box-sizing: border-box;
}

.headermenu-search-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.headermenu-search-panel-inner {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.headermenu-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.headermenu-search-input {
    font-family: "proxima-nova", sans-serif;
    font-size: 16px;
    padding: 14px 50px 14px 20px;
    border: 1px solid #dbd8d5 !important;
    border-radius: 30px !important;
    width: 100%;
    outline: none;
    transition: border-color 0.3s ease;
    background: #fff !important;
    box-sizing: border-box;
}

.headermenu-search-input:focus {
    border-color: #dbd8d5 !important;
}

.headermenu-search-input::placeholder {
    color: #1D2327;
    font-weight: 400;
      font-size: 15px;
    opacity: 1;
}

.headermenu-search-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: background 0.2s ease, color 0.2s ease;
}

.headermenu-search-close:hover {
    background: #ce2424;
    color: #fff;
}

/* Keresési eredmények - a panelen belül */
.headermenu-search-results {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    background: #fff;
    display: none;
}

.headermenu-search-results.active {
    display: block;
}

/* Eredmény elem */
.headermenu-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.headermenu-search-item:last-child {
    border-bottom: none;
}

.headermenu-search-item:hover {
    background: #f8f8f8;
}

/* Termék találat – kép */
.headermenu-search-item-image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #fbfbfb;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.headermenu-search-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.headermenu-search-item-content {
    flex: 1;
    min-width: 0;
}

.headermenu-search-item-title {
    font-family: "proxima-nova", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1D2327;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.headermenu-search-item-excerpt {
    font-family: "proxima-nova", sans-serif;
    font-size: 12px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.headermenu-search-item-type {
    font-family: "proxima-nova", sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    background: #ce2424;
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Nincs találat */
.headermenu-search-no-results {
    padding: 20px;
    text-align: center;
    font-family: "proxima-nova", sans-serif;
    font-size: 14px;
    color: #666;
}

/* Töltés jelző */
.headermenu-search-loading {
    padding: 20px;
    text-align: center;
}

.headermenu-search-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #ce2424;
    border-radius: 50%;
    animation: headermenu-spin 0.8s linear infinite;
}

@keyframes headermenu-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   9. RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .headermenu-nav {
        display: none;
    }
    
    .headermenu-hamburger {
        display: flex;
    }
    
    /* Mega menük elrejtése mobilon */
    .headermenu-mega {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .headermenu-wrapper {
        padding: 10px 15px;
    }
    
    .headermenu-logo-img {
        max-height: 40px;
    }
    
    .headermenu-right {
        gap: 10px;
    }
    
    .headermenu-search-panel-inner {
        padding: 15px;
    }
    
    .headermenu-search-input {
        font-size: 15px;
        padding: 12px 45px 12px 16px;
    }
    
    .headermenu-cta-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* Off-canvas javítások */
    .headermenu-offcanvas {
        width: 90vw;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .headermenu-search {
        display: none;
    }
    
    .headermenu-offcanvas {
        width: 90vw;
        max-width: 90vw;
    }
}

/* Body lock amikor offcanvas nyitva */
body.headermenu-body-locked {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
