@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #F8F9FA;
    --dark: #0F172A; /* Le noir/bleu foncé de l'interface */
    --accent: #FF6B35; /* L'orange du bouton 'Buy Now' */
    --gray-text: #94A3B8;
    --card-bg: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body { background-color: var(--bg); color: var(--dark); }

/* --- Landing & Login --- */
.bg-landing, .bg-login {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
}
.landing-content { text-align: center; }
.logo-circle {
    width: 80px; height: 80px; background: var(--dark); color: white;
    border-radius: 25px; margin: 0 auto 20px; display: flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: 1.5rem;
}
.btn-start, .btn-login {
    display: inline-block; background: var(--dark); color: white;
    padding: 15px 40px; border-radius: 30px; text-decoration: none;
    font-weight: 600; margin-top: 20px; border: none; cursor: pointer;
    transition: 0.3s;
}
.btn-start:hover { transform: scale(1.05); background: var(--accent); }

.login-card {
    background: var(--bg); padding: 40px; border-radius: 30px; width: 90%; max-width: 350px;
    text-align: center;
}
.input-group input {
    width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 15px;
    margin-bottom: 15px; background: white; outline: none;
}
.alert { color: red; margin-bottom: 15px; font-size: 0.9rem; }
.demo-info { margin-top: 20px; font-size: 0.8rem; color: var(--gray-text); }

/* --- App Layout --- */
.app-body { max-width: 480px; margin: 0 auto; background: var(--bg); min-height: 100vh; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.05); }

/* Header */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 25px; background: var(--bg); position: sticky; top: 0; z-index: 10;
}
.header-title { font-size: 1.5rem; font-weight: 700; }
.icon-btn { background: white; border: none; width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; cursor: pointer; }

/* Scroll Area */
.scroll-container { padding: 0 25px; }

/* Banner Promo */
.promo-banner {
    background: var(--dark); color: white; border-radius: 25px; padding: 25px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; position: relative; overflow: hidden;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}
.promo-text h3 { font-size: 1.4rem; margin-bottom: 5px; line-height: 1.2; }
.promo-text p { font-size: 0.8rem; opacity: 0.8; margin-bottom: 15px; }
.btn-promo {
    background: var(--accent); color: white; border: none; padding: 10px 20px;
    border-radius: 20px; font-weight: 600; cursor: pointer;
}
.promo-img { width: 140px; position: absolute; right: -20px; bottom: -20px; transform: rotate(-15deg); }

