/**
 * Header PRO V5 - PREMIUM GOLD EDITION
 * Tema: Ouro, Bronze, Prata e Verde-Esmeralda
 * Sensação de papel premium com degradê e bordas douradas
 */

:root {
    --mmhp-gold: #D4AF37;
    --mmhp-emerald: #50C878;
    --mmhp-bronze: #CD7F32;
    --mmhp-silver: #C0C0C0;
    --mmhp-dark: #1a1a1a;
    --mmhp-light: #fdfbf7;
}

/* ========================================
   WRAPPER PRINCIPAL COM DEGRADÊ PREMIUM
======================================== */
.mmhp-header-wrapper {
    background: linear-gradient(180deg, #fdfbf7 0%, #ffffff 50%, #fdfbf7 100%);
    padding: 16px 0;
    border-bottom: 3px solid var(--mmhp-gold);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.1);
    position: relative;
    z-index: 1000;
}

/* Efeito papel premium - textura sutil */
.mmhp-header-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 48%, rgba(212, 175, 55, 0.02) 49%, rgba(212, 175, 55, 0.02) 51%, transparent 52%);
    background-size: 4px 4px;
    pointer-events: none;
}

.mmhp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.mmhp-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* ========================================
   LOGO
======================================== */
.mmhp-logo-wrapper {
    flex-shrink: 0;
    height: 48px;
    display: flex;
    align-items: center;
}

.mmhp-logo-wrapper img {
    max-height: 48px;
    width: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.mmhp-logo-wrapper:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.3));
}

.mmhp-site-name {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--mmhp-gold) 0%, var(--mmhp-bronze) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   BUSCA COM BORDA DOURADA NO FOCO
======================================== */
.mmhp-search-trigger-wrapper {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.mmhp-search-inline-form {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.mmhp-search-inline-form:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

/* BORDA DOURADA NO FOCO */
.mmhp-search-inline-form:focus-within {
    border-color: var(--mmhp-gold);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15),
                0 8px 24px rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
}

.mmhp-search-input {
    flex: 1;
    height: 100%;
    padding: 0 20px;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: #111827;
}

.mmhp-search-input::placeholder {
    color: #9ca3af;
}

.mmhp-search-submit-inline {
    width: 68px;
    height: 48px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mmhp-search-submit-inline:hover {
    color: var(--mmhp-gold);
    transform: scale(1.1);
}

/* ========================================
   BOTÕES DE USUÁRIO
======================================== */
.mmhp-user-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mmhp-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--mmhp-dark);
    border: 2px solid var(--mmhp-gold);
    border-radius: 24px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Brilho dourado no fundo */
.mmhp-user-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.mmhp-user-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* HOVER: Botão vira ouro com texto preto */
.mmhp-user-btn:hover {
    background: var(--mmhp-gold);
    color: #000000;
    border-color: var(--mmhp-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.mmhp-user-btn-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.mmhp-user-btn:hover .mmhp-user-btn-icon {
    transform: scale(1.2) rotate(5deg);
}

.mmhp-user-btn-label {
    position: relative;
    z-index: 1;
}

/* ========================================
   CARRINHO PREMIUM
   Preto com borda dourada → Hover vira ouro com texto preto
======================================== */
.mmhp-cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--mmhp-dark);
    border: 2px solid var(--mmhp-gold);
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mmhp-cart-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--mmhp-gold);
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    z-index: 0;
}

.mmhp-cart-link:hover::before {
    width: 200px;
    height: 200px;
}

/* HOVER: Vira ouro com ícone preto */
.mmhp-cart-link:hover {
    border-color: var(--mmhp-gold);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.mmhp-cart-icon {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
    stroke: currentColor;
    transition: all 0.3s;
}

.mmhp-cart-link:hover .mmhp-cart-icon {
    stroke: #000000;
    transform: scale(1.1);
}

/* Badge de contagem */
.mmhp-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--mmhp-emerald) 0%, #3da862 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(80, 200, 120, 0.4);
    z-index: 2;
    animation: mmhp-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes mmhp-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   DROPDOWN DE RESULTADOS
