:root {
  --ink: #1B2430;
  --bg: #EEF1F5;
  --surface: #FFFFFF;
  --accent: #0F8B6C;
  --accent-dark: #0C6E56;
  --amber: #E8A33D;
  --muted: #5B6472;
  --border: #DDE3E9;
  --admin-navy: #14213D;
  --admin-navy-2: #1C2B4F;
  --radius: 8px;
  --danger: #D64545;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .5rem; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--ink); color: #C9D4DE; font-size: 13px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar a { color: #C9D4DE; }
.topbar a:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-main { display: flex; align-items: center; gap: 24px; padding: 16px 0; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent-dark); white-space: nowrap; }
.search-form { flex: 1; display: flex; }
.search-form input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius); font-size: 14px; background: var(--bg);
}
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-form button {
  background: var(--accent); color: #fff; border: none; padding: 0 18px;
  border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600;
}
.search-form button:hover { background: var(--accent-dark); }
.header-actions { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 500; }
.header-actions a { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cart-badge {
  background: var(--amber); color: var(--ink); border-radius: 999px; font-size: 11px;
  padding: 1px 7px; font-weight: 700; margin-left: 2px;
}

/* ---------- Category nav ---------- */
.category-nav { background: var(--accent-dark); }
.category-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; overflow-x: auto; }
.category-nav a { display: block; padding: 12px 18px; color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; }
.category-nav a:hover, .category-nav a.active { background: rgba(0,0,0,.18); }

/* ---------- Banner carousel ---------- */
.carousel { position: relative; overflow: hidden; background: var(--ink); aspect-ratio: 16/5; max-height: 340px; }
.carousel-track { display: flex; height: 100%; transition: transform .6s ease; }
.carousel-slide { flex: 0 0 100%; position: relative; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-caption {
  position: absolute; left: 6%; bottom: 12%; color: #fff; max-width: 480px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.carousel-caption h2 { font-size: clamp(20px, 3vw, 34px); margin-bottom: 6px; }
.carousel-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.carousel-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.45);
}
.carousel-dots button.active { background: #fff; }

/* ---------- Sections / product grid ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; }
.section-head a { font-size: 14px; color: var(--accent-dark); font-weight: 600; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product-card .thumb { aspect-ratio: 1; background: #F5F7F9; display: flex; align-items: center; justify-content: center; padding: 18px; }
.product-card .info { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { font-size: 15px; font-weight: 600; font-family: var(--font-body); }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--accent-dark); }
.price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.badge-pix { display: inline-block; font-size: 11px; font-weight: 700; color: var(--ink); background: var(--amber); padding: 2px 8px; border-radius: 4px; width: fit-content; }
.btn { display: inline-block; padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); }
.btn-block { width: 100%; text-align: center; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
form .btn { border: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--admin-navy); color: #B9C3D6; padding: 48px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.site-footer a { color: #B9C3D6; display: block; margin-bottom: 6px; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-map { border-radius: var(--radius); overflow: hidden; border: 0; width: 100%; height: 150px; }
.footer-bottom { text-align: center; font-size: 12px; color: #7C8AA3; margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- Generic page layout ---------- */
.page-header { padding: 28px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--accent-dark); }

/* ---------- Forms / auth ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; background: var(--surface);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #FBE7E7; color: #A32C2C; }
.alert-success { background: #E3F5EC; color: var(--accent-dark); }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 420px 1fr; gap: 40px; padding: 28px 0 50px; }
.product-detail .thumb { background: #F5F7F9; border-radius: var(--radius); padding: 30px; }
.qty-input { width: 70px; }

/* ---------- Cart / checkout ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding: 28px 0 60px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line img { width: 70px; height: 70px; object-fit: contain; background: #F5F7F9; border-radius: 6px; padding: 6px; }
.summary-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.summary-row.total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.payment-options { display: flex; gap: 10px; margin: 14px 0; }
.payment-options label { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; font-size: 13px; font-weight: 600; }

/* ---------- Timeline (order tracking) ---------- */
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-aberto { background: #EAEAEA; color: #555; }
.status-pagamento_confirmado { background: #DCEFFF; color: #1663B5; }
.status-em_preparacao { background: #FDECC8; color: #92620A; }
.status-enviado { background: #E1E4FF; color: #4338CA; }
.status-concluido { background: #DFF5E7; color: #0C6E56; }
.status-cancelado { background: #FBE0E0; color: #A32C2C; }

.timeline { position: relative; margin-left: 8px; padding-left: 30px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -39px; top: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--border); border: 3px solid var(--bg);
}
.timeline-item.done::before { background: var(--accent); }
.timeline-item h4 { font-size: 15px; margin-bottom: 2px; }
.timeline-item time { font-size: 12px; color: var(--muted); }
.timeline-item p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* ---------- Orders list (profile) ---------- */
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 30px 0 60px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.contact-map { width: 100%; height: 100%; min-height: 340px; border: 0; border-radius: var(--radius); }

/* ---------- Admin layout ---------- */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 230px; background: var(--admin-navy); color: #C9D4DE; flex-shrink: 0; }
.admin-sidebar .brand { padding: 20px; font-family: var(--font-display); font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-sidebar nav a { display: block; padding: 11px 20px; font-size: 14px; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: var(--admin-navy-2); color: #fff; }
.admin-sidebar .divider { padding: 14px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6E7DA0; }
.admin-main { flex: 1; padding: 28px 34px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-box .num { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-box .label { font-size: 12px; color: var(--muted); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); padding: 10px 8px; }
table.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.admin-table img.thumb-sm { width: 40px; height: 40px; object-fit: contain; background: #F5F7F9; border-radius: 4px; }
.actions-cell { display: flex; gap: 8px; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.help-text { font-size: 12px; color: var(--muted); margin-top: 4px; }

@media (max-width: 860px) {
  .header-main { flex-wrap: wrap; }
  .search-form { order: 3; flex-basis: 100%; }
  .product-detail, .cart-layout, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
