/* Paleta Comercial - Fundo Médio Claro */
:root {
    --bg-marketplace: #F4F4F2;  /* Fundo claro, mas não muito (cinza-marfim refinado) */
    --text-main: #222222;
    --or-antique: #A98A4B;      /* Toque premium nos detalhes do e-commerce */
    --vert-emeraude: #0A3A2F;   /* Botões principais e destaques */
    --white: #FFFFFF;
    --border-color: #E2E2E0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-marketplace);
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.4;
}

/* Header Comercial Inteligente */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-subtitle {
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--or-antique);
}

/* Barra de Busca estilo Mercado Livre */
.search-bar {
    flex: 1;
    max-width: 600px;
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    background-color: #FAFAFA;
}

.search-bar button {
    background-color: var(--vert-emeraude);
    color: var(--white);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.search-bar button:hover {
    background-color: #072922;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px; /* Alinhamento perfeito e espaçamento premium aqui */
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Garante que o botão do Carrinho também tenha a mãozinha de clique e o efeito visual */
#cart-nav {
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

#cart-nav:hover {
    color: var(--or-antique); /* Efeito dourado ao passar o rato */
}

/* Faixa de Vantagens */
.promo-bar {
    background-color: var(--vert-emeraude);
    color: var(--white);
    text-align: center;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Layout Principal em Grid */
.shop-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 250px 1fr; /* Lateral fixa e grid de produtos flexível */
    gap: 25px;
}

/* Menu de Filtros Lateral */
.filters {
    background-color: var(--white);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    height: fit-content;
}

.filters h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-marketplace);
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #555;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    cursor: pointer;
}

/* Grid de Listagem de Perfumes */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Responsividade automática */
    gap: 20px;
}

/* Cards de Produto Estilo Premium Conversão */
.product-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.badge-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--or-antique);
    color: var(--white);
    font-size: 0.65rem;
    padding: 3px 8px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 10;
}

.badge-tag.rarity {
    background-color: #8A2BE2; /* Roxo para itens raros */
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: #F8F8F6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-bottom: 15px;
}

.img-placeholder {
    color: #999;
    font-size: 0.85rem;
}

.product-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    height: 40px; /* Mantém o alinhamento dos textos */
    overflow: hidden;
}

.olofative-family {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 15px;
}

.price-area {
    margin-bottom: 15px;
}

.old-price {
    font-size: 0.8rem;
    text-decoration: line-through;
    color: #999;
    display: block;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
}

.installments {
    font-size: 0.75rem;
    color: var(--vert-emeraude);
    font-weight: 600;
}

/* Botão de Compra Direta */
.btn-buy {
    width: 100%;
    background-color: var(--vert-emeraude);
    color: var(--white);
    border: none;
    padding: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-buy:hover {
    background-color: #072922;
}

/* ====================================================
   MÍDIA QUERIES - GARANTIA TOTAL DE RESPONSIVIDADE
   ==================================================== */
@media (max-width: 900px) {
    .shop-container {
        grid-template-columns: 1fr; /* Filtros vão para cima ou somem no mobile */
        margin: 15px auto;
    }
    .filters {
        display: none; /* Em e-commerces reais no mobile, filtros viram um botão colapsável */
    }
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
    }
    .search-bar {
        max-width: 100%;
    }
    .header-actions {
        text-align: right;
        font-size: 0.85rem;
    }
    .products-grid {
        grid-template-columns: 1fr; /* Um produto por linha na tela pequena de celular */
    }
}


/* Ajuste para as imagens reais dos perfumes dentro do card */
.product-img-file {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Faz a foto se ajustar sem cortar ou distorcer o frasco */
    padding: 10px;
}

/* Alinhamento dos itens de ações no topo */


/* ====================================================
   CARRINHO FLUTUANTE (Canto Inferior Direito)
   ==================================================== */
/* ====================================================
   CARRINHO FLUTUANTE ATUALIZADO (COM ANIMAÇÃO DE DESLIZAR)
   ==================================================== */
