/* Header Styles */
.header {
    background-color: #000;
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    animation: fadeIn 0.5s ease-in-out;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    flex-shrink: 0;
    width: 220px;
    animation: slideInLeft 0.5s ease-in-out;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav {
    animation: slideInDown 0.5s ease-in-out;
}

.nav-list {
    display: flex;
    gap: 32px;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-weight: 500;
    padding: 5px 0;
    display: inline-block;
    transition: all 0.3s ease;
    color: #fff;
}

/* Enhanced hover effect */
.nav-link:hover {
    color: #fff;
    transform: translateY(-2px); /* Slight lift effect */
}

.nav-link.active {
    color: #fff;
    font-weight: 600;
}

/* Underline effect on hover */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #fff;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideInRight 0.5s ease-in-out;
}

.cart {
    position: relative;
    cursor: pointer;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.cart-icon {
    width: 24px;
    height: 24px;
    color: #fff;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e11d48;
    color: white;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

.cart-dropdown {
    position: fixed;
    right: 20px;
    top: 70px;
    width: 320px;
    background-color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 15px;
    z-index: 1001;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.cart-dropdown.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    color: white;
}

.cart-items > div {
    border-bottom: 1px solid #333;
    transition: opacity 0.3s ease;
}

.cart-items img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.empty-cart-message {
    text-align: center;
    color: #777;
    padding: 20px 0;
    font-size: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
    position: relative;
    transition: opacity 0.3s, transform 0.3s;
}

.cart-item.removing {
    opacity: 0;
    transform: translateX(20px);
}

.item-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 3px;
}

.item-details {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 14px;
    margin: 0 0 4px;
    color: #333;
}

.item-price {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.item-quantity {
    font-size: 12px;
    color: #777;
}

.item-total {
    font-weight: 600;
    font-size: 14px;
}

.remove-item {
    background: transparent;
    border: none;
    cursor: pointer;
}

.remove-item svg {
    transition: color 0.3s ease;
}

.remove-item:hover svg {
    color: #ec4899 !important;
}

.cart-actions {
    display: flex;
    gap: 5px;
    margin-top: 15px;
}

.view-cart-btn {
    flex: 3;
    font-weight: 600;
    background-color: #ec4899;  /* Pink color */
    color: white;
    padding: 8px 12px;
    text-align: center;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
}

.checkout-btn {
    flex: 3;
    font-weight: 600;
    background-color: black;
    color: white;
    padding: 8px 12px;
    text-align: center;
    border: 2px solid white;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
    transition: border-color 0.3s, color 0.3s;
}

.checkout-btn:hover {
    border-color: #ec4899;
    color: #ec4899;
}

/* Cart button flash animation */
.cart.flash .cart-icon {
    animation: cartFlash 0.5s;
}

@keyframes cartFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.login-btn {
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 5px 10px;
    color: #fff;
}

.login-btn:hover {
    color: #ff6b6b;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: white;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-icon {
    font-size: 12px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 80px;
    left: 0;
    background-color: #111;
    min-width: 220px;
    border-radius: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    padding: 10px 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
}

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

.dropdown-item {
    display: block;
    padding: 8px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
    position: relative;
}

.dropdown-item:hover {
    color: #fff;
}

/* Add underline effect for dropdown items */
.dropdown-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 20px;
    background-color: #fff;
    transition: width 0.3s ease;
}

.dropdown-item:hover::after {
    width: calc(100% - 40px); /* Account for padding */
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: #000;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        padding: 20px 0;
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 99;
        max-height: 80vh; 
        overflow-y: auto;
    }
    
    .nav.active {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
    
    .mobile-only-menu {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 16px;
        padding: 0 20px;
    }
    
    /* Mobile dropdown styles - using hover instead of click */
    .dropdown-menu {
        position: relative;
        top: auto;
        left: auto;
        background-color: #222;
        width: 100%;
        display: none;
        border-left: 2px solid #333;
        margin-top: 10px;
        padding: 0;
        max-height: none;
        overflow: visible;
        box-shadow: none;
        transition: none;
        transform: none;
    }
    
    /* Show dropdown on hover instead of click for mobile */
    .dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        padding: 10px 0;
    }
    
    .dropdown-item {
        padding-left: 20px;
        line-height: 2.5; /* Increased for better touch target size */
        white-space: normal; /* Allow text to wrap */
        font-size: 14px; /* Slightly larger font for mobile */
    }
    
    .dropdown-item:hover {
        padding-left: 20px;
    }
    
    /* Mobile underline effect adjustment */
    .dropdown-item::after {
        bottom: 5px;
        left: 20px;
    }
    
    .dropdown-item:hover::after {
        width: calc(100% - 40px);
    }
    
    /* Add arrow indicator for mobile dropdowns */
    .dropdown .dropdown-icon {
        float: right;
        margin-top: 4px;
    }
    
    .dropdown:hover .dropdown-icon {
        transform: rotate(180deg);
    }
    
    /* Hamburger menu animation */
    .mobile-menu-btn {
        display: block;
        position: relative;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-btn .bar {
        transition: all 0.3s ease;
    }
    
    .mobile-menu-btn.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    
    .mobile-menu-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
    
    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    /* Cart dropdown mobile adjustments */
    .cart-dropdown {
        right: 10px;
        top: 70px;
        width: 300px;
        max-width: calc(100vw - 20px);
    }
}

/* Mobile Profile Menu */
.mobile-only-profile {
    display: none; /* Hidden by default on all screens */
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .logo {
        width: 200px;
    }
    
    .logo-img {
        height: 36px;
    }
}

@media (min-width: 1024px) {
    
    .logo {
        width: 300px;
    }
    
    .logo-img {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 8px;
    }

    .logo {
        width: 200px;
    }
    
    .logo-img {
        height: 30px;
    }

    /* Cart dropdown adjustments for very small screens */
    .cart-dropdown {
        right: 5px;
        left: 5px;
        width: auto;
        max-width: none;
        top: 65px;
    }
}

/* User menu styles */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-menu .nav-link:hover {
    color: #ff6b6b;
}

.user-menu .fa-user-circle {
    font-size: 18px;
}

.user-profile-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-menu .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
}

/* Responsive styles for user menu */
@media (max-width: 768px) {
    /* Hide desktop user menu in header actions */
    .header-actions .user-menu {
        display: none;
    }
    
    /* Show mobile profile menu in navigation */
    .mobile-only-profile {
        display: block;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .user-menu .nav-link {
        padding: 3px 6px;
        font-size: 0.9rem;
    }
    
    .user-menu .fa-user-circle {
        font-size: 16px;
    }
    
    .user-menu .dropdown-icon,
    .user-menu .username-text {
        display: none;
    }
    
    .user-menu:hover .dropdown-menu,
    .user-menu:focus .dropdown-menu,
    .user-menu:active .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}