======================================== */
.mmhp-product-results-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15),
                0 0 0 3px var(--mmhp-gold);
    z-index: 1000;
    border: 2px solid var(--mmhp-gold);
    animation: mmhp-slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mmhp-product-results-dropdown.active {
    display: block;
}

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

/* Scrollbar personalizada */
.mmhp-product-results-dropdown::-webkit-scrollbar {
    width: 8px;
}

.mmhp-product-results-dropdown::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 8px;
}

.mmhp-product-results-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--mmhp-gold) 0%, var(--mmhp-bronze) 100%);
    border-radius: 8px;
}

/* Loading state */
.mmhp-product-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: #6b7280;
}

.mmhp-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--mmhp-gold);
    border-radius: 50%;
    animation: mmhp-spin 0.8s linear infinite;
}

@keyframes mmhp-spin {
    to { transform: rotate(360deg); }
}

/* Items de produto */
.mmhp-product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.mmhp-product-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mmhp-product-item:hover::before {
    width: 100%;
}

.mmhp-product-item:hover {
    background: #fffef9;
    border-left: 3px solid var(--mmhp-gold);
}

.mmhp-product-item:last-child {
    border-bottom: none;
}

.mmhp-product-image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #f3f4f6;
    transition: all 0.3s;
}

.mmhp-product-item:hover .mmhp-product-image {
    border-color: var(--mmhp-gold);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.mmhp-product-info {
    flex: 1;
    min-width: 0;
}

.mmhp-product-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.3;
    transition: color 0.2s;
}

.mmhp-product-item:hover .mmhp-product-name {
    color: var(--mmhp-gold);
}

.mmhp-product-price {
    font-size: 14px;
    color: var(--mmhp-emerald);
    font-weight: 700;
}

.mmhp-product-excerpt {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

/* Link "Ver todos" */
.mmhp-view-all-link {
    padding: 16px 20px;
    text-align: center;
    color: var(--mmhp-gold);
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(180deg, #fdfbf7 0%, #ffffff 100%);
    border-top: 2px solid var(--mmhp-gold);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mmhp-view-all-link:hover {
    background: var(--mmhp-gold);
    color: #000000;
    letter-spacing: 0.5px;
}

.mmhp-no-results {
    padding: 32px;
    text-align: center;
    color: #9ca3af;
    font-size: 15px;
}

/* ========================================
   RESPONSIVIDADE
======================================== */
@media (max-width: 1024px) {
    .mmhp-header-inner {
        gap: 16px;
    }
    
    .mmhp-search-trigger-wrapper {
        max-width: 400px;
    }
    
    .mmhp-user-btn-label {
        display: none;
    }
    
    .mmhp-user-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

@media (max-width: 768px) {
    .mmhp-header-wrapper {
        padding: 12px 0;
    }
    
    .mmhp-header-inner {
        gap: 12px;
    }
    
    .mmhp-logo-wrapper {
        height: 40px;
    }
    
    .mmhp-logo-wrapper img {
        max-height: 40px;
    }
    
    .mmhp-search-trigger-wrapper {
        max-width: 100%;
    }
    
    .mmhp-search-inline-form,
    .mmhp-search-input,
    .mmhp-search-submit-inline,
    .mmhp-logo-wrapper,
    .mmhp-user-btn,
    .mmhp-cart-link {
        height: 40px !important;
    }
    
    .mmhp-user-btn {
        width: 40px !important;
        font-size: 18px;
    }
    
    .mmhp-cart-link {
        width: 40px !important;
    }
    
    .mmhp-product-results-dropdown {
        max-width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
    }
    
    .mmhp-product-item {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .mmhp-product-image {
        width: 48px;
        height: 48px;
    }
}

/* ========================================
   ANIMAÇÕES ADICIONAIS
======================================== */
@keyframes mmhp-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.mmhp-cart-count,
.mmhp-user-btn,
.mmhp-cart-link {
    position: relative;
    overflow: hidden;
}

/* Efeito de brilho ao passar o mouse */
.mmhp-user-btn:hover,
.mmhp-cart-link:hover {
    animation: mmhp-shimmer 2s infinite linear;
    background-size: 200% 100%;
}