/* ============================================================
   Via Nortte Atacado — Store Stylesheet
   ============================================================ */

:root {
    --primary: #1e3a8a;        /* deep blue */
    --primary-dark: #172b63;
    --accent: #f97316;         /* orange */
    --accent-dark: #ea580c;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #16a34a;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(17, 24, 39, .07);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, .16);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    width: min(1200px, 92%);
    margin-inline: auto;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ===== Top bar ===== */
.topbar {
    background: var(--primary-dark);
    color: #cbd5e1;
    font-size: .78rem;
    padding: 6px 0;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.topbar-links { display: flex; gap: 18px; }
.topbar a { color: #fbbf77; }
.topbar a:hover { text-decoration: underline; }

/* ===== Header ===== */
.header {
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), #3b5bd9);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: 10px;
}
.logo-text {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    line-height: 1.15;
    display: flex;
    flex-direction: column;
}
.logo-text small {
    font-size: .68rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Search */
.search-box {
    flex: 1;
    display: flex;
    max-width: 560px;
    border: 2px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 18px;
    font-size: .92rem;
    font-family: inherit;
    background: transparent;
}
.search-box button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 20px;
    display: grid;
    place-items: center;
    transition: background .2s;
}
.search-box button:hover { background: var(--primary-dark); }

/* Cart button */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 2px solid var(--border);
    border-radius: 999px;
    padding: 9px 18px;
    color: var(--primary);
    font-weight: 600;
    font-size: .9rem;
    margin-left: auto;
    transition: border-color .2s, background .2s;
}
.cart-btn:hover { border-color: var(--primary); background: #eef2ff; }
.cart-count {
    position: absolute;
    top: -7px; right: 8px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    display: grid;
    place-items: center;
}

/* Category nav */
.cat-nav {
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.cat-nav-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-link {
    border: none;
    background: none;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background .2s, color .2s;
}
.cat-link:hover { background: #eef2ff; color: var(--primary); }
.cat-link.active { background: var(--primary); color: #fff; }

/* ===== Banner ===== */
.banner {
    background:
        radial-gradient(1000px 400px at 85% -20%, rgba(249, 115, 22, .25), transparent 60%),
        linear-gradient(120deg, var(--primary-dark), var(--primary) 65%, #2b4bb5);
    color: #fff;
    padding: 64px 0 56px;
}
.banner-inner {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 48px;
    align-items: center;
}
.banner-badge {
    display: inline-block;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 18px;
}
.banner h1 {
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
}
.banner h1 em {
    font-style: normal;
    color: #fdba74;
}
.banner p {
    color: #dbeafe;
    max-width: 52ch;
    margin-bottom: 26px;
}
.banner-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.banner-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.hl-card {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    backdrop-filter: blur(4px);
}
.hl-card strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fdba74;
}
.hl-card span { font-size: .82rem; color: #dbeafe; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .92rem;
    border: 2px solid transparent;
    transition: transform .15s, background .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
}
.banner .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-block { display: block; width: 100%; text-align: center; }
.cart-foot .btn-ghost { border-color: var(--border); color: var(--text-muted); }
.cart-foot .btn-ghost:hover { border-color: var(--danger); color: var(--danger); }

/* ===== Sections ===== */
.section-head {
    text-align: center;
    margin-bottom: 36px;
}
.section-head h2 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}
.section-head p { color: var(--text-muted); }
.section-head.light h2 { color: #fff; }
.section-head.light p { color: #dbeafe; }

/* ===== Product grid ===== */
.products-section { padding: 56px 0 64px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-thumb {
    position: relative;
    height: 180px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #f1f5f9;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.product-card:hover .product-thumb img {
    transform: scale(1.06);
}
.thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.4rem;
}
.product-badge {
    position: absolute;
    top: 10px; left: 10px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
}
.badge-oferta { background: var(--danger); }
.badge-top { background: var(--accent); }
.badge-novo { background: var(--success); }

.product-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.product-cat {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent-dark);
}
.product-name {
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.35;
}
.product-pack {
    font-size: .8rem;
    color: var(--text-muted);
}
.product-price-row {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}
.product-unit {
    font-size: .74rem;
    color: var(--text-muted);
}
.add-btn {
    margin-top: 10px;
    width: 100%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    padding: 11px;
    border-radius: 9px;
    transition: background .2s, transform .15s;
}
.add-btn:hover { background: var(--primary-dark); }
.add-btn:active { transform: scale(.97); }

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 0;
    font-size: 1.05rem;
}

/* ===== Advantages ===== */
.advantages {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 60px 0;
}
.adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}
.adv-card {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    padding: 26px 22px;
    color: #eff6ff;
}
.adv-icon { font-size: 1.9rem; display: block; margin-bottom: 12px; }
.adv-card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.adv-card p { font-size: .86rem; color: #cbd5e1; }

/* ===== How to buy ===== */
.how-to { padding: 60px 0; }
.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
    counter-reset: step;
}
.steps li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    text-align: center;
}
.steps li span {
    display: inline-grid;
    place-items: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 12px;
}
.steps h3 { font-size: 1rem; margin-bottom: 6px; }
.steps p { font-size: .85rem; color: var(--text-muted); }

/* ===== Footer ===== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding-top: 52px;
    font-size: .88rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 40px;
}
.footer-logo { margin-bottom: 14px; }
.footer-logo .logo-text { color: #fff; }
.footer-col h4 {
    color: #fff;
    font-size: .95rem;
    margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a:hover { color: #fdba74; }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 16px 0;
    text-align: center;
    font-size: .8rem;
}
.footer-legal-links {
    display: inline-block;
    margin-left: 12px;
}
.footer-legal-links a {
    color: #94a3b8;
    transition: color .2s;
}
.footer-legal-links a:hover {
    color: #fdba74;
}
.footer-sep {
    margin: 0 8px;
    color: #475569;
}

/* ===== Cart drawer ===== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s;
    z-index: 200;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(400px, 100%);
    background: var(--surface);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .28s ease;
    box-shadow: var(--shadow-lg);
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.cart-head h3 { font-size: 1.05rem; color: var(--primary); }
.cart-close {
    border: none;
    background: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--text-muted);
}
.cart-close:hover { color: var(--danger); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cart-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: .92rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
}
.cart-item-thumb {
    width: 52px; height: 52px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #f1f5f9;
}
.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cart-item-thumb .thumb-fallback {
    font-size: 1.4rem;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-info h4 { font-size: .84rem; line-height: 1.3; }
.cart-item-info .pack { font-size: .72rem; color: var(--text-muted); }
.cart-item-info .price {
    font-size: .86rem;
    font-weight: 700;
    color: var(--primary);
}
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
}
.qty-control button {
    border: none;
    background: none;
    width: 26px; height: 26px;
    font-weight: 700;
    color: var(--primary);
}
.qty-control button:hover { color: var(--accent-dark); }
.qty-control .qty {
    min-width: 26px;
    text-align: center;
    font-size: .84rem;
    font-weight: 600;
}
.remove-item {
    border: none;
    background: none;
    font-size: .72rem;
    color: var(--danger);
    text-decoration: underline;
}

.cart-foot {
    border-top: 1px solid var(--border);
    padding: 18px 22px 22px;
    display: grid;
    gap: 10px;
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}
.cart-total-row strong { color: var(--primary); font-size: 1.2rem; }
.cart-note { font-size: .74rem; color: var(--text-muted); }
.cart-foot .btn { border-radius: 10px; padding: 12px; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translate(-50%, 80px);
    background: #0f172a;
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    opacity: 0;
    transition: transform .3s, opacity .3s;
    z-index: 300;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}
.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* ===== Legal Pages ===== */
.legal-page {
    padding: 56px 0 64px;
    background: var(--bg);
    min-height: 60vh;
}

.legal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 52px;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.legal-content h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}

.legal-update {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.legal-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 32px;
    margin-bottom: 10px;
}

.legal-content h3 {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 18px;
    margin-bottom: 8px;
}

.legal-content p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--text);
}

.legal-content ul {
    margin-bottom: 14px;
    padding-left: 22px;
    display: grid;
    gap: 6px;
}

.legal-content ul li {
    line-height: 1.6;
    color: var(--text);
}

.legal-content a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--accent-dark);
}

@media (max-width: 640px) {
    .legal-content {
        padding: 28px 22px;
    }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .banner-inner { grid-template-columns: 1fr; gap: 32px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
    .cart-label { display: none; }
    .cart-btn { padding: 9px 14px; }
    .footer-grid { grid-template-columns: 1fr; }
    .banner { padding: 44px 0; }
}
