/*
 * estilos.css
 * 
 * Estilos principais do projeto_final — Barretos Distribuidora
 * Mantém as mesmas variáveis de tema, cores, fontes e animações
 * do projeto original em React/TailwindCSS.
 */

/* ============================================================
   IMPORTAÇÃO DE FONTES (Google Fonts)
   - Outfit: títulos e headings
   - Plus Jakarta Sans: corpo de texto
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   VARIÁVEIS CSS DE TEMA (idênticas ao projeto original)
   ============================================================ */
:root {
    /* Cor de fundo geral */
    --background: hsl(0, 0%, 97%);
    --foreground: hsl(0, 0%, 12%);

    /* Cartões e containers */
    --card:            hsl(0, 0%, 100%);
    --card-foreground: hsl(0, 0%, 12%);

    /* Cor primária — azul institucional */
    --primary:            #114d85;
    --primary-foreground: hsl(0, 0%, 100%);

    /* Cor secundária — cinza claro */
    --secondary:            hsl(0, 0%, 95%);
    --secondary-foreground: hsl(0, 0%, 12%);

    /* Cor muted (textos discretos) */
    --muted:            hsl(0, 0%, 95%);
    --muted-foreground: hsl(0, 0%, 45%);

    /* Accent (hover de fundos) */
    --accent:            hsl(0, 0%, 95%);
    --accent-foreground: hsl(0, 0%, 12%);

    /* Destructive (erros, sair) */
    --destructive:            hsl(0, 84.2%, 60.2%);
    --destructive-foreground: hsl(0, 0%, 100%);

    /* Bordas e inputs */
    --border: hsl(0, 0%, 90%);
    --input:  hsl(0, 0%, 90%);
    --ring:   #114d85;

    /* Border radius padrão */
    --radius: 0.75rem;

    /* Gradiente primário (azul → azul escuro) */
    --gradient-primary: linear-gradient(135deg, #1a6ab0, #0d3d6a);
    --gradient-hero:    linear-gradient(135deg, #1a6ab0, #0d3d6a);

    /* Sombras */
    --shadow-card:     0 2px 16px -4px rgba(0, 0, 0, 0.05);
    --shadow-elevated: 0 8px 30px -8px rgba(0, 0, 0, 0.18);
}

/* ============================================================
   RESET E BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-color: var(--border);
}

html, body {
    scroll-behavior: smooth;
    background-color: var(--background);
}

/* Remove o espaço lateral (padding-right) que o Bootstrap adiciona automaticamente ao abrir modais */
body.modal-open {
    padding-right: 0 !important;
    overflow-y: hidden;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Headings usam Outfit */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
}

/* ============================================================
   CLASSES UTILITÁRIAS
   ============================================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-hero    { background: var(--gradient-hero); }
.shadow-card         { box-shadow: var(--shadow-card); }
.shadow-elevated     { box-shadow: var(--shadow-elevated); }
.text-primary        { color: var(--primary) !important; }
.text-muted          { color: var(--muted-foreground); }
.text-destructive    { color: var(--destructive); }

/* Gradiente de texto (como .text-gradient-primary do original) */
.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ocultar scrollbar (usado na barra de categorias) */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Line-clamp para limitar texto */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1);   }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* Classes de animação */
.animate-fade-in        { animation: fadeIn 0.4s ease forwards; }
.animate-fade-in-scale  { animation: fadeInScale 0.3s ease forwards; }
.animate-spin           { animation: spin 1s linear infinite; }
.animate-pulse          { animation: pulse 2s ease-in-out infinite; }
.animate-slide-down     { animation: slideDown 0.2s ease forwards; }
.animate-scale-in       { animation: scaleIn 0.2s ease forwards; }

