/* ========================================
   NAVBAR - DUAL ROW LAYOUT
   ======================================== */

/* Reset and rebuild navbar */
.navbar {
    display: block !important;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body {
    padding-top: 108px;
}

body:has(.announcement-bar) {
    padding-top: 148px;
}

/* Top Bar */
.navbar-top {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.navbar-top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    min-height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    font-weight: 700;
    font-size: 24px;
    text-decoration: none;
    flex-shrink: 0;
    order: 1;
    /* Move logo back to left side */
    margin-left: 30px;
}

.nav-logo-icon {
    width: 150px;
    height: 40px;
    display: block;
}

.nav-logo-text {
    font-family: 'Poppins', sans-serif;
}

/* Search */
.nav-search {
    flex: 1;
    max-width: 700px;
    /* Increased size */
    margin: 0 auto;
    position: absolute;
    left: 38%;
    transform: translateX(-50%);
    order: 2;
    /* Keep search centered */
}

.nav-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
    height: 42px;
}

.nav-search-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: none;
    border: none;
    color: #111827;
    font-size: 15px;
    cursor: pointer;
}

.nav-search-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.nav-search-input {
    flex: 1;
    border: none;
    padding: 0 12px;
    font-size: 14px;
    color: #1f2937;
    outline: none;
    height: 100%;
    background: #ffffff;
}

.nav-search-input::placeholder {
    color: #9ca3af;
}

.nav-search-btn {
    background: #4a2c2a;
    color: #ffffff;
    padding: 0 28px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.3s ease;
    height: 100%;
    text-transform: uppercase;
}

.nav-search-btn:hover {
    background: #3a2220;
}

/* Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
    order: 3;
    /* Mobile Navigation Menu */
    margin-right: 30px;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-nav-menu.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.mobile-nav-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
}

.mobile-nav-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.mobile-nav-items {
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-nav-link:hover {
    background: #f9fafb;
    color: #111827;
}

.mobile-nav-link.active {
    background: #eff6ff;
    color: #2563eb;
    border-right: 3px solid #2563eb;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: #6b7280;
}

.mobile-nav-link:hover i,
.mobile-nav-link.active i {
    color: currentColor;
}

.mobile-cart-badge {
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}

.nav-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    position: relative;
}

.nav-cart-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.nav-cart-text {
    font-weight: 600;
}

.nav-cart-badge {
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
}

.nav-wishlist-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    position: relative;
}

.nav-wishlist-link i {
    font-size: 20px;
}

.nav-wishlist-text {
    font-weight: 600;
}

.nav-wishlist-badge {
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.nav-user-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    text-decoration: none;
}

.nav-user-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.nav-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.nav-user-greeting {
    font-size: 13px;
    font-weight: 400;
}

.nav-user-action {
    font-size: 13px;
    font-weight: 600;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: #111827;
    border-radius: 999px;
}

/* Bottom Bar */
.navbar-bottom {
    background: #ef4444;
    border-top: 1px solid #dc2626;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
    display: block !important;
    visibility: visible !important;
}

.navbar-bottom .container {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    min-height: 48px;
}

.nav-menu {
    display: flex !important;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    visibility: visible !important;
}

.nav-menu li {
    margin: 0;
    display: list-item !important;
}

.nav-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-link:hover,
.nav-link.active {
    background: transparent;
    opacity: 0.85;
}

/* Ensure menu bar is visible on desktop */
@media (min-width: 769px) {
    .navbar-bottom {
        display: block !important;
        visibility: visible !important;
    }

    .nav-menu {
        display: flex !important;
        visibility: visible !important;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar-top-content {
        gap: 16px;
    }

    .nav-search {
        max-width: 420px;
    }
}

@media (max-width: 920px) {
    .nav-search {
        display: none;
    }

    .navbar-top-content {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 0;
    }

    body:has(.announcement-bar) {
        padding-top: 0;
    }

    .nav-toggle {
        display: flex;
        margin-left: 12px;
    }

    .nav-actions {
        gap: 16px;
    }

    .nav-cart-text {
        display: none;
    }

    .navbar-top-content {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .nav-logo {
        order: 1;
    }

    .nav-search {
        order: 2;
        display: flex !important;
        flex: 1;
        max-width: calc(100% - 200px);
        position: absolute;
        right: -8%;
        left: 49%;
        margin: 0 -95px 0 60px;
    }

    .nav-search-form {
        width: 95%;
        display: flex;
        align-items: center;
    }

    .nav-search-input {
        width: 100%;
        min-width: 0;
        font-size: 14px;
        padding: 10px 12px;
    }

    .nav-search-icon-btn {
        padding: 10px;
        flex: 0 0 auto;
    }

    .nav-search-btn {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 12px;
        letter-spacing: 0.08em;
    }

    .nav-toggle {
        order: 3;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
    }

    .nav-actions {
        display: none !important;
    }

    .navbar-bottom .container {
        justify-content: center;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ef4444;
        flex-direction: column;
        gap: 0;
        padding: 12px;
        border-bottom: 1px solid #e5e7eb;
        display: none;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    }

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

    .nav-menu .nav-link {
        width: 100%;
        justify-content: flex-start;
        color: #ffffff;
        padding: 12px 16px;
        text-transform: none;
    }

    .nav-menu .nav-link:hover,
    .nav-menu .nav-link.active {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .nav-menu.active {
        display: flex;
    }
}

@media (max-width: 480px) {
    .navbar-top-content {
        flex-wrap: wrap;
    }

    .nav-actions {
        display: none !important;
    }

    .nav-login {
        width: 100%;
        text-align: center;
    }
}

/* Mobile Navigation Toggle Button */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #374151;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: #f3f4f6;
}

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

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

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

/* Mobile Search Toggle */
.mobile-search-toggle {
    display: none;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 18px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-search-toggle:hover {
    background: #f3f4f6;
    color: #f97316;
}

.mobile-search-toggle:active {
    transform: scale(0.95);
}

/* Mobile Navigation Search */
.mobile-nav-search {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-search-form {
    width: 100%;
}

.mobile-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-search-input-container:focus-within {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.mobile-search-input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    z-index: 2;
}

.mobile-search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #374151;
    outline: none;
}

.mobile-search-input::placeholder {
    color: #9ca3af;
}

.mobile-search-submit {
    position: absolute;
    right: 8px;
    background: #f97316;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-search-submit:hover {
    background: #ea580c;
    transform: scale(1.05);
}

.mobile-search-submit:active {
    transform: scale(0.95);
}

/* Mobile Responsive Updates */
@media (max-width: 600px) {
    .mobile-search-toggle {
        display: block;
    }

    /* Mobile Search Bar for all pages */
    .mobile-search-bar {
        display: none !important;
    }

    .mobile-search-bar.show {
        display: block !important;
    }

    .search-input:focus {
        border-color: #f97316 !important;
        box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1) !important;
    }

    .nav-toggle {
        display: flex;
        order: 4;
    }

    .navbar-bottom {
        display: none !important;
    }

    .nav-search {
        display: none;
    }

    .nav-actions {
        display: flex;
        gap: 8px;
    }

    .navbar-top-content {
        justify-content: space-between;
        padding: 12px 0;
    }

    .nav-logo {
        order: 1;
        margin-left: -0;
    }
}

@media (max-width: 480px) {
    .mobile-nav-menu {
        width: 100%;
        max-width: 100%;
    }

    .nav-logo-icon {
        width: 100px;
        height: 30px;
    }
}