/* ============================================
   SALEHOO — Modern Header Styles
   ============================================ */

/* ---- Top Bar ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-top {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 42px;
}

.header.scrolled .header-top {
    max-height: 0;
    padding: 0;
    border: none;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 8px 24px;
}

.header-top-left,
.header-top-right {
    flex: 1;
}

.header-top-right {
    display: flex;
    justify-content: flex-end;
}

.header-top-center {
    flex: 1;
    text-align: center;
}

.announcement-text {
    color: rgba(255,255,255,0.85);
    font-weight: 400;
    letter-spacing: 0.3px;
    font-size: 12px;
}

.announcement-text i {
    margin-right: 6px;
    color: #6ec1e4;
}

.header-contact {
    display: flex;
    gap: 6px;
    align-items: center;
}

.header-contact a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-contact a:hover {
    color: #fff;
}

.header-contact a i {
    font-size: 10px;
    color: #6ec1e4;
}

.top-divider {
    width: 1px;
    height: 12px;
    background: rgba(255,255,255,0.2);
    margin: 0 8px;
}

/* ---- Auth Links ---- */
.header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-link {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
}

.auth-link:hover {
    color: #fff;
}

.auth-link i {
    font-size: 11px;
}

.auth-link.register {
    background: linear-gradient(135deg, #e41e31 0%, #ff4757 100%);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(228, 30, 49, 0.3);
}

.auth-link.register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(228, 30, 49, 0.4);
    color: #fff;
}

/* ---- Main Header ---- */
.header-main {
    background: #fff;
    padding: 0;
    box-shadow: 0 1px 20px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled .header-main {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 24px;
    gap: 32px;
}

/* ---- Logo ---- */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.85;
}

.logo img {
    height: 44px;
    width: auto;
    max-width: 100%;
}

/* ---- Navigation ---- */
.nav-menu {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #2d3436;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    letter-spacing: 0.2px;
}