.floating-cart {
    position: fixed;
    bottom: 0; /* Fixado na base da tela para deslizar perfeito */
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background-color: var(--white);
    border: 1px solid var(--or-antique);
    border-bottom: none; /* Remove borda de baixo ja que encosta na tela */
    border-radius: 8px 8px 0 0; /* Arredonda apenas as pontas de cima */
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    /* Mágica da Animação: Transição suave de 0.4 segundos */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateY(0); /* Estado normal: Aberto/Visível */
}

/* NOVA Classe utilitária: Quando minimizado, joga o carrinho para baixo, 
   mas deixa a bordinha do header dele aparecendo como uma aba */
.floating-cart.minimized {
    transform: translateY(calc(100% - 50px)); /* Deixa exatamente o header visível */
}

/* Se o carrinho estiver completamente vazio, aí sim a gente esconde ele todo para não atrapalhar */
.floating-cart.empty {
    transform: translateY(100%);
    pointer-events: none;
    box-shadow: none;
}

.cart-header {
    background-color: var(--vert-emeraude);
    color: var(--white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer; /* Permite clicar em qualquer lugar do header para abrir/fechar */
}

.cart-header h3 {
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

/* Estilo do botão de fechar/minimizar que vai virar a setinha */
#close-cart {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Quando o carrinho estiver minimizado, a setinha gira para cima */
.floating-cart.minimized #close-cart {
    transform: rotate(180deg);
}

.cart-header {
    background-color: var(--vert-emeraude);
    color: var(--white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.cart-header button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
}

.cart-items-body {
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
    background-color: #FAFAFA;
}

/* Estilo do item dentro do carrinho */
/* ====================================================
   NOVOS ESTILOS PARA OS BOTÕES DE QUANTIDADE
   ==================================================== */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 3px;
}

/* Container dos botões + e - */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.btn-qty {
    background-color: var(--bg-marketplace);
    border: 1px solid var(--border-color);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-qty:hover {
    background-color: var(--or-antique);
    color: var(--white);
    border-color: var(--or-antique);
}

.qty-number {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 15px;
    text-align: center;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
    white-space: nowrap;
}

.cart-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: var(--white);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
}

#cart-total-value {
    color: var(--vert-emeraude);
}

.btn-checkout {
    width: 100%;
    background-color: var(--or-antique);
    color: var(--white);
    border: none;
    padding: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background-color: #91743B;
}

/* Alteração visual para o botão quando o item já está no carrinho */
.btn-buy.active {
    background-color: #d9534f; /* Cor vermelha/alerta para indicar que o próximo clique remove */
}
.btn-buy.active:hover {
    background-color: #c9302c;
}

/* Transição suave para quando o produto for filtrado */
.product-card {
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s ease, scale 0.3s ease;
    scale: 1;
    opacity: 1;
}

/* Classe que o JS vai aplicar para sumir com o perfume da tela */
.product-card.filtered-out {
    display: none !important; /* Remove do fluxo do grid */
}

/* ====================================================
   MENU DROPDOWN COMPACTO (ABAIXO DE MINHA CONTA)
   ==================================================== */
.account-menu-container {
    position: relative; /* Essencial para o dropdown se posicionar baseado nele */
    display: inline-block;
}

#user-icon {
    cursor: pointer;
    padding: 5px 0;
    font-weight: 500;
    transition: color 0.2s;
}

#user-icon:hover {
    color: var(--or-antique);
}

