/* Main Header */
.main-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    align-items: center;
    gap: 40px;
    padding: 18px 0;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    height: 55px;
    display: block;
}

/* Navigation Menu */
.header-nav {
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 6px;
    position: relative;
}

.nav-menu a:hover {
    color: #cb0001;
    background: #fff5f5;
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid;
    cursor: pointer;
    white-space: nowrap;
}

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

/* Icon only button - more compact */
.btn-action:not(:has(span)) {
    padding: 10px 14px;
}

.btn-login {
    background: #ffffff;
    color: #2c3e50;
    border-color: #ddd;
}

.btn-login:hover {
    background: #f8f9fa;
    color: #cb0001;
    border-color: #cb0001;
}

.btn-register {
    background: #cb0001;
    color: #fff;
    border-color: #cb0001;
}

.btn-register:hover {
    background: #a00001;
    border-color: #a00001;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(203, 0, 1, 0.3);
}

/* Cart Button */
.cart-button {
    position: relative;
    background: #fff;
    color: #2c3e50;
    border-color: #e5e7eb;
    padding: 10px 14px !important;
}

.cart-button:hover {
    background: #f8f9fa;
    color: #cb0001;
    border-color: #cb0001;
    transform: translateY(-1px);
}

.cart-button i {
    font-size: 18px;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #cb0001 0%, #ff4444 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(203, 0, 1, 0.4);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.btn-logout {
    background: #ffffff;
    color: #2c3e50;
    border-color: #ddd;
}

.btn-logout:hover {
    background: #fff5f5;
    color: #dc3545;
    border-color: #dc3545;
}

/* Mobile Toggle */
.mobile-toggle {
    background: #f5f5f5;
    border: 2px solid #ddd;
    width: 46px;
    height: 46px;
    border-radius: 7px;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle:hover {
    background: #cb0001;
    color: #fff;
    border-color: #cb0001;
}

.mobile-toggle i {
    font-size: 20px;
}

/* Mobile Menu */
.mobile-menu {
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
}

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

.nav-menu-mobile li {
    margin-bottom: 5px;
}

.nav-menu-mobile .divider {
    height: 1px;
    background: #f0f0f0;
    margin: 15px 0;
}

.nav-menu-mobile a,
.nav-menu-mobile button {
    display: block;
    width: 100%;
    padding: 13px 16px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 7px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.nav-menu-mobile a:hover,
.nav-menu-mobile button:hover {
    color: #cb0001;
    background: #f8f9fa;
}

.nav-menu-mobile i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-menu-mobile form {
    margin: 0;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-toggle {
    background: #f8f9fa;
    color: #2c3e50;
    border-color: #e5e7eb;
}

.user-dropdown .dropdown-toggle:hover {
    background: #fff5f5;
    color: #cb0001;
    border-color: #cb0001;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-dropdown .dropdown-menu {
    min-width: 280px;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 0;
    overflow: hidden;
}

.user-dropdown .dropdown-header {
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-info i {
    font-size: 40px;
    color: #cb0001;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details strong {
    display: block;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details small {
    display: block;
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown .dropdown-item {
    padding: 12px 20px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-dropdown .dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.user-dropdown .dropdown-item:hover {
    background: #f8f9fa;
    color: #cb0001;
}

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

.user-dropdown .dropdown-item.text-danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

.user-dropdown .dropdown-item.text-danger:hover i {
    color: #dc3545;
}

.user-dropdown .dropdown-divider {
    margin: 0;
    border-color: #e5e7eb;
}

.user-dropdown form {
    margin: 0;
}

.user-dropdown form button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

/* Mobile User Info */
.mobile-user-info {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 100%);
    border-radius: 8px;
    margin-bottom: 10px;
}

.mobile-user-info i {
    font-size: 36px;
    color: #cb0001;
}

.mobile-user-info div {
    flex: 1;
    min-width: 0;
}

.mobile-user-info strong {
    display: block;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.mobile-user-info small {
    display: block;
    color: #6b7280;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 991px) {
    .header-wrapper {
        grid-template-columns: 1fr auto;
        padding: 15px 0;
    }
    
    .header-logo img {
        height: 45px;
    }
    
    .header-nav {
        display: none;
    }
}

@media (min-width: 992px) {
    .mobile-menu {
        display: none !important;
    }
}
