/* ==========================================================================
   Loja ABBAA • Brasil Sem Alergia — Catálogo Hipoalergênico + Mercado Livre
   Design Clínico Moderno, Responsivo e Focado em Conversão de Afiliados
   ========================================================================== */
:root {
    --brand-primary: #0d6e5b;
    --brand-primary-dark: #084c3e;
    --brand-primary-soft: #ecfdf5;
    --brand-accent: #10b981;
    --ml-yellow: #ffe600;
    --ml-blue: #3483fa;
    --ml-blue-hover: #2968c8;
    --ml-navy: #2d3277;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    --border-soft: #e2e8f0;
    --bg-page: #f8fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 16px 36px rgba(13, 110, 91, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-main);
    background: var(--bg-page);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Trust Bar */
.topbar {
    background: var(--brand-primary-dark);
    color: #e2f8f2;
    font-size: 0.82rem;
    padding: 8px 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-pill {
    background: var(--ml-yellow);
    color: #1e293b;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    flex-wrap: wrap;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(13, 110, 91, 0.25);
}

.brand-text strong {
    display: block;
    font-size: 1.12rem;
    color: var(--brand-primary-dark);
    letter-spacing: -0.02em;
}

.brand-text span {
    display: block;
    font-size: 0.76rem;
    color: var(--text-light);
}

.search-form {
    flex: 1;
    max-width: 520px;
    display: flex;
    background: #f1f5f9;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 4px 6px 4px 16px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
    background: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 91, 0.12);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.93rem;
    color: var(--text-main);
    outline: none;
}

.search-form button {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--brand-primary-dark);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.header-nav a:hover {
    color: var(--brand-primary);
}

.header-nav .nav-admin-link {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    font-size: 0.82rem;
    background: #fff;
}

/* Hero Banner */
.hero-section {
    background: linear-gradient(125deg, #073b30 0%, #0d6e5b 58%, #0f8a72 100%);
    color: #fff;
    padding: 40px 0 36px;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.hero-section h1 {
    margin: 0 0 12px;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.hero-section p {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    max-width: 600px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-badge-item {
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.83rem;
    font-weight: 500;
}

.hero-ml-box {
    background: rgba(255, 255, 255, 0.97);
    color: var(--text-main);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-lg);
}

.hero-ml-box h3 {
    margin: 6px 0 8px;
    font-size: 1.05rem;
    color: var(--brand-primary-dark);
}

.hero-ml-box ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.hero-ml-box li {
    margin-bottom: 5px;
}

/* Filter Strip & Layout */
.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    padding: 32px 0 56px;
    align-items: start;
}

.sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.sidebar-card h3 {
    margin: 0 0 12px;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
}

.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-list li {
    margin-bottom: 3px;
}

.cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}

.cat-list a:hover,
.cat-list a.active {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    font-weight: 600;
}

.cat-list .subcat {
    padding-left: 22px;
    font-size: 0.83rem;
}

.cat-count {
    font-size: 0.74rem;
    background: #f1f5f9;
    color: var(--text-light);
    padding: 1px 7px;
    border-radius: 999px;
}

.brand-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.brand-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #fff;
    transition: all 0.15s;
}

.brand-chip:hover,
.brand-chip.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* Toolbar */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--bg-white);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
}

.toolbar-select {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    font-size: 0.87rem;
    background: #fff;
    color: var(--text-main);
}

/* Product Grid & Cards (.card-produto conforme PDF) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 20px;
}

.card-produto {
    background: var(--bg-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.card-produto:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.card-thumb-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    overflow: hidden;
}

.card-thumb-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.28s ease;
}

.card-produto:hover .card-thumb-wrap img {
    transform: scale(1.05);
}

.card-badges-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 700;
}

.badge-discount {
    background: #dcfce7;
    color: #15803d;
}

.badge-freeship {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-ml-verified {
    background: var(--ml-yellow);
    color: #1e293b;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #f1f5f9; color: #475569; }

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-brand {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    margin-bottom: 4px;
}

.card-produto h3 {
    margin: 0 0 8px;
    font-size: 0.96rem;
    line-height: 1.38;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.65em;
}

.card-produto h3 a:hover {
    color: var(--brand-primary);
}

.card-resumo {
    margin: 0 0 12px;
    font-size: 0.81rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price-block {
    margin-top: auto;
    padding-top: 8px;
}

.preco-original {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin: 0;
}

.preco {
    font-size: 1.32rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 2px 0 10px;
    letter-spacing: -0.02em;
}

/* Botão Oficial de Compra Afiliado (conforme PDF) */
.botao-comprar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--ml-blue);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
    box-shadow: 0 3px 10px rgba(52, 131, 250, 0.25);
}

.botao-comprar:hover {
    background: var(--ml-blue-hover);
    color: #ffffff;
}

.botao-comprar-lg {
    padding: 15px 22px;
    font-size: 1.02rem;
    border-radius: 12px;
}

.botao-detalhes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    border: 1px solid #a7f3d0;
    font-weight: 600;
    font-size: 0.86rem;
    transition: background 0.18s;
}

.botao-detalhes:hover {
    background: #d1fae5;
}

.botao-indisponivel {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
}

/* Single Product Page */
.product-detail-card {
    background: var(--bg-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 28px 0;
    box-shadow: var(--shadow-sm);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 36px;
    align-items: start;
}

.gallery-main {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #fff;
}

.gallery-main img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.gallery-thumb-btn {
    width: 68px;
    height: 68px;
    border: 2px solid var(--border-soft);
    border-radius: 10px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb-btn.active,
.gallery-thumb-btn:hover {
    border-color: var(--brand-primary);
}

.gallery-thumb-btn img {
    max-height: 100%;
    object-fit: contain;
}

.ml-trust-notice {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: 0.84rem;
    color: #78350f;
}

.product-description-box {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border-soft);
}

.product-description-box h2 {
    font-size: 1.25rem;
    color: var(--brand-primary-dark);
    margin-top: 0;
}

/* Blog Cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    margin: 28px 0 48px;
}

.blog-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.blog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 44px 0 28px;
    margin-top: 48px;
    font-size: 0.88rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}

.site-footer h4 {
    color: #fff;
    margin: 0 0 12px;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 18px;
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ==========================================================================
   Painel Administrativo (/admin/)
   ========================================================================== */
.bg-soft { background: #f1f5f9; }

.surface-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}

.admin-topbar {
    background: #0f172a;
    color: #fff;
    padding: 14px 0;
    margin-bottom: 26px;
}

.admin-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #cbd5e1;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}

.kpi-card span {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

.kpi-card strong {
    display: block;
    font-size: 1.65rem;
    margin-top: 4px;
    color: var(--text-main);
}

.btn-primary, .btn-ml, .btn-outline, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--brand-primary-dark); }

.btn-ml {
    background: var(--ml-yellow);
    color: #1e293b;
    border-color: #eab308;
    font-weight: 700;
}
.btn-ml:hover { background: #facc15; }

.btn-outline {
    background: #fff;
    border-color: var(--border-soft);
    color: var(--text-main);
}
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-sm {
    padding: 6px 11px;
    font-size: 0.8rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 91, 0.12);
}

.alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.alert-danger  { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-info    { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.code-box {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: 8px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.81rem;
    overflow-x: auto;
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 920px) {
    .hero-grid,
    .catalog-layout,
    .product-detail-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