/* ============================================================
   HEADER (CABEÇALHO)
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--card);
    box-shadow: var(--shadow-card);
}

/* Faixa superior (gradiente azul) */
.header-top {
    background: var(--gradient-primary);
    padding: 0.5rem 0;
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-top-text {
    color: var(--primary-foreground);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Botão/Link de usuário no topo */
.header-user-link {
    color: var(--primary-foreground);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: opacity 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.header-user-link:hover { opacity: 0.8; }

/* Seta de dropdown do usuário */
.dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.dropdown-arrow.open { transform: rotate(180deg); }

/* Dropdown de menu do usuário */
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    z-index: 60;
    animation: slideDown 0.2s ease forwards;
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid var(--border);
}

.user-dropdown-header .nome {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-header .nivel {
    font-size: 0.65rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.user-dropdown-body {
    padding: 0.375rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--foreground);
    border-radius: 0.5rem;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
}

.dropdown-item:hover {
    background: hsla(210, 78%, 30%, 0.08);
    color: var(--primary);
}

.dropdown-item.danger { color: var(--destructive); }
.dropdown-item.danger:hover { background: hsla(0, 84%, 60%, 0.08); }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0.5rem;
}

/* Seção principal do header (logo + busca + ícones) */
.header-main {
    padding: 0.75rem 0;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Logo / Título */
.header-logo {
    display: flex;      /* logo + texto lado a lado */
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    min-width: 0;
}

/* Imagem da logo no header — altura proporcional ao container, sem distorção */
.header-logo-img {
    height: 2.6rem;     /* mesma altura do bloco h1 */
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    border-radius: 4px;
}

.header-logo h1 {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
    min-width: 0;
}

.header-logo .marca {
    color: var(--primary);
    display: block;
}

.header-logo .submarca {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Campo de busca (desktop) */
.header-busca {
    flex: 1;
    max-width: 32rem;
    margin: 0 1rem;
    display: none;
}

.busca-wrapper {
    position: relative;
    width: 100%;
}

.busca-icone {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    pointer-events: none;
}

.campo-busca {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--input);
    border-radius: 0.5rem;
    background: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.campo-busca::placeholder { color: var(--muted-foreground); }

.campo-busca:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px hsla(210, 78%, 30%, 0.2);
}

/* Grupo de ícones (carrinho, instagram) */
.header-acoes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-icone {
    position: relative;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--foreground);
    transition: background 0.15s;
    text-decoration: none;
}

.btn-icone:hover { background: var(--accent); }

.btn-icone.instagram:hover {
    background: #f0f4ff;
    color: #e91e63;
}

/* Badge de contagem do carrinho */
.badge-carrinho {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.65rem;
    font-weight: 700;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.2s ease;
}

/* Busca mobile (abaixo do header) */
.header-busca-mobile {
    padding: 0 1rem 0.75rem;
    display: block;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero-banner {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, hsla(210, 78%, 30%, 0.82), hsla(210, 78%, 30%, 0.35));
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 32rem;
    animation: fadeIn 0.6s ease forwards;
}

.hero-content h2 {
    font-size: 1.75rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 0.6rem;
}

.hero-content p {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.hero-btn {
    display: inline-block;
    background: var(--card);
    color: var(--primary);
    font-weight: 700;
    padding: 0.7rem 2rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: transform 0.25s, box-shadow 0.25s;
}

.hero-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-elevated);
    color: var(--primary);
}

/* Promo Banner */
.promo-banner-section {
    max-width: 1280px;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
    width: 100%;
}

.promo-banner-section img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.75rem;
    max-height: 200px;
}

@media (min-width: 768px) {
    .promo-banner-section img {
        max-height: 300px;
    }
}

/* ============================================================
   BARRA DE CATEGORIAS
   ============================================================ */
.categorias-section {
    padding: 1.75rem 0;
}

.categorias-section h3 {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.categorias-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-bottom: 0.75rem;
}

/* Pill (botão) de categoria */
.cat-pill {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    transition: background 0.25s, color 0.25s, transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    margin: 0;
}

.cat-pill:hover {
    background: var(--muted);
    border-color: hsla(210, 78%, 30%, 0.4);
}

.cat-pill.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    transform: scale(1.05);
}

.cat-pill .count {
    font-size: 0.72rem;
    margin-left: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cat-pill.active .count { opacity: 1; }
.cat-pill:hover .count  { opacity: 1; }

/* ============================================================
   SEÇÃO DE PRODUTOS
   ============================================================ */
.produtos-section {
    padding-bottom: 3.5rem;
}

.produtos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.produtos-header h3 {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--foreground);
}

.produtos-header .contagem {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

/* Grid de produtos */
.produtos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ============================================================
   CARD DE PRODUTO
   ============================================================ */
.produto-card {
    background: var(--card);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-card);
    border: 1px solid hsla(0, 0%, 0%, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.35s ease forwards;
    transition: box-shadow 0.3s, transform 0.3s;
}

.produto-card:hover {
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
}

/* Imagem do produto */
.produto-img-link {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--secondary);
    display: block;
}

.produto-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.produto-card:hover .produto-img-link img {
    transform: scale(1.06);
}

