/**
 * Menu Mobile Premium 2025
 * Design Moderno compatível com Tailwind CSS
 * Sem emojis, apenas ícones SVG
 */

/* ==================== VARIÁVEIS ==================== */
:root {
    --menu-primary: #2563eb;
    --menu-primary-light: #3b82f6;
    --menu-text-dark: #1f2937;
    --menu-text-medium: #4b5563;
    --menu-border: #e5e7eb;
    --menu-bg-white: #ffffff;
    --menu-bg-gray: #f9fafb;
}

/* ==================== BOTÃO HAMBÚRGUER MINIMALISTA ==================== */
#mobile-menu-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 1002;
}

#mobile-menu-btn:hover {
    background: rgba(37, 99, 235, 0.08);
}

#mobile-menu-btn:active {
    transform: scale(0.92);
    background: rgba(37, 99, 235, 0.12);
}

/* Container das linhas */
#mobile-menu-btn .hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Linhas do hambúrguer - Design moderno */
#mobile-menu-btn .hamburger-line {
    height: 3px;
    background: var(--menu-primary);
    border-radius: 3px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

#mobile-menu-btn .hamburger-line:nth-child(1) {
    width: 100%;
}

#mobile-menu-btn .hamburger-line:nth-child(2) {
    width: 65%;
    align-self: flex-end;
}

#mobile-menu-btn .hamburger-line:nth-child(3) {
    width: 80%;
}

/* Hover - linhas ficam uniformes */
#mobile-menu-btn:hover .hamburger-line {
    background: #1d4ed8;
}

#mobile-menu-btn:hover .hamburger-line:nth-child(2),
#mobile-menu-btn:hover .hamburger-line:nth-child(3) {
    width: 100%;
}

/* ==================== ANIMAÇÃO X QUANDO ABERTO ==================== */
body.menu-open #mobile-menu-btn {
    background: rgba(37, 99, 235, 0.1);
}

body.menu-open #mobile-menu-btn .hamburger-line {
    background: var(--menu-primary);
    width: 100%;
}

body.menu-open #mobile-menu-btn .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

body.menu-open #mobile-menu-btn .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

body.menu-open #mobile-menu-btn .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==================== OVERLAY ==================== */
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#mobile-menu-overlay.show,
#mobile-menu-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* ==================== MENU DRAWER ==================== */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 88%;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    background: var(--menu-bg-white);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    transform: translateX(-100%);
    transition: transform 0.35s ease, visibility 0.35s, opacity 0.35s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

#mobile-menu.show,
body.menu-open #mobile-menu {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
}

#mobile-menu.hidden {
    visibility: hidden;
    opacity: 0;
}

/* ==================== HEADER DO MENU ==================== */
/* Linha decorativa */
#mobile-menu>.premium-decoration-line {
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #06b6d4, #8b5cf6, #d946ef, #f43f5e, #2563eb);
    background-size: 200% auto;
    animation: menu-shine 4s linear infinite;
    flex-shrink: 0;
}

@keyframes menu-shine {
    to {
        background-position: 200% center;
    }
}

/* Header com classe específica */
#mobile-menu .menu-header-premium {
    background: linear-gradient(135deg, var(--menu-primary) 0%, var(--menu-primary-light) 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    border-bottom: none;
    min-height: 70px;
}

/* Título do Menu */
#mobile-menu .menu-header-premium h2 {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
}

#mobile-menu .menu-header-premium h2 svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    max-width: 20px;
    color: #ffffff;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Botão Fechar */
#mobile-menu .menu-header-premium .menu-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

#mobile-menu .menu-header-premium .menu-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
}

#mobile-menu .menu-header-premium .menu-close-btn svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    max-width: 18px;
    stroke-width: 2.5;
    color: #ffffff;
}

/* ==================== CORPO DO MENU ==================== */
#mobile-menu>div:last-child {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 2rem;
    min-height: 0;
    background: var(--menu-bg-white);
}

/* Scrollbar */
#mobile-menu>div:last-child::-webkit-scrollbar {
    width: 3px;
}

#mobile-menu>div:last-child::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* ==================== LINKS DO MENU ==================== */
#mobile-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--menu-text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f3f4f6;
    min-height: 56px;
}