/* Categories */
.categories-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.categories-header a { color: var(--gray-text); text-decoration: none; font-size: 0.9rem; }
.categories-scroll { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 20px; scrollbar-width: none; }
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    background: white; padding: 10px 20px; border-radius: 12px;
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
    color: var(--gray-text); cursor: pointer; transition: 0.3s;
}
.cat-pill.active { background: var(--accent); color: white; box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.product-card {
    background: var(--card-bg); border-radius: 25px; padding: 12px;
    position: relative; transition: transform 0.2s;
}
.product-card:hover { transform: translateY(-5px); }

.wishlist-btn {
    position: absolute; top: 12px; right: 12px; background: white;
    width: 30px; height: 30px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: pointer; z-index: 2;
}

/* Fix Image Fit */
.img-box {
    width: 100%;
    height: 180px; /* Altura fixa para alinhar grid */
    overflow: hidden;
    background: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mágica: Corta a imagem para preencher sem distorcer */
    object-position: center;
}

/* Responsividade Melhorada */
.product-grid {
    display: grid;
    /* Cria colunas automaticamente com mínimo de 160px */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

/* Carousel Banners */
.banner-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin-bottom: 20px;
    border-radius: 20px;
}
.banner-container img {
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: center;
    border-radius: 20px;
}

.card-details h4 { font-size: 0.95rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-row { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 700; font-size: 1.1rem; }
.rating { font-size: 0.8rem; display: flex; align-items: center; gap: 2px; }
.rating i { color: #FFC107; }
.unit-sub { font-size: 0.7rem; color: var(--gray-text); display: block; margin-top: -3px; }

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--dark);
    padding: 20px 40px;
    display: flex; justify-content: space-between; align-items: center;
    border-top-left-radius: 30px; border-top-right-radius: 30px;
    z-index: 100;
}
.nav-item { color: rgba(255,255,255,0.4); font-size: 1.5rem; text-decoration: none; position: relative; }
.nav-item.active { color: white; }
.nav-item.badge::after {
    content: ''; position: absolute; top: 0; right: 0; width: 8px; height: 8px;
    background: var(--accent); border-radius: 50%;
}
/* --- Profil & Gamification --- */
.loyalty-card {
    border-radius: 20px;
    padding: 25px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
/* Thèmes des cartes */
.loyalty-card.bronze { background: linear-gradient(135deg, #cd7f32, #a05a2c); }
.loyalty-card.silver { background: linear-gradient(135deg, #bdc3c7, #2c3e50); }
.loyalty-card.gold { background: linear-gradient(135deg, #ffd700, #d35400); }

.card-header { display: flex; justify-content: space-between; font-weight: 600; letter-spacing: 1px; margin-bottom: 20px; }
.points-big { font-size: 2.5rem; font-weight: 700; margin-bottom: 20px; }

.progress-bar-bg { background: rgba(255,255,255,0.3); height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-bar-fill { background: white; height: 100%; border-radius: 3px; }
.next-level-text { font-size: 0.8rem; opacity: 0.9; }

/* Historique Commandes */
.order-item {
    background: white; padding: 15px; border-radius: 15px; margin-bottom: 15px;
    display: flex; justify-content: space-between; align-items: center;
}
.order-left { display: flex; align-items: center; gap: 15px; }
.order-icon { background: #f0f0f0; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.pts-gain { color: #27ae60; font-size: 0.8rem; font-weight: 600; display: block; }
.btn-xs { border: 1px solid #eee; background: white; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; cursor: pointer; }

/* --- Panier --- */
.cart-item { display: flex; gap: 15px; background: white; padding: 15px; border-radius: 15px; margin-bottom: 15px; }
.cart-img { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; background: #f9f9f9; }
.cart-info { flex: 1; }
.cart-qty { color: var(--gray-text); font-size: 0.8rem; margin: 4px 0; }
.checkout-area { background: white; padding: 20px; border-radius: 20px; position: sticky; bottom: 90px; box-shadow: 0 -5px 20px rgba(0,0,0,0.05); }
.total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.2rem; margin-bottom: 15px; }
.full-width { width: 100%; padding: 15px; font-size: 1rem; }
.empty-state { text-align: center; color: var(--gray-text); margin-top: 50px; }
.empty-state i { font-size: 3rem; margin-bottom: 10px; display: block; }

/* --- Divers --- */
.wishlist-btn.active i { color: #e74c3c; } /* Cœur rouge */
.user-points { background: #f0f0f0; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* --- Estilos da Página de Detalhes (Produto) --- */

/* Imagem Hero */
.detail-hero {
    position: relative;
    width: 100%;
    height: 350px; /* Altura grande para impacto */
    overflow: hidden;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botão Voltar */
.btn-back-floating {
    position: absolute;
    top: 20px; left: 20px;
    width: 40px; height: 40px;
    background: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 10;
    color: var(--dark);
    font-size: 1.5rem;
}

/* Conteúdo */
.detail-content { padding: 25px; }

.detail-header { margin-bottom: 25px; }
.detail-cat { 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    color: var(--accent); 
    font-weight: 700; 
    letter-spacing: 1px;
}
.detail-header h1 { font-size: 2rem; margin: 5px 0; line-height: 1.1; }
.price-tag { font-size: 1.5rem; font-weight: 700; color: var(--dark); display: flex; flex-direction: column; }
.price-tag small { font-size: 0.8rem; color: #888; font-weight: 400; }

.detail-desc h3 { font-size: 1.1rem; margin-bottom: 10px; }
.detail-desc p { color: #666; line-height: 1.6; font-size: 0.95rem; margin-bottom: 30px; }

/* Seleção de Variantes (Chips) */
.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.variant-card input { display: none; } /* Esconde o rádio padrão */

.variant-inner {
    border: 2px solid #eee;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: 0.2s;
    cursor: pointer;
    background: white;
}

/* Quando selecionado */
.variant-card input:checked + .variant-inner {
    border-color: var(--accent);
    background: #fff5eb; /* Laranja bem clarinho */
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.2);
}

.variant-size { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 5px; }
.variant-price { display: block; color: var(--accent); font-weight: 700; }

/* Barra de Ação (Sticky Bottom) */
.action-bar {
    position: fixed;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: white;
    padding: 15px 25px;
    border-top-left-radius: 25px; border-top-right-radius: 25px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    display: flex; gap: 15px;
    align-items: center;
    z-index: 100;
}

/* Controle de Qtd */
.qty-control {
    display: flex; align-items: center;
    background: #f5f5f5;
    border-radius: 30px;
    padding: 5px;
}
.qty-control button {
    width: 35px; height: 35px;
    border-radius: 50%;
    background: white;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.qty-control input {
    width: 40px; text-align: center;
    background: transparent; border: none;
    font-weight: 600; font-size: 1.1rem;
}

/* Botão Adicionar */
.btn-add-cart {
    flex: 1;
    background: var(--dark);
    color: white;
    height: 50px;
    border-radius: 25px;
    font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: 0.2s;
}
.btn-add-cart:active { transform: scale(0.98); }
/* --- ESTOQUE E VISUAL DE RUPTURA --- */

/* Card na Home (Boutique) */
.product-card.disabled-card {
    opacity: 0.6;
    pointer-events: none; /* Impede clique */
    filter: grayscale(100%);
}

.badge-rupture {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 5;
}

/* Detalhe do Produto - Variantes */
.variant-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.variant-card.disabled .variant-inner {
    background: #f0f0f0;
    border-color: #ddd;
}

.variant-card.disabled input {
    pointer-events: none;
}

.stock-label {
    display: block;
    font-size: 0.7rem;
    color: red;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 5px;
}
.badge-rupture {
    /* ... mantenha o anterior ... */
    text-align: center; /* Adicione isso */
    font-size: 0.65rem; /* Diminua um pouco para caber */
    line-height: 1.2;
}
/* CORREÇÃO VISUAL DOS CARDS */
a.product-card {
    text-decoration: none !important; /* Remove o sublinhado */
    color: inherit !important;        /* Remove o azul feio (usa a cor do texto normal) */
    display: block;                   /* Garante que o card mantenha o formato */
}

a.product-card:hover {
    text-decoration: none;
    color: inherit;
}
/* --- ESTILO DAS OPÇÕES DE VENDA (RESPONSIVO) --- */

.variantes-section {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.variantes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2f5;
}

.variantes-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* O Grid Mágico */
.variante-item {
    display: grid;
    /* Desktop: 4 colunas + botão de deletar */
    grid-template-columns: 2fr 1fr 1fr 1fr auto; 
    gap: 15px;
    align-items: start;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.variante-item:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #dfe3e6;
}

/* Estilo dos Inputs dentro do Grid */
.v-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.v-input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v-input-group input, 
.v-input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.v-input-group input:focus, 
.v-input-group select:focus {
    border-color: var(--accent);
    outline: none;
    background: #fff;
}

/* Botão de Remover */
.btn-remove-item {
    margin-top: 24px; /* Alinha com os inputs */
    background: #ffebee;
    color: #c62828;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-remove-item:hover {
    background: #c62828;
    color: white;
}

/* Botão Adicionar */
.btn-add-option {
    background: #e3f2fd;
    color: #1565c0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-add-option:hover {
    background: #1565c0;
    color: white;
}

/* --- MOBILE (TRANSFORMA EM CARDS) --- */
@media (max-width: 768px) {
    .variante-item {
        /* Vira uma coluna única */
        grid-template-columns: 1fr 1fr; 
        gap: 15px;
        position: relative; /* Para posicionar o botão X */
        padding-top: 40px; /* Espaço para o botão X */
    }

    /* Nome ocupa largura total */
    .v-input-group.full-width-mobile {
        grid-column: 1 / -1;
    }

    /* Botão de remover flutuante no topo direito */
    .btn-remove-item {
        position: absolute;
        top: 10px;
        right: 10px;
        margin-top: 0;
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}
/* --- ESTILO MODERNO PARA OS CAMPOS DE VARIANTES --- */

/* O Container de cada linha de variante */
.variante-row {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* Cantos arredondados no card */
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha no mobile */
    gap: 15px;
    align-items: flex-end; /* Alinha tudo pela base */
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}

.variante-row:hover {
    border-color: #b0b0b0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* O grupo Label + Input */
.v-group {
    flex: 1;            /* Cresce para ocupar espaço */
    min-width: 130px;   /* Tamanho mínimo antes de quebrar linha */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* O campo "Nome" deve ser maior que os outros */
.v-group.wide {
    min-width: 200px;
    flex: 2;
}

/* Estilo dos Inputs e Selects */
.v-input {
    width: 100%;
    height: 45px;       /* Altura fixa para alinhar tudo */
    padding: 0 15px;
    border: 1px solid #dcdcdc;
    border-radius: 8px; /* Cantos arredondados no input */
    background-color: #f9f9f9;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    transition: all 0.2s;
}

/* Quando clica no campo */
.v-input:focus {
    background-color: #fff;
    border-color: var(--accent); /* Cor laranja do tema */
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Botão de Excluir (X) */
.btn-trash {
    background: #ffeff1;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.2s;
}

.btn-trash:hover {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

/* Ajuste Mobile: Inputs ocupam 100% da linha se a tela for pequena */
@media (max-width: 600px) {
    .v-group {
        min-width: 100%; /* Força 1 por linha no celular */
    }
    .btn-trash {
        width: 100%; /* Botão excluir largo no mobile */
        margin-top: 5px;
    }
}