/* ========================================
   HEADER - 2 ROW CLEAN STRUCTURE
   ======================================== */

.header_area {
    /* Dark bar — matches utility / action strip; pairs with brand red #d32f2f */
    --header-bg: #131318;
    --header-bg-panel: #252530;
    --header-text: #eaeaef;
    --header-text-soft: #b9bcc8;
    --header-border: rgba(255, 255, 255, 0.1);
    --header-search-well: rgba(255, 255, 255, 0.08);
    --header-nav-hover-bg: rgba(211, 47, 47, 0.28);
    --header-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);

    width: 100%;
    position: relative;
    z-index: 999;
    background-color: var(--header-bg);
    box-shadow: var(--header-shadow);
    color: var(--header-text);
}

/* ========================================
   ROW 1: TOP INFO BAR (3 SECTIONS)
   ======================================== */
/* Side bars share space equally; tagline is viewport-centered (not tied to column widths) */
.header-row-1 {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 100%;
    font-size: 13px;
    min-height: 46px;
    margin-bottom: 0;
}

/* Keep About/Contact only in header row 1 (top info bar).
   Many pages include these links in the row-2 nav; hide them there for consistency. */
.header-row-2 .nav-menu > .nav-item > a[href$="about.html"],
.header-row-2 .nav-menu > .nav-item > a[href$="/about.html"],
.header-row-2 .nav-menu > .nav-item > a[href$="contact.html"],
.header-row-2 .nav-menu > .nav-item > a[href$="/contact.html"] {
    display: none !important;
}

/* Section 1: Red Background - Contact Links */
.header-section-1 {
    position:absolute;
    left: 0;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
    background: #d32f2f;
    min-width: 0;
}

.header-section-1 a {
    color: #fff;
    text-decoration: none;
    font-weight: 400;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.header-section-1 a:hover {
    opacity: 0.85;
}

/* Section 2: Tagline — centered in viewport, sits above side bars */
.header-section-2 {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 20px;
    max-width: min(calc(100vw - 32px), 42rem);
    width: max-content;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
}

.tagline-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    max-width: 100%;
    pointer-events: auto;
    color: var(--header-text);
}

/* Section 3: Dark Background - Compare/Currency/Language */
.header-section-3 {
    position:absolute;
    right: 0;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 5% 100%);
    background: #b71c1c;
    min-width: 0;
}

.header-section-3 a,
.header-section-3 span {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.header-section-3 a:hover {
    opacity: 0.85;
}

.header-section-3 strong {
    color: var(--header-text);
    font-weight: 600;
}

.header-section-3 .divider {
    margin: 0 8px;
    opacity: 0.35;
}

/* ========================================
   ROW 2: MAIN NAVIGATION & LOGO & META
   ======================================== */
.header-row-2 {
    display: flex;
    align-items: center;
    padding: 0px 30px;
    gap: 12px;
    min-width: 0;
}

/* Desktop: 3-column grid — logo + search stay geometrically centered */
@media (min-width: 992px) {
    .header-row-2 {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        justify-items: stretch;
        column-gap: clamp(12px, 2vw, 24px);
    }
}

/* ========================================
   SECTION 1: NAVIGATION MENU
   ======================================== */
.header-nav-section {
    display: flex;
    align-items: center;
    min-width: 0;
}

@media (min-width: 992px) {
    .header-nav-section {
        grid-column: 1;
        justify-self: start;
        width: 100%;
        max-width: 100%;
    }
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10000;
    background: none;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
    height: 18px;
    justify-content: space-between;
    position: relative;
}

.toggle-icon span {
    width: 100%;
    height: 2px;
    background: var(--header-text);
    border-radius: 1px;
    transition: all 0.3s ease;
    display: block;
    transform-origin: center;
}

/* Hamburger Animation */
.toggle-icon.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.toggle-icon.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.toggle-icon.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.main-nav {
    width: 100%;
    min-width: 0;
}

/* Desktop: responsive link grid — wide = one row, narrow = more rows */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 992px) {
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        align-content: center;
        gap: 8px clamp(8px, 0.9vw, 14px);
        max-width: 100%;
        min-width: 0;
    }

    /* Don’t squeeze labels — wrap to the next row inside column 1 instead of overlapping logo/search */
    .nav-menu > .nav-item {
        flex-shrink: 0;
    }

    /* Row 1 already shows About / Contacts on desktop; keep these only in the slide-out menu */
    .nav-menu > .nav-item.mobile-menu-only {
        display: none !important;
    }
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--header-text-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-block;
    padding: 4px 2px;
    line-height: 1.3;
    transition: color 0.2s ease, background-color 0.2s ease;
}