/* Badge de marca */
.produto-badge-marca {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Conteúdo do card */
.produto-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.produto-nome-link {
    display: block;
    margin-bottom: 0.5rem;
}

.produto-nome {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    height: 3.1rem; /* Aumentado de 2.5rem para 3.1rem para acomodar 2 linhas de 1.25rem com line-height 1.2 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    transition: color 0.15s;
}

.produto-nome-link:hover .produto-nome { color: var(--primary); }

/* Área inferior do card (preço, qtd, ações) */
.produto-card-footer {
    margin-top: auto;
}

.produto-preco {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* Controles de quantidade */
.qtd-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.qtd-controle {
    display: flex;
    align-items: center;
    background: var(--secondary);
    border-radius: 0.5rem;
    padding: 0.2rem;
}

.qtd-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 700;
    transition: background 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.qtd-btn:hover:not(:disabled) { background: var(--card); }
.qtd-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.qtd-valor {
    width: 2rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--foreground);
}

/* Botões de ação do card (Visualizar / Adicionar) */
.produto-acoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-visualizar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--secondary);
    color: var(--secondary-foreground);
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    transition: background 0.15s;
    text-decoration: none;
}

.btn-visualizar:hover { background: var(--muted); }

.btn-adicionar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s, transform 0.15s;
}

.btn-adicionar:hover { opacity: 0.9; }
.btn-adicionar:active { transform: scale(0.95); }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 0;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.spinner {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1.5rem;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner::before {
    border-top-color: var(--primary);
    border-left-color: var(--primary);
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner::after {
    border-bottom-color: hsla(210, 78%, 30%, 0.2);
    border-right-color: hsla(210, 78%, 30%, 0.2);
    animation: spin 1.2s linear infinite reverse;
}

.loading-wrapper p {
    color: var(--foreground);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    font-family: 'Outfit', sans-serif;
    animation: pulse 2s ease-in-out infinite;
}

/* Mensagem de vazio (Nenhum produto encontrado) */
.produtos-vazio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.vazio-icone {
    width: 6.5rem;
    height: 6.5rem;
    background: #e9f2fb; /* Azul bem claro conforme imagem */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8bb1d6; /* Azul médio para o ícone */
    font-size: 2.75rem;
    transition: transform 0.3s ease;
}

.produtos-vazio:hover .vazio-icone {
    transform: scale(1.05);
}

.produtos-vazio h4 {
    color: #34475e; /* Azul escuro/cinza da tipografia na imagem */
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.paginacao {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.paginacao-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    font-family: inherit;
    min-width: 2.5rem;
    text-align: center;
}

.paginacao-btn:hover:not(:disabled):not(.active) {
    background: var(--accent);
}

.paginacao-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.paginacao-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.paginacao-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    color: var(--muted-foreground);
    font-weight: 700;
}

/* ============================================================
   RODAPÉ (FOOTER)
   ============================================================ */
.rodape {
    background: var(--foreground);
    color: var(--background);
    margin-top: 3rem;
}

.rodape-conteudo {
    padding: 3rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Coluna do rodapé */
.rodape h4 {
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--background);
}

.rodape h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--background);
}

.rodape p, .rodape-info {
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Link Instagram no rodapé */
.rodape-instagram {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    transition: opacity 0.2s;
    width: fit-content;
    margin-top: 0.75rem;
}

.rodape-instagram:hover { opacity: 0.8; color: var(--primary); }

.rodape-instagram .icon-wrapper {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: hsla(210, 78%, 30%, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rodape-instagram:hover .icon-wrapper {
    background: hsla(210, 78%, 30%, 0.25);
}

/* Itens de contato do rodapé */
.rodape-contato-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.rodape-contato-item i {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    transition: transform 0.2s;
}

.rodape-contato-item:hover i { transform: scale(1.15); }

/* Linha de separação / Copyright */
.rodape-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1.25rem 0;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
}

/* ============================================================
   BOTÃO WHATSAPP FLUTUANTE
   ============================================================ */
.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.whatsapp-float * {
    pointer-events: auto;
}

.whatsapp-tooltip {
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-elevated);
    white-space: nowrap;
    animation: fadeIn 0.3s ease forwards;
}

.whatsapp-btn {
    width: 3.5rem;
    height: 3.5rem;
    background: hsl(142, 70%, 45%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-elevated);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    color: white;
}

/* ============================================================
   POSICIONAMENTO RELATIVO DO DROPDOWN DE USUÁRIO
   ============================================================ */
.header-user-wrapper {
    position: relative;
}

/* ============================================================
   RESPONSIVIDADE — BREAKPOINTS
   ============================================================ */

/* Tablets (≥ 768px) */
@media (min-width: 768px) {
    .header-logo h1     { font-size: 1.2rem; }
    .header-logo .submarca { font-size: 0.7rem; }
    .header-top-text    { font-size: 0.875rem; }
    .header-user-link   { font-size: 0.875rem; }

    /* Mostrar busca desktop */
    .header-busca { display: flex; }

    /* Ocultar busca mobile */
    .header-busca-mobile { display: none; }

    .hero-banner { height: 380px; }
    .hero-content h2 { font-size: 2.75rem; }
    .hero-content p  { font-size: 1.05rem; }

    .promo-banner-section img { max-height: 400px; }

    .produtos-grid { grid-template-columns: repeat(3, 1fr); }
    .rodape-conteudo { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile pequenos (≤ 480px) — Empilha os botões do card para não cortar */
@media (max-width: 480px) {
    .produto-acoes {
        grid-template-columns: 1fr;
    }
    .produto-nome {
        font-size: 1rem;
        height: 2.5rem; /* Ajustado para o font-size menor (1rem) no mobile */
    }
    .produto-preco {
        font-size: 1.2rem;
    }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
    .header-logo h1     { font-size: 1.35rem; }
    .hero-banner        { height: 420px; }
    .produtos-grid      { grid-template-columns: repeat(4, 1fr); }
    .header-acoes { gap: 0.75rem; }
}

/* ============================================================
   PÁGINA DE LOGIN / CADASTRO
   ============================================================ */

/* Seção externa — preenche a altura entre o header e o rodapé */
.login-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: var(--background);
}

/* Card central branco */
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-elevated);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    animation: fadeInScale 0.35s ease;
}

