/* =========================================
PRIMARY HEADER
========================================= */

.primary-header {
    background-color: #253141;
    color: #fff;
    box-shadow: 0 1px 2px rgba(237, 198, 198, 0.1);
}

/* =========================================
HEADER LAYOUT
========================================= */

.header-right {
    display: flex;
    flex-direction: column;
    padding: 0 0 0 12rem
}

/* =========================================
LOGO COLUMN
========================================= */

.logo-wrapper {
    grid-column: 1;
    grid-row: 1 / span 2;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: #253141;

    padding: 3px;
    overflow: hidden;
}

.logo-wrapper a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.logo-img {
    width: 100%;
    height: auto;
    max-width: 110px;
    object-fit: contain;
}

/* =========================================
TOP ROW
========================================= */

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 64px;
    gap: 16px;

    padding: 0 1rem;

    background-color: #253141;
}

/* =========================================
SEARCH
========================================= */

.search-container {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

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

/* =========================================
ACTIONS
========================================= */

.actions {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-shrink: 0;
}

/* =========================================
CART
========================================= */

.cart-link {
    position: relative;
    font-size: 1.25rem;
}

.cart-badge {
    position: absolute;

    top: -8px;
    right: -8px;

    width: 20px;
    height: 20px;

    background-color: #ef4444;
    color: #fff;

    font-size: 0.75rem;
    font-weight: bold;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
AUTH LINKS
========================================= */

.auth-links-desktop {
    display: flex;
    align-items: center;
    gap: 15px;

    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
}

.auth-link {
    color: inherit;
    text-decoration: none;
}

/* =========================================
ACCOUNT DROPDOWN
========================================= */
.header-layout {
    display: grid;
    grid-template-columns: 140px 1fr;
    width: 100%;
}

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

.nav-logout-form {
    margin: 0;
    display: flex;
    align-items: center;
}

.nav-button,
.account-toggle {
    display: flex;
    align-items: center;
}

.nav-right a,
.nav-right button {
    line-height: 1;
}

.account-toggle {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #fff;

    background: none;
    border: none;

    cursor: pointer;
}

.account-dropdown {
    position: relative;
}

.account-dropdown-menu {
    position: absolute;

    right: 0;
    top: 100%;

    display: none;
    flex-direction: column;

    min-width: 220px;

    background-color: #111827;
    border-radius: 8px;

    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);

    z-index: 1000;

    padding: 8px 0;
}

.account-dropdown-menu {
    top: calc(100% + 6px);
}

.account-dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 16px;

    color: #e5e7eb;
    text-decoration: none;

    font-size: 0.9rem;

    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(107, 114, 128, 0.5);
    color: #fff;
}

.dropdown-divider {
    height: 1px;
    margin: 6px 0;

    background-color: rgba(156, 163, 175, 0.4);
}

/* =========================================
SECONDARY NAVIGATION
========================================= */

.secondary-nav {
    background-color: #253141;

    padding: 5px 0 0 3.7rem;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-links {
    display: flex;
    align-items: center;

    gap: 16px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.secondary-nav .nav-links li {
    display: inline-block;
}

.secondary-nav .nav-links a {
    display: block;

    padding: 8px 14px;

    color: #ffffff;
    text-decoration: none;

    font-size: 0.95rem;
    font-weight: 500;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.secondary-nav .nav-links a:hover {
    color: #f97316;
    background-color: rgba(249, 115, 22, 0.1);

    border-radius: 6px;
}

/* =========================================
MOBILE BEHAVIOR
========================================= */

.mobile-menu-button {
    display: none;
    font-size: 1.25rem;
}

@media (max-width: 767px) {

    .mobile-menu-button {
        display: block;
    }

    header.primary-header.mobile-active .account-dropdown-menu {
        display: flex;
    }

}