/* ==========================================================================
 * Header Style 7 — Aragold premium jewelry layout
 *
 * Design ref: public/header-style-7-reference/index.html
 * Layout: Logo (stanga) | [Search bar + Main menu] (centru, doua randuri) |
 *         [Stores megamenu icon | divider | user | wishlist | cart] +
 *         [Despre noi · Contact] (dreapta, doua randuri)
 *
 * Toate culorile sunt derivate din var(--header-main-*) si var(--brand-primary)
 * pentru a respecta presetul `header_style=7` din header-style-presets.php.
 * ========================================================================== */

.tp-header-7-area {
    position: relative;
    z-index: 99;
}

/* Top bar — subtle separation from main header (style 7 specific) */
.tp-header-7-area .tp-header-top-2 {
    border-bottom: 1px solid #E5E7EB;
    padding: 8px 0;
    font-size: 13px;
}

/* Hide right-side cluster (language switcher, currency, login, register)
 * pe header style 7 — pastram doar announcement-ul pe stanga. */
.tp-header-7-area .tp-header-top-2 .tp-header-top-right {
    display: none !important;
}

.tp-header-7 .tp-header-7-inner {
    padding: 14px 0;
}

/* Container max-width 1140px (Bootstrap default) — paritate cu header style 1 */
.tp-header-7-container {
    /* Bootstrap .container deja seteaza max-width 1140px pe xl */
}

.tp-header-7-row-top {
    flex-wrap: nowrap;
}

/* Customer area loads ecommerce/customer.css after Bootstrap and redefines
 * .col-md-3/.col-md-9. Restore header-7 desktop grid explicitly so account
 * pages cannot stretch the right action cluster outside the container. */
@media (min-width: 992px) {
    .tp-header-7-logo-col,
    .tp-header-7-spacer-col {
        flex: 0 0 auto;
        width: 16.66666667%;
    }

    .tp-header-7-search-col,
    .tp-header-7-menu-col {
        flex: 0 0 auto;
        width: 58.33333333%;
    }

    .tp-header-7-icons-col,
    .tp-header-7-secondary-col {
        flex: 0 0 auto;
        width: 25%;
        max-width: 25%;
    }
}

.tp-header-7-row-bottom {
    margin-top: 14px;
}

.tp-header-7-row-top .logo img {
    max-height: 60px !important;
}

/* Search bar — text centrat orizontal, iconul lupa absolute la stanga */
.tp-header-7-search {
    /* layout flux fara margins (e in Rand 1, vertical-centered prin row align-items-center) */
}

/* Search bar mobile — vizibil DOAR pe < md (sub 768px), full-width sub
 * Logo+Icons in Rand 1. Cerere client 2026-05-06: header mobil sa contina
 * bara de search (era ascunsa cu d-md-block). */
.tp-header-7-search-col--mobile {
    margin-top: 12px;
}

.tp-header-7-search-box {
    position: relative;
    display: flex;
    height: 41px;
    padding: 0 16px;
    align-items: center;
    border-radius: 14px;
    background: #f3f3f3;
    width: 100%;
}

.tp-header-7-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #2a2826;
    line-height: 0;
    pointer-events: none;
    z-index: 2;
}

.tp-header-7-search-box .tp-header-7-search-input,
.tp-header-7-search-box input[type="text"],
.tp-header-7-search-box input[type="search"] {
    background: transparent;
    border: none;
    width: 100%;
    height: 100%;
    padding: 0 16px 0 44px;
    color: #2a2826;
    font-family: Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    outline: none;
}

.tp-header-7-search-box .tp-header-7-search-input::placeholder,
.tp-header-7-search-box input::placeholder {
    color: #2a2826;
    font-weight: 500;
    opacity: 1;
    text-align: center;
}

/* Main menu pe randul de jos — selectoare proprii (nu reutilizam clase shofy
 * .main-menu / .menu-style-3 care aplica stilurile shofy peste si pierdem
 * controlul cromatic). */
.tp-header-7-menu {
    display: flex;
    justify-content: center;
}

