/* Navigation Styles */
.nav-bar {
    background: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #eaeaea;
}

.nav-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    max-width: 600px;
}

.nav-logo {
    height: 80px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 550;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.4px;
    text-transform: capitalize;
    font-size: 1.05rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #4a90e2;
    transition: width 0.3s ease;
    opacity: 0.8;
}

.nav-link:hover {
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.08);
    transform: translateY(-2px);
    font-weight: 600;
}

.nav-link:hover::after {
    width: 40%;
}

.nav-link.active {
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.12);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2.5px;
    background: #4a90e2;
    border-radius: 3px;
    transition: width 0.3s ease;
    opacity: 1;
}

.nav-link.active:hover::before {
    width: 70%;
}

/* Auth Section in Nav */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
    padding-left: 2rem;
    border-left: 1px solid #eaeaea;
}

.user-name {
    color: #2c3e50;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    background: rgba(74, 144, 226, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name:hover {
    background: rgba(74, 144, 226, 0.15);
    transform: translateY(-2px);
}

.user-name::before {
    content: '👤';
    font-size: 1.2rem;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-icon {
    font-size: 1.2rem;
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    padding-left: 1.5rem;
}

/* Mobile Login Form */
.mobile-login-form {
    display: none;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    width: 100%;
}

.mobile-login-form h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.mobile-login-form .login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-login-form input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.mobile-login-form .login-button {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-login-form .login-button:hover {
    background: var(--primary-dark);
}

.mobile-login-form .register-link {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}

.mobile-login-form .register-link:hover {
    color: var(--primary-color);
}

/* Mobile Navigation Controls */
.mobile-nav-controls {
    display: none;
    align-items: center;
    gap: 1rem;
    order: -1;
}

.mobile-login-btn {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    display: inline-block;
}

.mobile-greeting {
    color: #2c3e50;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.mobile-login-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.mobile-login-btn[href="/profile.html"] {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 999;
    cursor: pointer;
    margin-right: 1rem;
    background: none;
    border: none;
    padding: 0;
    outline: none;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.menu-toggle:active {
    background-color: rgba(74, 144, 226, 0.2);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #2c3e50;
    position: absolute;
    left: 50%;
    top: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-origin: center;
}

.menu-toggle span:first-child {
    transform: translate(-50%, -6px);
}

.menu-toggle span:nth-child(2) {
    transform: translate(-50%, 0px);
}

.menu-toggle span:last-child {
    transform: translate(-50%, 6px);
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 8px; }
.menu-toggle span:nth-child(3) { top: 16px; }

.menu-toggle.active span {
    background-color: #4a90e2;
}

.menu-toggle.active span:first-child {
    transform: translate(-50%, 0) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translate(-50%, 0);
}

.menu-toggle.active span:last-child {
    transform: translate(-50%, 0) rotate(-45deg);
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 997;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-bar {
        padding: 0.8rem;
        position: relative;
        justify-content: center;
    }

    .nav-brand {
        font-size: 1.3rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        padding: 2rem;
        padding-top: 6rem;
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        transform: translateX(-100%);
        z-index: 998;
    }

    .nav-section.products {
        margin-top: 2rem;
        width: 100%;
    }

    .nav-section.products .nav-link {
        width: 100%;
        padding: 1rem 1.5rem;
        margin: 0.5rem 0;
        border-radius: 12px;
        font-size: 1.1rem;
        font-weight: 500;
        color: #1a1a1a;
        background: #f5f5f5;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-section.products .nav-link:after {
        content: '→';
        opacity: 0;
        transform: translateX(-10px);
        transition: all 0.3s ease;
    }

    .nav-section.products .nav-link:hover:after,
    .nav-section.products .nav-link.active:after {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-section.products .nav-link:hover,
    .nav-section.products .nav-link.active {
        background: #4a90e2;
        color: white;
    }

    .mobile-auth {
        padding: 1rem 0;
        border-bottom: 1px solid #eaeaea;
        margin-bottom: 1rem;
    }

    .mobile-auth .nav-link {
        font-size: 1.1rem;
        color: #1a1a1a;
        padding: 1rem 0;
        margin: 0.25rem 0;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .mobile-auth .nav-link:before {
        content: '';
        width: 24px;
        height: 24px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .menu-profile-btn:before { content: '👤'; }
    .menu-orders-btn:before { content: '📦'; }
    .menu-logout-btn:before { content: '🚪'; }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-link {
        padding: 0.8rem;
    }

    .container {
        padding: 0.5rem;
        margin: 1rem auto;
    }

    .mobile-nav-controls {
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }

    .mobile-greeting {
        font-size: 0.9rem;
        padding-right: 0.5rem;
    }

    .menu-toggle {
        display: flex;
    }

    .mobile-login-form {
        display: none;
    }

    /* Move auth section to top */
    .auth-section {
        margin: 0;
        padding: 0;
        border: none;
        width: 100%;
        order: -1; /* This moves it to the top */
    }

    .mobile-auth {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0; /* Remove top margin since it's first */
        margin-bottom: 1rem; /* Add bottom margin to separate from products */
    }

    /* Products section comes after auth */
    .nav-section.products {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem; /* Add spacing after auth section */
        padding-top: 1rem; /* Add padding */
        border-top: 1px solid rgba(255, 255, 255, 0.1); /* Add separator */
    }

    .menu-login-btn, 
    .menu-profile-btn, 
    .menu-orders-btn, 
    .menu-logout-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        padding: 0.8rem 1rem;
        border-radius: var(--radius-md);
        transition: all 0.3s ease;
    }

    .menu-login-btn:hover, 
    .menu-profile-btn:hover, 
    .menu-orders-btn:hover, 
    .menu-logout-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* Hide desktop auth elements on mobile */
    .desktop-auth {
        display: none;
    }

    .nav-brand {
        max-width: 160px;
    }
    .nav-logo {
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .nav-brand {
        max-width: 120px;
    }
    .nav-logo {
        max-width: 120px;
    }
}

.mobile-auth {
    display: none;  /* Hide by default on desktop */
}

.menu-login-btn, 
.menu-profile-btn, 
.menu-orders-btn, 
.menu-logout-btn {
    display: none;  /* Hide by default on desktop */
}

/* Show mobile menu items only on mobile */
@media (max-width: 768px) {
    .mobile-auth {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .menu-login-btn, 
    .menu-profile-btn, 
    .menu-orders-btn, 
    .menu-logout-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        padding: 0.8rem 1rem;
        border-radius: var(--radius-md);
        transition: all 0.3s ease;
    }

    .menu-login-btn:hover, 
    .menu-profile-btn:hover, 
    .menu-orders-btn:hover, 
    .menu-logout-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* Hide desktop auth elements on mobile */
    .desktop-auth {
        display: none;
    }
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 4rem 2rem 1rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

/* Footer Contact Bar */
.footer-contact-bar {
    background: rgba(59, 89, 219, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    margin: -2rem auto 3rem;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    background: rgba(59, 89, 219, 0.15);
}

.contact-item:hover .contact-icon {
    background: rgba(59, 89, 219, 0.3);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(31, 38, 135, 0.25);
}

.contact-icon {
    font-size: 1.8rem;
    width: 60px;
    height: 60px;
    background: rgba(59, 89, 219, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(31, 38, 135, 0.2);
    color: #fff;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.contact-info {
    flex: 1;
}

.contact-info h4 {
    color: white;
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.contact-info p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Social Media Section */
.social-media {
    margin-top: 2rem;
}

.social-media h3 {
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: white;
    transform: translateY(-3px);
}

.social-icon.facebook:hover { color: #1877f2; }
.social-icon.twitter:hover { color: #1da1f2; }
.social-icon.instagram:hover { color: #e4405f; }
.social-icon.linkedin:hover { color: #0077b5; }

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.footer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
}

.footer-section h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-payment-icons {
    margin-top: 1rem;
}

.footer-payment-icons img {
    max-width: 200px;
    height: auto;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer {
        padding: 3rem 1rem 1rem;
    }

    .footer-contact-bar {
        grid-template-columns: 1fr;
        margin: -1rem 1rem 2rem;
        padding: 1.5rem;
    }

    .contact-item {
        padding: 0.8rem;
    }

    .contact-icon {
        padding: 0.8rem;
        font-size: 1.2rem;
    }

    .contact-info h4 {
        font-size: 1rem;
    }

    .contact-info p {
        font-size: 0.9rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1rem;
    }

    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .social-icons {
        justify-content: center;
    }

    .social-icon {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: center;
    }

    .footer-payment-icons {
        display: flex;
        justify-content: center;
    }
}

/* Scroll Margin for Anchor Links */
[id] {
    scroll-margin-top: 120px; /* This adds space above anchor targets to account for sticky nav */
}
