:root {
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-text: #1e293b;
    --header-primary: #0072ff;
}

.main-header {
    background: var(--header-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 114, 255, 0.15));
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05) rotate(-2deg);
}

.logo h1 {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1;
    font-weight: 800;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.main-nav a {
    text-decoration: none;
    color: var(--header-text);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.main-nav a:hover {
    background: rgba(0, 114, 255, 0.08);
    color: var(--header-primary);
    transform: translateY(-1px);
}

.user-badge-customer {
    background: white !important;
    border-radius: 14px !important;
    border: 1px solid rgba(0, 114, 255, 0.1) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04) !important;
    padding: 0.4rem 0.8rem !important;
}

.badge-customer {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.2) !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.75rem !important;
    border-radius: 50px !important;
}

.cart-icon {
    background: white !important;
    border: 1px solid rgba(0, 114, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 0.8rem !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04) !important;
}

.cart-icon:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(0, 114, 255, 0.12) !important;
}

.cart-count {
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%) !important;
    box-shadow: 0 2px 8px rgba(255, 94, 98, 0.4) !important;
    border: 2px solid white !important;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.customer-name {
    font-weight: 600;
    color: var(--header-text);
    font-size: 0.9375rem;
}

/* ============================================
   CARRINHO MODERNO
   ============================================ */

.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(41, 128, 185, 0.15) 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
}

.cart-icon:active {
    transform: translateY(0) scale(1);
}

.cart-icon svg {
    width: 24px;
    height: 24px;
    color: var(--header-text);
    transition: color 0.3s ease;
}

.cart-icon:hover svg {
    color: var(--header-text-hover);
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    border: 2px solid white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ============================================
   MENU MOBILE
   ============================================ */

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(41, 128, 185, 0.15) 100%);
    transform: scale(1.05);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--header-text);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav.active {
    display: block;
    opacity: 1;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

/* Novo: Seção de Usuário no Mobile Nav */
.mobile-user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
    overflow: hidden;
}

.mobile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-user-name {
    font-weight: 700;
    color: var(--header-text);
    font-size: 1.1rem;
    line-height: 1.2;
}

.mobile-user-profile-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    font-size: 0.85rem !important;
    color: #3498db !important;
    font-weight: 600 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    text-decoration: none !important;
}

.mobile-user-profile-link:hover {
    color: #2980b9 !important;
    background: none !important;
    transform: none !important;
}

.mobile-nav-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    background: #e9ecef;
    transform: rotate(90deg);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-links a {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    color: var(--header-text);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    border-left-color: #3498db;
    color: var(--header-text-hover);
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-content {
        padding: 1rem 1.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        justify-content: space-between;
    }

    /* Logo fica à esquerda */
    .logo {
        flex: 1;
        gap: 0.5rem;
    }

    .logo-img {
        height: 32px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    /* Garantir que header-right permanece visível */
    .header-right {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
    }

    .user-badge-customer {
        display: none;
    }

    .customer-name {
        display: none;
    }

    .badge-customer {
        display: none;
    }

    .cart-icon {
        padding: 0.5rem;
    }

    .cart-icon svg {
        width: 20px;
        height: 20px;
    }

    /* Menu toggle fica visível */
    .mobile-menu-toggle {
        display: flex;
        margin-left: 0;
    }
}



@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.25rem;
    }

    .header-content {
        padding: 0.875rem 1rem;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
}