/* Logo / marca dentro do card */
.login-logo-link {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: opacity 0.2s;
}

.login-logo-link:hover { opacity: 0.8; }

.login-marca {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.login-submarca {
    font-size: 0.7rem;
    color: var(--muted-foreground);
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0;
    text-transform: uppercase;
}

/* Imagem da logo no card de login — centralizada sem distorção */
.login-logo {
    display: flex;
    justify-content: center;
}

.login-logo-img {
    max-width: 200px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

/* Toggle Entrar / Cadastrar */
.login-toggle {
    display: flex;
    background: var(--secondary);
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    gap: 0.25rem;
}

.login-toggle-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--muted-foreground);
    transition: background 0.2s, color 0.2s;
}

.login-toggle-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* Grupos de campos */
.login-field {
    margin-bottom: 1rem;
}

.login-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.35rem;
}

/* Input padrão */
.login-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    color: var(--foreground);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(210, 78%, 30%, 0.15);
}

/* Wrapper do campo de senha (para posicionar o olho) */
.login-senha-wrapper {
    position: relative;
}

.login-senha-wrapper .login-input {
    padding-right: 2.75rem;
}

/* Botão olho de senha */
.login-olho {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.login-olho:hover { color: var(--foreground); }

/* Link "Esqueci minha senha" */
.login-forgot {
    text-align: right;
    margin-bottom: 0.5rem;
}

.login-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    padding: 0;
    transition: opacity 0.2s;
}

.login-link-btn:hover { opacity: 0.75; text-decoration: underline; }

/* Botão de submit */
.login-submit-btn {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.5rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s, transform 0.15s;
}

.login-submit-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.login-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   PÁGINA DO CARRINHO
   ============================================================ */

/* Seção geral */
.carrinho-section {
    min-height: 70vh;
    background: var(--background);
    padding: 2rem 0 4rem;
}

/* Link "Continuar Comprando" */
.carrinho-voltar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s, gap 0.2s;
    margin-bottom: 1.5rem;
}

.carrinho-voltar:hover {
    color: var(--foreground);
    gap: 0.75rem;
}

/* Título da página */
.carrinho-titulo {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
}

/* Estado vazio */
.carrinho-vazio {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.carrinho-vazio-icone {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--muted-foreground);
    opacity: 0.4;
    font-size: 2rem;
}