.tp-header-7-menu-nav > ul {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tp-header-7-menu-nav > ul > li > a {
    color: #2a2826;
    font-family: Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    padding: 8px 0;
    display: inline-block;
    transition: color 0.2s ease;
}

.tp-header-7-menu-nav > ul > li > a:hover {
    color: var(--header-main-text-hover-color, #BD844C);
}

/* Has-dropdown items: relative position pentru submeniu absolute */
.tp-header-7-menu-nav > ul > li.has-dropdown {
    position: relative;
}

/* Chevron langa text (Tabler ti-chevron-down inline SVG, 24x24 default) */
.tp-header-7-menu-nav > ul > li.has-dropdown > a > svg {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    vertical-align: middle;
    transform: translateY(-1px);
    transition: transform 0.3s ease, color 0.2s ease;
}

.tp-header-7-menu-nav > ul > li.has-dropdown:hover > a > svg {
    transform: translateY(-1px) rotate(-180deg);
    color: var(--header-main-text-hover-color, #BD844C);
}

/* Submeniu popup (mirror la shofy .main-menu .tp-submenu) */
.tp-header-7-menu-nav > ul > li > .tp-submenu {
    position: absolute;
    top: 120%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 30px 70px 0 rgba(11, 6, 70, 0.08);
    padding: 12px 25px 20px;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* hidden state nu capteaza mouse */
    z-index: 99;
    transition: all 0.3s ease-out 0s;
}

/* Hover trigger via JS-managed .is-hovering (delay 150ms intent) */
.tp-header-7-menu-nav > ul > li.is-hovering > .tp-submenu {
    opacity: 1;
    top: 100%;
    visibility: visible;
    pointer-events: auto;
}

.tp-header-7-menu-nav > ul > li > .tp-submenu li {
    display: block;
    width: 100%;
    margin: 0;
}

.tp-header-7-menu-nav > ul > li > .tp-submenu li a {
    display: block;
    width: 100%;
    padding: 3px 0;
    color: #2a2826;
    font-family: Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tp-header-7-menu-nav > ul > li > .tp-submenu li:hover > a {
    color: var(--header-menu-text-hover-color, #BD844C);
}

/* Sub-submeniu (third-level) */
.tp-header-7-menu-nav > ul > li > .tp-submenu li.has-dropdown {
    position: relative;
}

.tp-header-7-menu-nav > ul > li > .tp-submenu li > .tp-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 30px 70px 0 rgba(11, 6, 70, 0.08);
    padding: 12px 25px 20px;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out 0s;
}

.tp-header-7-menu-nav > ul > li > .tp-submenu li:hover > .tp-submenu {
    opacity: 1;
    visibility: visible;
}

/* Sub-li:hover OK — submeniul interior e oricum revealed */

/* ==========================================================================
 * Mega Menu (WoodMart-style)
 *
 * Render: <li class="has-mega-menu has-dropdown"> > <ul class="tp-mega-menu">
 * Each column = direct <li> in tp-mega-menu (4 columns implicit, max 6)
 * Column header = <a class="mega-menu-title"> (bold, dark, uppercase tracking)
 * Sub-items = nested <ul class="tp-submenu"> with light-weight links
 * ========================================================================== */
.tp-header-7-menu-nav > ul > li.has-mega-menu {
    position: static; /* permite dropdown sa fie full-width al containerului parent */
}

.tp-header-7-menu-nav > ul > li.has-mega-menu > .tp-mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 120%;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 30px 70px 0 rgba(11, 6, 70, 0.08);
    padding: 32px 32px 24px;
    margin: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* hidden state nu capteaza mouse-ul */
    transition: opacity 0.3s ease, top 0.3s ease, visibility 0.3s;
    z-index: 99;
}

.tp-header-7-menu-nav > ul > li.has-mega-menu.is-hovering > .tp-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    top: 100%;
}

/* Daca mega-menu are doar 3 coloane (3 children), distribuie pe 3 */
.tp-header-7-menu-nav > ul > li.has-mega-menu > .tp-mega-menu:has(> li:last-child:nth-child(3)) {
    grid-template-columns: repeat(3, 1fr);
}

/* Daca are 5+ coloane, distribuie pe 5 */
.tp-header-7-menu-nav > ul > li.has-mega-menu > .tp-mega-menu:has(> li:last-child:nth-child(n+5)) {
    grid-template-columns: repeat(5, 1fr);
}

/* Column wrapper */
.tp-header-7-menu-nav .tp-mega-menu > li {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    float: none;
    overflow: visible;
}

/* Column header (mega-menu-title) — WoodMart pattern: dark, bold, slight tracking */
.tp-header-7-menu-nav .tp-mega-menu > li > a.mega-menu-title {
    display: block;
    color: #010F1C;
    font-family: Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0 0 12px;
    margin: 0 0 12px;
    border-bottom: 1px solid #E5E7EB;
    transition: color 0.2s ease;
}

.tp-header-7-menu-nav .tp-mega-menu > li > a.mega-menu-title:hover {
    color: var(--header-menu-text-hover-color, #BD844C);
}

/* Sub-items in column (tp-submenu nested under tp-mega-menu column) — light-weight */
.tp-header-7-menu-nav .tp-mega-menu > li > .tp-submenu {
    /* Override regulile defaults pentru .tp-submenu (care e absolute popup);
       in mega-menu sub-items sunt static, parte din coloana. */
    position: static !important;
    display: block !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    list-style: none;
}

.tp-header-7-menu-nav .tp-mega-menu > li > .tp-submenu li {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    line-height: 1.4;
}

.tp-header-7-menu-nav .tp-mega-menu > li > .tp-submenu li:last-child {
    margin-bottom: 0;
}

.tp-header-7-menu-nav .tp-mega-menu > li > .tp-submenu li a {
    display: block;
    color: #4A4A4A;
    font-family: Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.tp-header-7-menu-nav .tp-mega-menu > li > .tp-submenu li a:hover {
    color: var(--header-menu-text-hover-color, #BD844C);
    padding-left: 4px;
}

/* Nu mai apare chevron pentru mega-menu trigger (chevron e standardul has-dropdown) */
/* dar pentru consistenta vizuala il pastram. Alternativa: ascundem cu rule mai jos: */
/*
.tp-header-7-menu-nav > ul > li.has-mega-menu > a > svg {
    display: none;
}
*/

/* ========== Coloana dreapta (rand 1: icons single-line) ========== */
.tp-header-7-icons-col {
    display: flex;
    justify-content: flex-end;
}

.tp-header-7-icons {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Login widget (paritate cu header-1) — overrides minore pentru integrare in icon-row.
 * Reset shofy default ml-50 / line-height ca sa se alinieze cu cellelalte iconuri. */
.tp-header-7-login {
    margin: 0;
}

.tp-header-7-login a {
    color: var(--header-main-text-color, #8B7355);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tp-header-7-login a:hover {
    color: var(--header-main-text-hover-color, #BD844C);
}

.tp-header-7-login a:hover .tp-header-login-title {
    color: var(--header-main-text-hover-color, #BD844C);
}

/* Coloana secondary nav (rand 2 dreapta: Despre noi · Contact) */
.tp-header-7-secondary-col {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.tp-header-7-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--header-main-text-color, #8B7355);
    transition: color 0.2s ease;
    text-decoration: none;
}

.tp-header-7-icon-btn:hover {
    color: var(--header-main-text-hover-color, #BD844C);
}

.tp-header-7-icon-btn svg {
    width: 22px;
    height: 22px;
}

/* Vertical divider auriu intre stores si user/wishlist/cart */
.tp-header-7-divider {
    width: 1px;
    height: 31px;
    background: var(--header-border-color, #B8964C);
    flex-shrink: 0;
}

/* Counter badge — cerc gold cu border alb */
.tp-header-7-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    background: var(--header-counter-background-color, #BD844C);
    color: var(--header-counter-text-color, #fff);
    font-family: Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--header-counter-border-color, #fff);
    box-sizing: border-box;
}

/* ========== Stores megamenu ========== */
.tp-header-7-stores-wrapper {
    position: relative;
}

.tp-header-7-stores-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--header-main-text-color, #8B7355);
    transition: color 0.2s ease;
    line-height: 0;
}

.tp-header-7-stores-btn:hover {
    color: var(--header-main-text-hover-color, #BD844C);
}

.tp-header-7-stores-btn svg {
    width: 22px;
    height: 22px;
}

.tp-header-7-stores-megamenu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 720px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
}

.tp-header-7-stores-wrapper:hover .tp-header-7-stores-megamenu,
.tp-header-7-stores-wrapper:focus-within .tp-header-7-stores-megamenu,
.tp-header-7-stores-wrapper.is-open .tp-header-7-stores-megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tp-header-7-stores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tp-header-7-store-card {
    padding: 16px;
    border-radius: 8px;
    background: #FAF7F2;
    transition: background 0.2s ease;
}

.tp-header-7-store-card:hover {
    background: #F0ECE4;
}

.tp-header-7-store-name {
    color: #010F1C;
    font-family: Poppins, sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.tp-header-7-store-address {
    color: #4A4A4A;
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 8px;
}

.tp-header-7-store-phone {
    display: inline-block;
    color: #BD844C;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 8px;
}

.tp-header-7-store-phone:hover {
    color: #A06B33;
    text-decoration: underline;
}

.tp-header-7-store-hours {
    color: #6B6B6B;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

/* ========== Secondary menu (Despre noi · Contact) ========== */
.tp-header-7-secondary {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tp-header-7-secondary ul,
.tp-header-7-secondary > nav > ul {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tp-header-7-secondary a {
    color: var(--header-main-text-color, #2a2826);
    font-family: Poppins, sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tp-header-7-secondary a:hover {
    color: var(--header-main-text-hover-color, #BD844C);
}

/* ========== Responsive ========== */
@media (max-width: 1199px) {
    .tp-header-7-stores-megamenu {
        min-width: 600px;
    }

    .tp-header-7-stores-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 991px) {
    .tp-header-7-stores-megamenu {
        min-width: 480px;
    }

    .tp-header-7-stores-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .tp-header-7-row-top .logo img {
        max-height: 50px !important;
    }

    .tp-header-7-stores-megamenu {
        position: fixed;
        top: 80px;
        left: 16px;
        right: 16px;
        min-width: 0;
    }

    .tp-header-7-icons {
        gap: 10px;
    }

    .tp-header-7-icon-btn svg,
    .tp-header-7-stores-btn svg {
        width: 20px;
        height: 20px;
    }
}