#mobile-menu a:hover {
    background: rgba(37, 99, 235, 0.04);
    color: var(--menu-primary);
    border-left-color: var(--menu-primary);
}

#mobile-menu a:hover span {
    color: var(--menu-primary);
}

/* Ícones dos links */
#mobile-menu a svg {
    width: 22px;
    height: 22px;
    margin-right: 1rem;
    flex-shrink: 0;
    color: var(--menu-primary);
    transition: transform 0.2s ease;
}

#mobile-menu a:hover svg {
    transform: scale(1.1);
}

/* Container de ícone */
#mobile-menu a div.w-8 {
    width: 36px;
    height: 36px;
    background: rgba(37, 99, 235, 0.06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    transition: all 0.2s ease;
}

#mobile-menu a:hover div.w-8 {
    background: rgba(37, 99, 235, 0.12);
}

#mobile-menu a div.w-8 svg {
    margin-right: 0;
    width: 18px;
    height: 18px;
}

/* Link Início */
#mobile-menu a[href="index.php"] {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-left: 3px solid var(--menu-primary);
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

#mobile-menu a[href="index.php"]:hover {
    background: rgba(37, 99, 235, 0.06);
}

/* ==================== TÍTULOS DAS SEÇÕES ==================== */
#mobile-menu h3 {
    padding: 0.875rem 1.5rem;
    background: var(--menu-bg-gray);
    color: var(--menu-text-medium);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    border-bottom: 1px solid var(--menu-border);
    border-top: 1px solid var(--menu-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

#mobile-menu>div>div:first-child h3 {
    border-top: none;
}

/* ==================== BADGE DO CARRINHO ==================== */
#menu-cart-count {
    background: linear-gradient(135deg, var(--menu-primary) 0%, var(--menu-primary-light) 100%);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* ==================== WHATSAPP ==================== */
#mobile-menu a[href*="whatsapp"] {
    display: flex;
    visibility: visible;
    opacity: 1;
}

#mobile-menu a[href*="whatsapp"] svg {
    color: #16a34a;
    fill: #16a34a;
}

#mobile-menu a[href*="whatsapp"]:hover {
    background: rgba(22, 163, 74, 0.06);
    border-left-color: #16a34a;
}

#mobile-menu a[href*="whatsapp"]:hover span {
    color: #16a34a;
}

/* ==================== INSTAGRAM ==================== */
#mobile-menu a[href*="instagram"] {
    display: flex;
    visibility: visible;
    opacity: 1;
}

#mobile-menu a[href*="instagram"] svg {
    color: #e4405f;
    fill: #e4405f;
}

#mobile-menu a[href*="instagram"]:hover {
    background: rgba(228, 64, 95, 0.06);
    border-left-color: #e4405f;
}

#mobile-menu a[href*="instagram"]:hover span {
    color: #e4405f;
}

/* Garantir visibilidade */
#menu-contato-section,
#menu-whatsapp-link,
#menu-instagram-link {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ==================== LINHA DECORATIVA ==================== */
#mobile-menu .premium-decoration-line {
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #06b6d4, #8b5cf6, #d946ef, #f43f5e, #2563eb);
    background-size: 200% auto;
    animation: menu-shine 4s linear infinite;
}

@keyframes menu-shine {
    to {
        background-position: 200% center;
    }
}

/* ==================== RESPONSIVIDADE ==================== */
@media (max-width: 480px) {
    #mobile-menu {
        width: 92%;
        max-width: 300px;
    }

    #mobile-menu-btn {
        width: 42px;
        height: 42px;
    }

    #mobile-menu>div:first-child {
        padding: 1rem 1.25rem;
    }

    #mobile-menu a {
        padding: 0.875rem 1.25rem;
    }
}

/* ==================== ACESSIBILIDADE ==================== */
#mobile-menu-btn:focus {
    outline: 2px solid var(--menu-primary);
    outline-offset: 2px;
}

#mobile-menu>div:first-child button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

#mobile-menu a:focus {
    outline: 2px solid var(--menu-primary);
    outline-offset: -2px;
}

/* ==================== BODY QUANDO MENU ABERTO ==================== */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100vh;
    height: 100dvh;
}