:root {
    --navy: #0D1034;
    --navy-light: #1e2660;
    --orange: #FF6A00;
    --yellow: #FFC107;
    --text: #1f2937;
    --bg: #f3f4f6;
    --white: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;

    --gradient-orange: linear-gradient(135deg, #FF6A00 0%, #FFC107 100%);
    --gradient-navy: linear-gradient(135deg, #0D1034 0%, #1e2660 100%);
    --shadow-sm: 0 2px 8px rgba(13, 16, 52, 0.06);
    --shadow-md: 0 8px 20px rgba(13, 16, 52, 0.10);
    --shadow-lg: 0 16px 36px rgba(13, 16, 52, 0.16);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-pill: 999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', 'Poppins', 'Segoe UI', system-ui, sans-serif; }
body { background-color: var(--bg); color: var(--text); line-height: 1.6; }

.flash-container { position: fixed; top: 1rem; right: 1rem; z-index: 999; display: flex; flex-direction: column; gap: 0.5rem; max-width: 320px; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius-sm); color: white; font-size: 0.9rem; box-shadow: var(--shadow-md); }
.flash-success { background: var(--success); }
.flash-danger { background: var(--danger); }
.flash-warning { background: var(--orange); }
.flash-info { background: var(--navy-light); }

header { background: var(--white); padding: 1rem; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.nav-flex { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.logo { font-size: 1.5rem; font-weight: 900; color: var(--navy); text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
.nav-actions { display: flex; gap: 0.75rem; align-items: center; flex-shrink: 0; }
.btn-whatsapp {
    background: #25D366; color: white; padding: 0.55rem 1.1rem; border-radius: var(--radius-pill);
    text-decoration: none; font-weight: 700; font-size: 0.9rem; transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(37,211,102,0.35); }
.btn-whatsapp .wa-text { display: inline; }

.hero {
    text-align: center; padding: 4rem 1rem; background: var(--gradient-navy); color: white;
    margin-bottom: 2rem; border-radius: 0 0 24px 24px;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; font-weight: 900; }
.hero p { color: #c7cae8; max-width: 600px; margin: 0 auto 1.5rem; }
.badge-local {
    background: rgba(255,106,0,0.15); color: var(--yellow); padding: 0.3rem 0.85rem;
    border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 700; display: inline-block; margin-bottom: 1rem;
}

.category-menu {
    display: flex; gap: 0.6rem; overflow-x: auto; padding: 1rem 0 0.5rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.category-menu::-webkit-scrollbar { display: none; }
.category-chip {
    flex-shrink: 0; padding: 0.5rem 1.1rem; border-radius: var(--radius-pill);
    background: var(--white); color: var(--navy); text-decoration: none; font-weight: 600; font-size: 0.85rem;
    border: 1.5px solid #e5e7eb; transition: all 0.2s; white-space: nowrap;
}
.category-chip:hover { border-color: var(--orange); color: var(--orange); }
.category-chip.active { background: var(--gradient-orange); color: var(--navy); border-color: transparent; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; padding-bottom: 3rem; }
.product-card {
    background: var(--white); border-radius: var(--radius-md); overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s; box-shadow: var(--shadow-sm); border: 1px solid #eef0f4;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.img-placeholder {
    width: 100%; aspect-ratio: 4 / 5; background-color: #e5e7eb;
    display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 0.9rem;
    overflow: hidden;
}
.img-placeholder img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.card-body { padding: 1rem; }
.category { font-size: 0.72rem; color: var(--navy-light); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.product-title { font-size: 1.05rem; font-weight: 700; margin: 0.5rem 0; color: var(--text); }
.price-row { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; }
.price { font-size: 1.3rem; font-weight: 900; color: var(--orange); }
.old-price { text-decoration: line-through; color: #9ca3af; font-size: 0.85rem; }

.btn-buy {
    display: block; width: 100%; padding: 0.75rem; background: var(--gradient-orange); color: var(--navy);
    text-align: center; border-radius: var(--radius-pill); text-decoration: none; font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255,106,0,0.35); }
.btn-shopee { background: #ee4d2d; color: white; }
.btn-ml { background: #ffe600; color: #2d3277; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #6b7280; }

footer { background: var(--navy); color: white; text-align: center; padding: 2rem 1rem; font-size: 0.9rem; }
footer a { color: #9ca3ff; text-decoration: none; }

@media (max-width: 600px) {
    .hero h1 { font-size: 1.6rem; }
    .products-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    header { padding: 0.7rem 0; }
    .logo { font-size: 1.15rem; }
    .nav-actions { gap: 0.5rem; }
    .btn-cart { font-size: 1.2rem; }
    .cart-text { display: none; }
    .btn-whatsapp { padding: 0.5rem; border-radius: 50%; width: 38px; height: 38px; justify-content: center; }
    .btn-whatsapp .wa-text { display: none; }
    .btn-sm { padding: 0.4rem 0.65rem; font-size: 0.75rem; }
}

/* ---------- Painel admin ---------- */
.admin-header { background: var(--navy); color: white; padding: 1rem; }
.admin-header .container { display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: white; text-decoration: none; }
.admin-header .logout { color: #a8acd6; font-size: 0.9rem; }

.admin-content { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.btn {
    display: inline-block; padding: 0.6rem 1.2rem; border-radius: var(--radius-pill);
    text-decoration: none; font-weight: 700; border: none; cursor: pointer; font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--gradient-orange); color: var(--navy); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(255,106,0,0.3); }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 0.9rem; }
.admin-table th { background: #f9fafb; font-weight: 700; }
.admin-table img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.status-active { color: var(--success); font-weight: 700; }
.status-inactive { color: #9ca3af; font-weight: 700; }
.actions-cell { display: flex; gap: 0.5rem; }

.form-card { background: white; padding: 2rem; border-radius: var(--radius-md); max-width: 500px; box-shadow: var(--shadow-sm); }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 700; font-size: 0.9rem; }
.form-group input[type=text], .form-group input[type=number], .form-group input[type=password],
.form-group select { width: 100%; padding: 0.6rem; border: 1px solid #d1d5db; border-radius: var(--radius-sm); font-size: 0.95rem; }
.form-group input[type=checkbox] { margin-right: 0.5rem; }
.form-errors { color: var(--danger); font-size: 0.85rem; margin-top: 0.3rem; }
.current-image { margin-bottom: 0.5rem; }
.current-image img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }

.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--gradient-navy); }

/* ---------- Carrinho / navegação ---------- */
.nav-actions { display: flex; gap: 1rem; align-items: center; }
.btn-cart { position: relative; text-decoration: none; color: var(--navy); display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.95rem; }
.cart-icon-wrap { position: relative; display: inline-flex; font-size: 1.2rem; }
.cart-badge {
    background: var(--orange); color: #fff; border-radius: 50%;
    font-size: 0.65rem; min-width: 16px; height: 16px; display: inline-flex;
    align-items: center; justify-content: center; padding: 0 3px;
    position: absolute; top: -6px; right: -8px; font-weight: 700;
}

.form-add-cart { margin-top: 0.5rem; }
.btn-add-cart {
    width: 100%; padding: 0.6rem; border: 1.5px solid var(--orange); color: var(--orange);
    background: transparent; border-radius: var(--radius-pill); cursor: pointer; font-weight: 700;
    transition: background 0.2s, color 0.2s;
}
.btn-add-cart:hover { background: var(--orange); color: white; }

.cart-container, .checkout-container { padding: 2rem 0; }
.cart-item, .cart-item-line {
    display: flex; justify-content: space-between; padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.cart-item-actions { display: flex; align-items: center; gap: 1rem; }
.btn-remove-cart { background: none; border: none; cursor: pointer; color: #e63946; }
.total-line { font-weight: 700; }
.cart-summary { display: flex; justify-content: space-between; padding: 1rem 0; font-weight: 700; }
.btn-checkout { display: inline-block; margin-top: 1rem; text-align: center; }

.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.checkout-form input[type="text"], .checkout-form input[type="tel"] {
    width: 100%; padding: 0.6rem; margin-bottom: 1rem; border-radius: var(--radius-sm); border: 1px solid #ccc;
}
.modalidade-toggle { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.opcao-modalidade { flex: 1; border: 1px solid #ccc; border-radius: var(--radius-sm); padding: 0.6rem; text-align: center; cursor: pointer; }
.opcao-modalidade input { display: none; }
.opcao-modalidade:has(input:checked) { border-color: var(--orange); background: rgba(255,106,0,0.08); }
.info-retirada { background: rgba(13,16,52,0.05); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; }
.aviso-frete { background: #fff3cd; padding: 0.6rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.aviso-frete.conquistado { background: #d4edda; }
.consent-label { display: flex; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 1rem; align-items: flex-start; }
.checkout-errors { background: #f8d7da; padding: 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }

@media (max-width: 768px) {
    .checkout-grid { grid-template-columns: 1fr; }
}