@media (min-width: 992px) {
    .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(13px, 1.05vw, 15px);
        font-weight: 700;
        letter-spacing: 0.03em;
        padding: 11px 14px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .nav-link:hover {
        color: var(--header-text);
        background: var(--header-nav-hover-bg);
    }
}

@media (max-width: 991px) {
    .nav-link:hover {
        color: #d32f2f;
    }
}

@media (min-width: 992px) {
    .main-nav .nav-link:focus-visible {
        outline: 2px solid #d32f2f;
        outline-offset: 2px;
        border-radius: 2px;
    }
}

/* Dropdown Menu */
.nav-item.has-dropdown {
    position: relative;
}

/* Hide mobile call item on desktop */
.mobile-call-item {
    display: none;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    min-width: 230px;
    display: none;
    flex-direction: column;
    margin-top: 0;
    padding: 10px 0;
    border-radius: 4px;
    z-index: 1000;
    list-style: none;
}

@media (min-width: 992px) {
    .nav-dropdown::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 10px;
    }
}

.nav-item.has-dropdown:hover .nav-dropdown {
    display: flex;
}

.nav-dropdown li {
    width: 100%;
}

.nav-dropdown a {
    padding: 12px 20px;
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown a:hover {
    background: #f5f5f5;
    color: #b71c1c;
}

/* ========================================
   SECTION 2: LOGO & SEARCH
   ======================================== */
.header-logo-section {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
}

@media (min-width: 992px) {
    .header-logo-section {
        grid-column: 2;
        justify-self: center;
        width: auto;
        max-width: min(520px, 92vw);
        margin-inline: auto;
    }
}

.site-logo {
    display: block;
}

.site-logo img {
    max-height: 60px;
    width: auto;
}

.fourm-section {
    min-width: 0;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
}

@media (min-width: 992px) {
    .fourm-section {
        min-width: 350px;
        max-width: 500px;
        width: 100%;
    }
}

.header-search-form {
    display: flex;
    width: 95%;
    max-width: 500px;
    margin: 5px auto;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    color: #1a1a1f;
}

.search-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.search-input::placeholder {
    color: #6b6b76;
}

.search-btn {
    background: #fff;
    border: none;
    padding: 12px 25px;
    color: #b71c1c;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    background: #b71c1c;
    color: white;
}

.search-btn i {
    font-size: 16px;
}

/* ========================================
   SECTION 3: REVIEW, ACCOUNT, CART
   ======================================== */
.header-actions-section {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    min-width: min-content;
}

@media (min-width: 992px) {
    .header-actions-section {
        grid-column: 3;
        justify-self: end;
    }
}

.action-item {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    color: var(--header-text-soft);
    text-decoration: none;
    transition: color 0.2s;
}

.action-item:hover {
    color: var(--header-text);
}

/* Review Item */
.review-item .review-img {
    max-height: 40px;
    width: auto;
}

/* Account Item */
.account-item i {
    font-size: 40px;
}

.fa-user{
    size: 20px;
}

.action-text {
    font-size: 20px;
    font-weight: 500;
}

/* Cart Item */
.cart-item {
    position: relative;
}

.cart-item i {
    font-size: 30px;
}

.cart-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cart-total {
    font-size: 16px;
    color: var(--header-text);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d32f2f;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid var(--header-bg);
}

/* Call CTA — readable on dark bar */
.header_area .hero-btn.hero-btn-secondary {
    background: transparent;
    color: var(--header-text);
    border: 2px solid rgba(255, 255, 255, 0.45);
}

.header_area .hero-btn.hero-btn-secondary:hover {
    background: #d32f2f !important;
    color: #fff !important;
    border-color: #d32f2f !important;
}

/* ========================================
   ULTRA SIMPLE MOBILE MENU - GUARANTEED TO WORK
   ======================================== */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 10px;
        z-index: 10001;
    }
    
    /* Hide desktop navigation */
    .nav-menu {
        display: none !important;
    }
    
    /* Slide-in panel: left is NOT !important so .is-open can override without inline styles */
    .main-nav {
        position: fixed !important;
        top: 0 !important;
        left: -300px;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        background: #fff !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3) !important;
        transition: left 0.3s ease !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
        padding-top: 20px !important;
        display: block !important;
    }

    .main-nav.is-open {
        left: 0 !important;
    }
    
    /* Show menu when opened */
    .main-nav .nav-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-top: 50px !important;
        list-style: none !important;
        width: 100% !important;
    }
    
    .nav-item {
        width: 100% !important;
        border-bottom: 1px solid #eee !important;
        display: block !important;
    }
    
    .nav-link {
        display: block !important;
        padding: 15px 20px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .nav-link:hover {
        background: #f5f5f5 !important;
        color: #d32f2f !important;
    }
    
    /* Dropdown Menus (accordion on mobile) */
    .nav-item.has-dropdown .nav-dropdown {
        display: none !important;
        background: #f8f8f8 !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        width: 100% !important;
        position: static !important;
        box-shadow: none !important;
    }

    .nav-item.has-dropdown.is-expanded .nav-dropdown {
        display: block !important;
    }
    
    .nav-dropdown li {
        border-bottom: 1px solid #e0e0e0 !important;
        width: 100% !important;
    }
    
    .nav-dropdown a {
        padding: 12px 20px 12px 40px !important;
        font-size: 14px !important;
        color: #666 !important;
        display: block !important;
        text-decoration: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .nav-dropdown a:hover {
        background: #e8e8e8 !important;
        color: #d32f2f !important;
    }
    
    /* Mobile Call Button */
    .mobile-call-item {
        display: block !important;
        background: #d32f2f !important;
        margin-top: 20px !important;
        border: none !important;
        width: 100% !important;
    }
    
    .mobile-call-item .nav-link {
        background: #d32f2f !important;
        color: #fff !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        justify-content: center !important;
    }
    
    .mobile-call-item .nav-link:hover {
        background: #b71c1c !important;
    }
    
    body.menu-open {
        overflow: hidden !important;
    }
}

/* Backdrop: real element so clicks reliably close the menu */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-backdrop.is-active {
    display: block;
}

@media (min-width: 992px) {
    .mobile-menu-backdrop {
        display: none !important;
    }
}

/* Hamburger Icon */
.toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

.toggle-icon span {
    width: 100%;
    height: 2px;
    background: var(--header-text);
    border-radius: 1px;
    transition: all 0.3s ease;
    display: block;
}

/* Hamburger Animation */
.mobile-menu-toggle.active .toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .toggle-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Small / mid desktop (992px–1499px): prevent row-2 overflow, fluid type */
@media (min-width: 992px) and (max-width: 1499px) {
    .header-row-1 {
        font-size: 12px;
    }

    .header-section-1 {
        padding: 10px clamp(12px, 1.8vw, 24px);
        gap: clamp(8px, 1.2vw, 16px);
    }

    .header-section-2 {
        padding: 10px 12px;
    }

    .header-section-3 {
        padding: 10px clamp(12px, 1.8vw, 24px);
        gap: 6px;
    }

    .tagline-text {
        font-size: clamp(9px, 0.85vw, 12px);
        letter-spacing: 0.5px;
    }

    .header-row-2 {
        padding: 6px clamp(12px, 2vw, 24px);
        gap: clamp(6px, 1vw, 14px);
        min-width: 0;
    }

    .header-nav-section,
    .header-logo-section,
    .header-actions-section {
        min-width: 0;
    }

    .nav-menu {
        gap: clamp(8px, 1vw, 14px) clamp(8px, 1.1vw, 16px);
    }

    .nav-link {
        font-size: clamp(12px, 1.05vw, 14px);
        font-weight: 700;
    }

    .header-search-form {
        max-width: 100%;
        width: 100%;
    }

    .search-input {
        padding: 10px clamp(12px, 1.5vw, 20px);
        font-size: 13px;
    }

    .search-btn {
        padding: 10px clamp(16px, 2vw, 24px);
        font-size: 13px;
    }

    .site-logo img {
        max-height: clamp(44px, 4.5vw, 58px);
    }

    .action-text {
        font-size: clamp(14px, 1.35vw, 20px);
    }

    .cart-total {
        font-size: clamp(14px, 1.5vw, 22px);
    }

    .account-item i {
        font-size: clamp(26px, 2.8vw, 40px);
    }

    .cart-item i {
        font-size: clamp(24px, 2.6vw, 32px);
    }

    .review-item .review-img {
        max-height: clamp(32px, 3.2vw, 40px);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .nav-menu {
        column-gap: clamp(6px, 0.85vw, 12px);
        row-gap: 8px;
    }
}

/* 992–1200px: slightly tighter header */
@media (max-width: 1200px) and (min-width: 992px) {
    /* .header-row-2 {
        padding: 12px clamp(14px, 2vw, 20px);
    } */

    .header-actions-section {
        gap: clamp(14px, 2vw, 20px);
    }
}

/* Mobile Landscape */
@media (max-width: 991px) {
    .header-row-1 {
        display: none; /* Hide top bar completely on mobile */
    }
    
    .header-row-2 {
        padding: 15px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .header-nav-section {
        flex: none;
        width: auto;
    }
    
    .header-logo-section {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 0 8px;
        min-width: 0;
    }
    
    .header-logo-section .site-logo {
        flex-shrink: 0;
    }
    
    .site-logo img {
        max-height: 40px;
    }
    
    .fourm-section {
        display: block;
        flex: 1;
        min-width: 0;
        margin: 0;
        background: var(--header-search-well);
        border: 1px solid var(--header-border);
        clip-path: none;
        border-radius: 4px;
    }
    
    .header-logo-section .header-search-form {
        max-width: none;
        width: 100%;
        margin: 0;
        clip-path: none;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .header-actions-section {
        flex: none;
        gap: 16px;
    }
    
    .hero-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .action-item i {
        font-size: 25px;
    }
    
    .cart-total {
        font-size: 14px;
    }
}

/* Mobile Portrait */
@media (max-width: 767px) {
    /* Hide top row completely on mobile portrait */
    .header-row-1 {
        display: none !important; /* Force hide with !important */
    }
    
    /* One row: menu | logo + search | actions */
    .header-row-2 {
        padding: 12px 15px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: auto;
        gap: 10px;
        align-items: center;
    }
    
    .header-nav-section {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }
    
    .header-logo-section {
        grid-column: 2;
        grid-row: 1;
        justify-self: stretch;
        margin: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        min-width: 0;
    }
    
    .header-logo-section .site-logo {
        flex-shrink: 0;
    }
    
    .header-actions-section {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        gap: 8px;
        display: flex;
        align-items: center;
    }
    
    /* Show call button on mobile portrait */
    .hero-btn {
        display: inline-flex;
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .fourm-section {
        display: block;
        flex: 1;
        min-width: 0;
        width: auto;
        margin: 0;
        background: var(--header-search-well);
        border: 1px solid var(--header-border);
        clip-path: none;
        border-radius: 4px;
    }
    
    .header-logo-section .header-search-form {
        max-width: none;
        width: 100%;
        margin: 0;
        clip-path: none;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .site-logo img {
        max-height: 35px;
    }
    
    .action-item i {
        font-size: 18px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-row-2 {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .site-logo img {
        max-height: 30px;
    }
    
    .header-actions-section {
        gap: 5px;
    }
    
    .action-item i {
        font-size: 16px;
    }
    
    .cart-total {
        font-size: 12px;
    }
    
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
}

/* ========================================
   STICKY HEADER
   ======================================== */
.header_area.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    animation: slideDown 0.3s ease;
}

.header_area.sticky .header-row-1 {
    display: none;
}

/* Sticky state: keep nav + search + actions, hide only logo image */
.header_area.sticky .header-logo-section .site-logo {
    display: none;
}

.header_area.sticky .header-logo-section {
    gap: 0;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}
