/* =============================================
   SHARED HEADER - Single source of truth
   Extracted from index.html (homepage)
   ALL pages must load this file for consistent nav
   ============================================= */

/* Prevent any element from widening the page and shrinking the header */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ===== HEADER ===== */
.header {
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.header .container {
    padding: 0 20px !important;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 110px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.nav > a:not(.btn-phone):not(.nav-cart):not(.nav-login),
.nav-item {
    color: var(--dark, #0a1612) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: color 0.3s ease !important;
    position: relative !important;
    cursor: pointer;
    white-space: nowrap !important;
    padding: 0 !important;
    display: inline !important;
    line-height: 1.6 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.nav .nav-login {
    color: var(--dark, #0a1612) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: color 0.3s ease !important;
    position: relative !important;
    white-space: nowrap !important;
    padding: 0 !important;
    display: inline !important;
    line-height: 1.6 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.nav a:hover, .nav-item:hover {
    color: var(--toledo-green, #008b44);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--toledo-green, #008b44);
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

/* ===== HEADER BUTTONS ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-login {
    background: none;
    border: 2px solid var(--toledo-green, #008b44);
    color: var(--toledo-green, #008b44);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-login:hover {
    background: var(--toledo-green, #008b44);
    color: white;
}

.nav .btn-phone,
a.btn-phone {
    background: var(--toledo-green, #008b44) !important;
    color: white !important;
    padding: 10px 22px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    box-shadow: 0 4px 12px rgba(71, 158, 82, 0.3) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    line-height: normal !important;
}

.btn-phone::after { display: none; }
.btn-phone svg,
a.btn-phone svg {
    color: white !important;
    fill: white !important;
}
a.btn-phone,
a.btn-phone:visited,
a.btn-phone:link {
    color: white !important;
}

.btn-phone:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(71, 158, 82, 0.4);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark, #0a1612);
    padding: 4px;
}

/* ===== SHOP DROPDOWN ===== */
.shop-dropdown-wrap { position: relative; }
.shop-dropdown-btn {
    display: flex; align-items: center; gap: 6px;
    font-weight: 700; color: var(--dark, #0a1612); padding: 6px 14px;
    cursor: pointer; background: none; border: 2px solid transparent; font-size: 15px; font-family: inherit;
    border-radius: 8px; transition: all 0.2s ease;
}
.shop-dropdown-btn:hover {
    background: #f0fdf4; border-color: rgba(0,139,68,0.15); color: var(--toledo-green, #008b44);
}
.shop-dropdown-btn svg { transition: transform 0.25s ease; }
.shop-dropdown-wrap:hover .shop-dropdown-btn svg { transform: rotate(180deg); }
.shop-dropdown-wrap:hover .shop-dropdown-btn {
    background: #f0fdf4; border-color: rgba(0,139,68,0.15); color: var(--toledo-green, #008b44);
}
.shop-mega {
    position: absolute; top: calc(100% + 8px); left: -20px;
    width: 740px; max-width: 95vw;
    background: #fff; border-radius: 16px;
    box-shadow: 0 25px 65px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    display: none; flex-direction: row; z-index: 1001;
    overflow: hidden;
    animation: megaFadeIn 0.2s ease;
}
@keyframes megaFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.shop-dropdown-wrap::after {
    content: ''; position: absolute; top: 100%; left: 0;
    width: 100%; height: 14px; display: none;
}
.shop-dropdown-wrap:hover::after { display: block; }
.shop-dropdown-wrap:hover .shop-mega { display: flex !important; }

/* Left column: category list */
.mega-categories {
    width: 260px; min-width: 260px;
    border-right: 1px solid #f0f0f0;
    padding: 12px 0;
    background: linear-gradient(180deg, #f8faf8 0%, #f2f5f2 100%);
    flex-shrink: 0;
    display: flex; flex-direction: column;
}
.mega-cat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 20px; color: #444; text-decoration: none;
    font-size: 13.5px; font-weight: 600;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    gap: 8px;
}
.mega-cat span { flex: 1; }
.mega-cat::after { display: none !important; }
.mega-cat svg { width: 14px; height: 14px; opacity: 0; transition: all 0.2s ease; flex-shrink: 0; transform: translateX(-4px); }
.mega-cat:hover, .mega-cat.active {
    background: #fff; color: var(--toledo-green, #008b44);
    border-left-color: var(--toledo-green, #008b44);
    padding-left: 24px;
}
.mega-cat:hover svg, .mega-cat.active svg { opacity: 0.6; transform: translateX(0); }

/* Right column: subcategories */
.mega-subcategories {
    flex: 1; padding: 24px 28px; min-height: 420px;
    position: relative; overflow-y: auto;
    background: #fff;
}
.subcat-panel { display: none; }
.subcat-panel.active { display: block; animation: subFadeIn 0.15s ease; }
@keyframes subFadeIn { from { opacity: 0; } to { opacity: 1; } }
.subcat-panel h3 {
    font-size: 16px; font-weight: 800; color: var(--dark, #0a1612);
    margin: 0 0 16px; padding-bottom: 12px;
    border-bottom: 2px solid var(--toledo-green, #008b44);
    letter-spacing: -0.01em;
}
.subcat-panel ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.subcat-panel ul li { break-inside: avoid; }
.subcat-panel ul a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; margin: 2px 0; color: #555; font-size: 13.5px;
    font-weight: 500; text-decoration: none; border-radius: 8px;
    transition: all 0.15s ease;
}
.subcat-panel ul a::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: #d1d5db; flex-shrink: 0; transition: all 0.15s ease;
}
.subcat-panel ul a::after { display: none !important; }
.subcat-panel ul a:hover {
    color: var(--toledo-green, #008b44); background: #f0fdf4;
    padding-left: 14px;
}
.subcat-panel ul a:hover::before { background: var(--toledo-green, #008b44); transform: scale(1.3); }
.subcat-panel .view-all {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 20px; padding: 10px 18px; font-size: 13px;
    font-weight: 700; color: #fff; text-decoration: none;
    background: var(--toledo-green, #008b44); border-radius: 8px;
    transition: all 0.2s ease;
}
.subcat-panel .view-all:hover { background: #006d35; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,139,68,0.3); }
.subcat-panel .view-all::after { display: none !important; }

/* ===== NAV CART ===== */
.nav .nav-cart,
a.nav-cart,
a.nav-cart:visited,
a.nav-cart:link,
a.nav-cart:active {
    position: relative !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: #008b44 !important;
}
.nav-cart svg,
a.nav-cart svg,
a.nav-cart:visited svg,
a.nav-cart:link svg {
    color: #008b44 !important;
    fill: none !important;
    stroke: #008b44 !important;
}
.nav-cart::after { display: none !important; }
.cart-count {
    position: absolute; top: -8px; right: -8px; background: var(--toledo-green, #008b44);
    color: white; font-size: 11px; font-weight: 700; width: 18px; height: 18px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* ===== SITE SEARCH ===== */
.site-search-wrap { position: relative; }
.site-search-form { display: flex; align-items: center; background: var(--gray-100, #f3f4f6); border: 2px solid transparent; border-radius: 50px; transition: border-color 0.2s, box-shadow 0.2s; }
.site-search-form:focus-within { border-color: var(--toledo-green, #008b44); box-shadow: 0 0 0 3px rgba(71,158,82,0.15); background: #fff; }
#site-search-input { border: none; background: transparent; padding: 9px 16px; font-size: 14px; font-family: inherit; width: 200px; outline: none; color: var(--dark, #0a1612); }
#site-search-input::placeholder { color: var(--gray-300, #d1d5db); }
.site-search-btn { background: none; border: none; padding: 8px 14px 8px 0; cursor: pointer; color: var(--gray-300, #d1d5db); display: flex; align-items: center; }
.site-search-form:focus-within .site-search-btn { color: var(--toledo-green, #008b44); }
#site-search-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 420px; max-width: 95vw; max-height: 500px; overflow-y: auto; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05); z-index: 10001; }
#site-search-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.15); z-index: 999; }
.ss-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--dark, #0a1612); border-bottom: 1px solid var(--gray-100, #f3f4f6); transition: background 0.15s; cursor: pointer; min-height: 44px; }
.ss-item:hover, .ss-item.active { background: #f8faf8; }
.ss-thumb { width: 50px; height: 50px; border-radius: 6px; object-fit: contain; background: var(--gray-100, #f3f4f6); flex-shrink: 0; }
.ss-no-img { display: flex; align-items: center; justify-content: center; }
.ss-info { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.ss-info:hover .ss-name { color: var(--toledo-green, #008b44); }
.ss-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-name mark { background: rgba(71,158,82,0.2); padding: 1px 2px; border-radius: 2px; }
.ss-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12px; color: var(--gray-300, #d1d5db); }
.ss-price { font-weight: 700; color: var(--toledo-green, #008b44); }
.ss-add-cart { background: var(--toledo-green-dark, #006d35); color: #fff; border: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background 0.15s; }
.ss-add-cart:hover { background: var(--toledo-green-dark, #006d35); }
.ss-add-cart.added { background: var(--toledo-green, #008b44); }
.ss-view-all { display: block; text-align: center; padding: 14px; font-weight: 700; font-size: 14px; color: var(--toledo-green, #008b44); text-decoration: none; border-top: 1px solid var(--gray-200, #e5e7eb); }
.ss-view-all:hover { background: #f0fdf4; }
.ss-no-results { padding: 24px; text-align: center; color: var(--gray-300, #d1d5db); font-size: 14px; }
.ss-typo-hint { padding: 8px 16px; font-size: 12px; color: #666; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .shop-mega { width: 580px; }
    .mega-categories { width: 220px; min-width: 220px; }
    .subcat-panel ul { columns: 1; }
}

@media (max-width: 1024px) {
    .nav { gap: 18px; }
    #site-search-input { width: 160px; }
}

@media (max-width: 768px) {
    .nav { display: none; }
    .header-right { display: none; }
    .mobile-menu-btn { display: block; }
    .logo-img { height: 48px; }
    .shop-mega { display: none !important; }
}