/* O Dropdown flutuante */
.account-dropdown {
    position: absolute;
    top: 100%; /* Brota exatamente abaixo do texto */
    left: 50%;
    transform: translateX(-50%); /* Centraliza bonitinho embaixo do botão */
    margin-top: 10px;
    width: 180px; /* Tamanho compacto, só a largura dos botões */
    background-color: var(--white);
    border: 1px solid var(--or-antique);
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Classe utilitária para esconder */
.account-dropdown.hidden {
    display: none !important;
}

/* Estilo dos links internos do dropdown */
.dropdown-link {
    display: block;
    width: 100%;
    padding: 12px 15px;
    text-align: center;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none; /* Caso use a tag <a> */
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    box-sizing: border-box;
}

.dropdown-link:last-child {
    border-bottom: none; /* Remove a linha do último item */
}

.dropdown-link:hover {
    background-color: var(--bg-marketplace);
    color: var(--or-antique);
}

/* Link de Sair destacado */
.dropdown-link.logout-btn {
    color: #c0392b;
}
.dropdown-link.logout-btn:hover {
    background-color: #fdf2f2;
}

/* Ajuste responsivo para celular */
@media (max-width: 480px) {
    .account-dropdown {
        left: auto;
        right: 0;
        transform: none; /* No mobile ele cola na direita para não sair da tela */
        width: 160px;
    }
}

/* Botão de Favoritar posicionado no topo direito de cada card */
.wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(17, 17, 17, 0.6); /* Fundo Noir Absolu sutil com opacidade */
    border: 1px solid var(--or-antique);
    color: #FFF;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.wishlist-btn:hover {
    background-color: var(--or-antique);
    color: var(--noir-absolu);
    transform: scale(1.1);
}

/* Quando o produto já estiver favoritado no banco */
.wishlist-btn.favorited {
    background-color: #c0392b;
    border-color: #c0392b;
    color: white;
}

.produto-container {
    display: flex;
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
    gap: 60px;
    background: #ffffff;
}

.produto-imagem-lateral {
    flex: 1.1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafafa; /* Fundo sutil para destacar o produto */
    border-radius: 16px;
    padding: 30px;
}

.produto-imagem-lateral img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.produto-imagem-lateral img:hover {
    transform: scale(1.02);
}

.produto-detalhes {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.produto-detalhes h1 {
    font-size: 2.4rem;
    color: #111;
    margin-bottom: 6px;
    font-weight: 600;
}

.produto-familia {
    font-size: 1rem;
    color: #27ae60; /* Verde sofisticado para destacar a família olfativa */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.produto-precos {
    background: #fdfdfd;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.produto-precos .preco-antigo {
    text-decoration: line-through;
    color: #999;
    font-size: 1.1rem;
    margin-right: 10px;
}

.produto-precos .preco-atual {
    font-size: 2.2rem;
    font-weight: 700;
    color: #111;
}

.produto-parcelas {
    display: block;
    color: #555;
    font-size: 0.95rem;
    margin-top: 6px;
}

.produto-descricao {
    margin-bottom: 25px;
}

.produto-descricao h3 {
    font-size: 1.1rem;
    color: #111;
    margin-bottom: 8px;
}

.produto-descricao p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

/* Seletor de Quantidade Estilizado */
.quantidade-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quantidade-container label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.seletor-qtd {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.btn-qtd-detalhe {
    background: #f9f9f9;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-qtd-detalhe:hover {
    background: #eee;
}

.input-qtd-detalhe {
    width: 45px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 1rem;
    font-weight: 600;
}

/* Bloco de Botões de Ação */
.botoes-acao-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

/* Botão Comprar Agora (Verde Destaque) */
.btn-comprar-agora {
    background: #27ae60;
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.btn-comprar-agora:hover {
    background: #219653;
}

.btn-comprar-agora:active {
    transform: scale(0.99);
}

/* Botão Adicionar ao Carrinho (Borda ou Clean) */
.btn-adicionar-sacola {
    background: #ffffff;
    color: #111;
    border: 2px solid #111;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-adicionar-sacola:hover {
    background: #111;
    color: #fff;
}

/* Seção de Simulação de Frete */
.frete-container {
    background: #fdfdfd;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 18px;
    margin-top: 10px;
}

.frete-container h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.frete-input-group {
    display: flex;
    gap: 10px;
}

.frete-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.btn-calcular-frete {
    background: #111;
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.btn-calcular-frete:hover {
    background: #333;
}

.resultado-frete {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 500;
}

/* Responsividade Básica */
@media (max-width: 768px) {
    .produto-container {
        flex-direction: column;
        gap: 30px;
        padding: 15px;
    }
    .produto-imagem-lateral img {
        max-height: 350px;
    }
    .produto-detalhes h1 {
        font-size: 1.9rem;
    }
}