:root {
    --primary-red: #e63946;
    --dark-red: #9d0208;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #212529;
    --hover-red: #ff4d6d;
}

/* Top Header */
.nim-header {
    background-color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nim-header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.nim-logo-container {
    flex: 0 0 auto;
}

.nim-logo {
    height: 50px;
    transition: transform 0.3s ease;
}

.nim-logo:hover {
    transform: scale(1.05);
}

/* Desktop Menu */
.nim-desktop-menu {
    display: flex;
    align-items: center;
}

.nim-menu-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nim-menu-item {
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nim-menu-item:hover {
    color: var(--primary-red);
    background-color: rgba(230, 57, 70, 0.05);
}

.nim-dropdown-arrow {
    transition: transform 0.3s ease;
}

.nim-menu-dropdown:hover .nim-dropdown-arrow {
    transform: rotate(180deg);
}

.nim-menu-dropdown {
    position: relative;
}

.nim-dropdown-content {
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%) translateY(10px);
    background-color: var(--white);
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0.5rem;
    z-index: 1001;
    margin-top: 0.5rem;
}

.nim-menu-dropdown:hover .nim-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}

.nim-dropdown-item {
    color: var(--dark-gray);
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: right;
    white-space: nowrap;
    position: relative;
}

.nim-dropdown-item:hover {
    background-color: var(--primary-red);
    color: var(--white);
    transform: translateX(-5px);
}

/* Nested Dropdown Styles */
.nim-dropdown-item.has-submenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nim-dropdown-item.has-submenu::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.nim-dropdown-item.has-submenu:hover::after {
    transform: rotate(45deg);
}

.nim-submenu {
    position: absolute;
    top: 0;
    right: 100%;
    background-color: var(--white);
    min-width: 220px;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0.5rem;
    margin-right: 10px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) transparent;
}

/* Webkit scrollbar styling */
.nim-submenu::-webkit-scrollbar {
    width: 6px;
}

.nim-submenu::-webkit-scrollbar-track {
    background: transparent;
}

.nim-submenu::-webkit-scrollbar-thumb {
    background-color: var(--primary-red);
    border-radius: 3px;
}

.nim-submenu::-webkit-scrollbar-thumb:hover {
    background-color: var(--dark-red);
}

.nim-dropdown-item.has-submenu:hover .nim-submenu {
    opacity: 1;
    visibility: visible;
}

.nim-submenu-item {
    color: var(--dark-gray);
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: right;
    white-space: nowrap;
}

.nim-submenu-item:hover {
    background-color: var(--primary-red);
    color: var(--white);
    transform: translateX(-5px);
}

/* Mobile Menu Button */
.nim-mobile-menu-button {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.nim-menu-icon {
    width: 30px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nim-menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--dark-gray);
    transition: all 0.3s ease;
    transform-origin: left center;
}

.nim-mobile-menu-button.active .nim-menu-icon span:nth-child(1) {
    transform: rotate(45deg);
}

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

.nim-mobile-menu-button.active .nim-menu-icon span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.nim-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: none; /* Hide by default */
}

.nim-mobile-menu.active {
    right: 0;
    display: block; /* Show when active */
}

.nim-mobile-menu-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nim-mobile-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.nim-mobile-close {
    background: none;
    border: none;
    color: var(--white);
    padding: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nim-mobile-close:hover {
    transform: rotate(90deg);
}

.nim-mobile-nav {
    padding: 1.5rem;
}

.nim-mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nim-mobile-nav-item {
    color: var(--white);
    text-decoration: none;
    padding: 1rem;
    display: block;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.nim-mobile-nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(-5px);
}

.nim-mobile-dropdown-button {
    width: 100%;
    background: none;
    border: none;
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nim-mobile-dropdown-button:hover {
    background-color: rgba(255,255,255,0.1);
}

.nim-mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nim-mobile-dropdown.active .nim-mobile-dropdown-content {
    max-height: 500px;
}

.nim-mobile-dropdown-item {
    color: var(--white);
    text-decoration: none;
    padding: 0.75rem 1rem 0.75rem 2rem;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nim-mobile-dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(-5px);
}

/* Media Queries */
@media (max-width: 1024px) {
    .nim-desktop-menu {
        display: none;
    }

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

    .nim-mobile-menu {
        display: block; /* Show on mobile */
    }

    .nim-mobile-dropdown {
        width: 100%;
    }

    .nim-mobile-dropdown-button {
        width: 100%;
        background: none;
        border: none;
        color: var(--white);
        padding: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .nim-mobile-dropdown-button:hover {
        background-color: rgba(255,255,255,0.1);
    }

    .nim-mobile-dropdown-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background-color: rgba(255,255,255,0.05);
        border-radius: 8px;
        margin: 0.5rem 0;
    }

    .nim-mobile-dropdown.active .nim-mobile-dropdown-content {
        max-height: 500px;
    }

    .nim-mobile-dropdown-item {
        color: var(--white);
        text-decoration: none;
        padding: 0.75rem 1rem 0.75rem 2rem;
        display: block;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .nim-mobile-dropdown-item:hover {
        background-color: rgba(255,255,255,0.1);
        transform: translateX(-5px);
    }
}

@media (min-width: 1025px) {
    .nim-mobile-menu {
        display: none !important; /* Force hide on desktop */
    }
}

/* User Controls */
.nim-user-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nim-control-button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.nim-control-button:hover {
    color: var(--primary-red);
    background-color: rgba(230, 57, 70, 0.05);
    transform: translateY(-2px);
}

.nim-control-button svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.nim-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-red);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(230, 57, 70, 0.3);
}

/* Login Modal Fix */
.nim-auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1002;
    overflow-y: auto;
}

.nim-auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nim-auth-container {
    background: var(--white);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn 0.3s ease;
}

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

/* Mobile Bottom Navigation */
.nim-mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    display: none; /* Hide by default */
}

.nim-mobile-nav-items {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
}

/* Footer Styles */
footer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
    padding: 3rem 0;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--dark-red), var(--primary-red));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

footer .grid > div {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

footer .grid > div:nth-child(1) { animation-delay: 0.1s; }
footer .grid > div:nth-child(2) { animation-delay: 0.2s; }
footer .grid > div:nth-child(3) { animation-delay: 0.3s; }
footer .grid > div:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
footer a:hover {
    color: var(--primary-red) !important;
    transform: translateX(-5px);
}

footer button:hover {
    background: var(--dark-red) !important;
    transform: translateY(-2px);
}

#btn-back-to-top:hover {
    transform: translateY(-5px) rotate(360deg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    footer .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Bottom Bar Hover Effects */
.bottom-bar a:hover {
    color: var(--primary-red) !important;
    transform: translateY(-2px);
}

/* Auth Modal Styles */
.auth-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal {
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    position: relative;
}

.auth-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.3s ease;
}

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

.auth-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #1a1a1a;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.auth-close-btn:hover {
    background: rgba(227, 30, 36, 0.1);
    color: #e31e24;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.auth-title {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #666;
    font-size: 0.875rem;
}

.auth-content {
    position: relative;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: formFadeIn 0.3s ease;
}

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

.auth-input-group {
    margin-bottom: 1.5rem;
}

.auth-label {
    display: block;
    color: #1a1a1a;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f8f8;
}

.auth-input:focus {
    outline: none;
    border-color: #e31e24;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.auth-button {
    width: 100%;
    padding: 0.875rem;
    background: #e31e24;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-button:hover {
    background: #c41820;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.2);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #666;
}

.auth-link {
    color: #e31e24;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: #c41820;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-modal {
        margin: 0.5rem;
    }

    .auth-modal-content {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.25rem;
    }
}