.carrinho-vazio h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.carrinho-vazio p {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.carrinho-vazio-btn {
    display: inline-block;
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 700;
    padding: 0.75rem 2.5rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 18px -4px hsla(210, 78%, 30%, 0.45);
}

.carrinho-vazio-btn:hover {
    opacity: 0.9;
    transform: scale(1.04);
    color: var(--primary-foreground);
}

/* Grid principal (itens + resumo) */
.carrinho-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.carrinho-itens-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.carrinho-loading {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

/* Item do carrinho */
.carrinho-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeIn 0.3s ease forwards;
    transition: box-shadow 0.25s;
}

.carrinho-item:hover { box-shadow: var(--shadow-card); }

.carrinho-item-img {
    width: 5rem;
    height: 5rem;
    border-radius: 0.65rem;
    overflow: hidden;
    background: var(--secondary);
    flex-shrink: 0;
}

.carrinho-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carrinho-item-info {
    flex: 1;
    min-width: 0;
}

.carrinho-item-nome {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carrinho-item-preco {
    font-size: 0.875rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.6rem;
}

.carrinho-item-qtd {
    display: flex;
    align-items: center;
    background: var(--secondary);
    border-radius: 0.5rem;
    padding: 0.2rem;
    width: fit-content;
    border: 1px solid var(--border);
}

.carrinho-item-acoes {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

.carrinho-item-subtotal {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--foreground);
}

.carrinho-item-remover {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    font-size: 0.9rem;
}

.carrinho-item-remover:hover {
    color: var(--destructive);
    background: hsla(0, 84%, 60%, 0.08);
}

/* Painel lateral (resumo) */
.carrinho-resumo-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 5rem;
}

.carrinho-resumo-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

/* Método de entrega */
.metodo-entrega-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.metodo-btn {
    padding: 0.875rem 0.5rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--muted-foreground);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.metodo-btn i { font-size: 1.35rem; }

.metodo-btn.ativo {
    border-color: var(--primary);
    color: var(--primary);
    background: hsla(210, 78%, 30%, 0.06);
}

.metodo-btn:hover:not(.ativo) {
    border-color: hsla(210, 78%, 30%, 0.3);
    color: var(--foreground);
}

/* Endereço de entrega */
.carrinho-endereco {
    background: var(--secondary);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    animation: fadeIn 0.2s ease;
}

.carrinho-endereco-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.carrinho-endereco-texto {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.carrinho-endereco-link {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.carrinho-endereco-link:hover {
    opacity: 0.75;
    color: var(--primary);
}

/* Frete */
.carrinho-frete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted-foreground);
    animation: fadeIn 0.2s ease;
}

.carrinho-frete-valor {
    font-size: 0.7rem;
    font-weight: 700;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Divisor */
.carrinho-divider {
    height: 1px;
    background: var(--border);
    margin: 0.75rem 0;
}

/* Totais */
.carrinho-totais {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.carrinho-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.carrinho-total-row.destaque {
    color: var(--foreground);
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

.carrinho-total-preco {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
}

/* Botão Finalizar Pedido */
.btn-finalizar {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 18px -4px hsla(210, 78%, 30%, 0.45);
    transition: opacity 0.2s, transform 0.2s;
}

.btn-finalizar:hover:not(:disabled) {
    opacity: 0.92;
    transform: scale(1.02);
}

.btn-finalizar:active:not(:disabled) { transform: scale(0.98); }

.btn-finalizar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner dentro do botão finalizar */
.spinner-finalizar {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Responsividade do carrinho */
@media (min-width: 768px) {
    .carrinho-titulo { font-size: 2rem; }

    .carrinho-grid {
        grid-template-columns: 1fr 360px;
        align-items: start;
    }

    .carrinho-item-nome { font-size: 1rem; }
}

@media (min-width: 1024px) {
    .carrinho-grid { grid-template-columns: 1fr 380px; }
}

/* SweetAlert2 — bordas arredondadas customizadas */
.rounded-swal { border-radius: 1rem !important; }

/* ============================================================
   PÁGINA DE DETALHES DO PRODUTO (produto.php)
   ============================================================ */
.pagina-detalhe .btn-voltar {
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
}

.pagina-detalhe .btn-voltar:hover {
    color: var(--primary) !important;
    transform: translateX(-4px);
}

.fw-black { font-weight: 900 !important; }

.scale-hover {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

.scale-hover:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px -10px hsla(210, 78%, 30%, 0.5) !important;
}

.scale-hover:active {
    transform: scale(0.98);
}

.product-card-hover {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.product-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevated) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* Estilização extra para o badge de categoria */
.badge.bg-secondary-subtle {
    background-color: hsla(0, 0%, 0%, 0.04) !important;
    color: var(--muted-foreground) !important;
}

/* Botão Adicionar ao Carrinho — página de detalhes (cor primária do tema) */
.btn-detalhe-adicionar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--primary-foreground);
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 15px -5px hsla(210, 78%, 30%, 0.45);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-detalhe-adicionar:hover {
    opacity: 0.92;
}

.btn-detalhe-adicionar:active {
    transform: scale(0.97);
}

/* Linha de quantidade na página de detalhe — alinhamento com label lateral */
.pagina-detalhe .qtd-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