.nav-arrow {
    font-size: 9px;
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.nav-item.has-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-link:hover {
    color: #e41e31;
    background: rgba(228, 30, 49, 0.05);
}

.nav-link.active {
    color: #e41e31;
    background: rgba(228, 30, 49, 0.06);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2.5px;
    background: linear-gradient(135deg, #e41e31, #ff4757);
    border-radius: 2px;
}

/* ---- Dropdown ---- */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    z-index: 100;
    pointer-events: none;
    padding-top: 12px; /* invisible bridge so hover doesn't break crossing the gap */
}

.dropdown-inner {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 8px;
    overflow: hidden;
    transform: translateY(8px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.nav-item.has-dropdown:hover .dropdown-inner {
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-item i {
    font-size: 10px;
    color: #ccc;
    transition: all 0.2s ease;
    width: 14px;
    text-align: center;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(228,30,49,0.05), rgba(255,71,87,0.05));
    color: #e41e31;
    transform: translateX(2px);
}

.dropdown-item:hover i {
    color: #e41e31;
}

.dropdown-footer {
    border-top: 1px solid #f0f0f0;
    padding: 8px 14px 4px;
    margin-top: 4px;
}

.dropdown-view-all {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e41e31;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-view-all:hover {
    gap: 10px;
    color: #c41526;
}

/* ---- Search Bar ---- */
.search-form {
    flex: 1;
    max-width: 420px;
}

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

.search-icon {
    position: absolute;
    left: 16px;
    color: #aaa;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-form .search-input {
    width: 100%;
    padding: 11px 90px 11px 42px;
    border: 2px solid #eef0f2;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fb;
    color: #333;
}

.search-form .search-input::placeholder {
    color: #aaa;
    font-weight: 400;
}

.search-form .search-input:focus {
    border-color: #e41e31;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(228, 30, 49, 0.08);
    outline: none;
}

.search-form .search-input:focus ~ .search-icon {
    color: #e41e31;
}

.search-form .search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #e41e31, #ff4757);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    letter-spacing: 0.2px;
}

.search-form .search-btn:hover {
    background: linear-gradient(135deg, #c41526, #e41e31);
    box-shadow: 0 4px 12px rgba(228, 30, 49, 0.3);
}

/* ---- Header Action Buttons ---- */
.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.action-btn {
    position: relative;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.action-btn:hover {
    color: #e41e31;
    background: rgba(228, 30, 49, 0.06);
}

#search-toggle {
    display: none;
}

/* Cart Badge */
.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #e41e31, #ff4757);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 4px;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(228, 30, 49, 0.3);
}

.cart-count.hidden {
    display: none;
}

.cart-btn:hover .cart-count {
    transform: scale(1.15);
}

/* ---- Hamburger Menu ---- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #f5f5f5;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
    }

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Mobile Sidebar
   ============================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    z-index: 1999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(0,0,0,0.15);
    overflow: hidden;
}

.mobile-sidebar.open {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fff;
}

.sidebar-logo img {
    height: 36px;
    width: auto;
}

.sidebar-close {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.sidebar-close:hover {
    background: #f5f5f5;
    color: #e41e31;
}

/* Sidebar Body */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 0;
}

/* Sidebar Search */
.sidebar-search {
    padding: 0 16px 12px;
}

.sidebar-search-bar {
    display: flex;
    align-items: center;
    background: #f5f6f8;
    border: 2px solid #eef0f2;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.sidebar-search-bar:focus-within {
    border-color: #e41e31;
    background: #fff;
}

.sidebar-search-bar i {
    padding: 0 0 0 14px;
    color: #aaa;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-search-bar input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #333;
    outline: none;
}

.sidebar-search-bar input::placeholder {
    color: #aaa;
}

.sidebar-search-bar button {
    background: linear-gradient(135deg, #e41e31, #ff4757);
    border: none;
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.sidebar-search-bar button:hover {
    background: linear-gradient(135deg, #c41526, #e41e31);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0 10px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    color: #444;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: left;
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #888;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
    background: rgba(228, 30, 49, 0.06);
    color: #e41e31;
}

.sidebar-nav-item:hover i,
.sidebar-nav-item.active i {
    color: #e41e31;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: linear-gradient(180deg, #e41e31, #ff4757);
    border-radius: 0 3px 3px 0;
}

/* Sidebar Badge */
.sidebar-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #e41e31, #ff4757);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(228, 30, 49, 0.25);
}

/* Sidebar Accordion */
.sidebar-accordion-arrow {
    margin-left: auto;
    font-size: 11px;
    color: #bbb;
    transition: transform 0.3s ease;
}

.sidebar-accordion.open .sidebar-accordion-arrow {
    transform: rotate(180deg);
    color: #e41e31;
}

.sidebar-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-accordion.open .sidebar-accordion-body {
    max-height: 500px;
}

.sidebar-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 50px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-sub-item i {
    font-size: 10px;
    color: #ccc;
    width: 14px;
    text-align: center;
    transition: color 0.2s ease;
}

.sidebar-sub-item:hover {
    background: rgba(228, 30, 49, 0.04);
    color: #e41e31;
    padding-left: 54px;
}

.sidebar-sub-item:hover i {
    color: #e41e31;
}

.sidebar-view-all {
    color: #e41e31;
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
    border-top: 1px solid #f5f5f5;
    padding-top: 10px;
}

.sidebar-view-all:hover {
    background: rgba(228, 30, 49, 0.06);
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 12px 16px;
}

/* Sidebar Section */
.sidebar-section {
    padding: 0 10px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 16px 8px;
    margin: 0;
}

.sidebar-nav-item.sidebar-highlight {
    background: linear-gradient(135deg, rgba(228, 30, 49, 0.08), rgba(255, 71, 87, 0.06));
    color: #e41e31;
}

.sidebar-nav-item.sidebar-highlight i {
    color: #e41e31;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid #f0f0f0;
    padding: 14px 20px;
    flex-shrink: 0;
    background: #fafafa;
}

.sidebar-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-contact a {
    color: #777;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.sidebar-contact a:hover {
    color: #e41e31;
}

.sidebar-contact a i {
    font-size: 12px;
    color: #e41e31;
    width: 16px;
    text-align: center;
}

/* ============================================
   Mobile Bottom Navigation
   ============================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 1000;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
    border-top: 1px solid #f0f0f0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 6px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    gap: 3px;
    letter-spacing: 0.2px;
}

.mobile-nav-item i {
    font-size: 18px;
    transition: all 0.3s ease;
}

.mobile-nav-item.active {
    color: #e41e31;
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

.mobile-cart-badge {
    position: absolute;
    top: -2px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #e41e31, #ff4757);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(228, 30, 49, 0.3);
}

/* ============================================
   Search Overlay
   ============================================ */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-overlay.active {
    display: flex;
}

.search-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-overlay-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    z-index: 1;
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-overlay-title {
    color: rgba(255,255,255,0.9);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.search-overlay-close {
    position: absolute;
    top: -60px;
    right: 0;
    color: rgba(255,255,255,0.6);
    font-size: 24px;
    cursor: pointer;
    border: none;
    background: rgba(255,255,255,0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-overlay-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    transform: rotate(90deg);
}

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

.search-overlay-form .search-bar {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.search-overlay-input {
    width: 100%;
    padding: 18px 60px 18px 50px !important;
    border: 2px solid rgba(255,255,255,0.15) !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    font-family: 'Inter', sans-serif;
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    box-sizing: border-box;
    display: block;
    transition: all 0.3s ease;
    color: #333;
}

.search-overlay-input:focus {
    border-color: #e41e31 !important;
    background: #fff !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 0 4px rgba(228,30,49,0.15) !important;
    outline: none;
}

.search-overlay-form .search-icon {
    left: 18px;
    color: #999;
    font-size: 16px;
}

.search-overlay-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #e41e31, #ff4757) !important;
    border: none;
    color: #fff !important;
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 12px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.search-overlay-btn:hover {
    background: linear-gradient(135deg, #c41526, #e41e31) !important;
    box-shadow: 0 4px 12px rgba(228, 30, 49, 0.3);
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Large screens */
@media (max-width: 1200px) {
    .search-form {
        max-width: 320px;
    }

    .header-content {
        gap: 20px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .header-top {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .search-form {
        display: none;
    }

    #search-toggle {
        display: flex;
    }

    .header-content {
        padding: 12px 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }

    .header-main {
        padding: 0;
    }

    .header-content {
        padding: 10px 16px;
    }

    .logo img {
        height: 36px;
    }

    .header-actions {
        gap: 2px;
    }

    .action-btn {
        padding: 8px;
        font-size: 16px;
    }

    .search-overlay-content {
        width: 92%;
        padding: 0 8px;
    }

    .search-overlay-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .search-overlay-input {
        padding: 14px 50px 14px 44px !important;
        font-size: 15px !important;
        border-radius: 12px !important;
    }

    .search-overlay-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px !important;
    }
}

/* Small phones */
@media (max-width: 576px) {
    .header-content {
        padding: 8px 12px;
    }

    .logo img {
        height: 32px;
    }

    .mobile-sidebar {
        width: 280px;
    }

    .search-overlay {
        padding-top: 12vh;
    }

    .search-overlay-close {
        top: -50px;
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}

@media (max-width: 375px) {
    .logo img {
        height: 28px;
}

    .action-btn {
        padding: 6px;
        font-size: 15px;
}
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .auth-link {
        padding: 6px 4px;
        min-height: 36px;
}

    .auth-link.register {
        padding: 6px 16px;
    }

    .mobile-nav-item {
        padding: 6px 14px;
    }

    .action-btn {
        min-width: 40px;
    min-height: 40px;
    }
}

/* ============================================
   Ensure search overlay always works
   ============================================ */
.search-overlay.active {
    display: flex !important;
}

.search-overlay.active .search-overlay-content {
    display: block !important;
}

.search-overlay.active .search-overlay-form {
    display: block !important;
}

.search-overlay.active .search-bar {
    display: flex !important;
}

.search-overlay.active .search-input,
.search-overlay.active .search-overlay-input {
    display: block !important;
    }
    
.search-overlay.active .search-btn,
.search-overlay.active .search-overlay-btn {
    display: flex !important;
    }
    
/* ============================================
   Main content spacing for fixed header
   ============================================ */
.main-content {
    padding-top: 115px; /* top bar (~42px) + main header (~73px) */
    min-height: calc(100vh - 115px);
    }

@media (max-width: 992px) {
    .main-content {
        padding-top: 72px; /* top bar hidden, only main header */
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 62px;
        padding-bottom: 70px; /* space for mobile bottom nav */
    }
}
