/* ============================================================
   Giro Grill — estilos gerais (site público + painel interno)
   ==========================================================*/
:root {
  --color-primary: #d9481f;
  --color-primary-dark: #b53a17;
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #201c1a;
  --color-text-muted: #6b625c;
  --color-border: #e8e1da;
  --color-success: #1e8e5a;
  --color-error: #c62828;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30, 20, 10, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); line-height: 1.45; }
a { color: var(--color-primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; }
p { margin: 0 0 10px; }
img { max-width: 100%; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: opacity .15s;
}
.btn:hover { opacity: .9; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-secondary { background: #f0ebe4; color: var(--color-text); }
.btn-danger { background: #fdecea; color: var(--color-error); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-block { width: 100%; }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.alert-success { background: #e6f6ee; color: var(--color-success); }
.alert-error { background: #fdecea; color: var(--color-error); }
.alert-info { background: #eaf2fb; color: #2258a8; }

.hint { color: var(--color-text-muted); font-size: 13.5px; }
.badge { display: inline-block; background: #f0ebe4; padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.icon { display: inline-block; vertical-align: -4px; }

/* ---------- Site público: cabeçalho ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 20;
}
.site-logo { font-size: 19px; font-weight: 800; color: var(--color-text); }
.site-nav { display: flex; align-items: center; gap: 18px; font-weight: 600; }
.cart-link { position: relative; }
.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 20px;
  background: var(--color-primary); color: #fff; font-size: 11px; margin-left: 4px;
}
.store-closed-banner { background: #fdecea; color: var(--color-error); text-align: center; padding: 8px; font-size: 13.5px; }
.site-main { max-width: 900px; margin: 0 auto; padding: 20px; min-height: 60vh; }
.site-footer { text-align: center; color: var(--color-text-muted); font-size: 13px; padding: 30px 20px; }

.menu-hero { text-align: center; padding: 20px 0 26px; }
.menu-hero h1 { font-size: 26px; }
.menu-hero p { color: var(--color-text-muted); }

.menu-section { margin-bottom: 28px; }
.menu-section-title { font-size: 18px; border-bottom: 2px solid var(--color-border); padding-bottom: 8px; margin-bottom: 14px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.product-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; text-align: left; cursor: pointer; padding: 0; box-shadow: var(--shadow); font: inherit; color: inherit;
}
.product-card-img { width: 100%; height: 140px; object-fit: cover; }
.product-card-img-placeholder { display: flex; align-items: center; justify-content: center; background: #f0ebe4; color: var(--color-text-muted); }
.product-card-body { padding: 12px 14px 14px; }
.product-card-body h3 { font-size: 15.5px; }
.product-card-desc { color: var(--color-text-muted); font-size: 13px; margin-bottom: 8px; }
.product-card-price { font-weight: 700; color: var(--color-primary); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--color-text-muted); }
.empty-state .btn { margin-top: 12px; }

.page-header { margin-bottom: 18px; }
.page-header-narrow h1 { font-size: 22px; }

/* ---------- Modal de produto ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(20, 14, 10, .5);
  align-items: flex-end; justify-content: center; z-index: 100;
}
.modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden; }
.modal-box {
  background: var(--color-surface); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 22px; position: relative;
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 18px; }
}
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--color-text-muted); }
.modal-product-img { width: 100%; height: 170px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }
.modal-product-title { font-size: 19px; }
.modal-product-desc { color: var(--color-text-muted); font-size: 14px; }
.modal-product-price { font-size: 19px; font-weight: 700; color: var(--color-primary); }
.modal-section { margin: 16px 0; }
.modal-section h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted); }
.modal-section textarea { width: 100%; border: 1px solid var(--color-border); border-radius: 10px; padding: 10px; font: inherit; resize: vertical; }
.modal-qty-row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; }
.modal-add-btn { margin-top: 6px; }

.qty-stepper { display: flex; align-items: center; gap: 12px; }
.qty-stepper button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--color-border);
  background: #fff; font-size: 18px; cursor: pointer; line-height: 1;
}
.qty-stepper-sm button { width: 26px; height: 26px; font-size: 15px; }

/* ---------- Carrinho / checkout ---------- */
.cart-items-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cart-item-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px 14px; }
.cart-item-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cart-item-info h3 { font-size: 15px; margin-bottom: 2px; }
.item-note { font-size: 12.5px; color: var(--color-text-muted); }
.item-note-inline { font-size: 12.5px; color: var(--color-text-muted); font-weight: 400; }
.cart-item-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.cart-item-price { font-weight: 700; min-width: 74px; text-align: right; }
.cart-item-btns { display: flex; align-items: center; gap: 10px; }
.edit-item-btn { background: none; border: none; color: var(--color-primary); font-size: 13px; font-weight: 700; cursor: pointer; }
.remove-item-btn { background: none; border: none; color: var(--color-error); font-size: 13px; cursor: pointer; }

/* ---------- Ingredientes no modal (remover / extra) ---------- */
.ingredient-check {
  display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--color-border);
  font-weight: 500; font-size: 14.5px; cursor: pointer;
}
.ingredient-check:last-child { border-bottom: none; }
.ingredient-check input { width: 18px; height: 18px; accent-color: var(--color-primary); flex-shrink: 0; }
.ingredient-check span:first-of-type { flex: 1; }
.ingredient-extra-price { color: var(--color-text-muted); font-size: 13px; font-weight: 600; }
.modal-add-another-btn { margin-top: 8px; }
.modal-added-toast { text-align: center; }

.cart-summary, .checkout-summary { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 4px 0; }
.total-row { font-weight: 700; font-size: 17px; border-top: 1px solid var(--color-border); margin-top: 6px; padding-top: 10px; }

.floating-cart-bar { position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 30; }
.floating-cart-bar a {
  display: flex; justify-content: space-between; align-items: center; background: var(--color-primary); color: #fff;
  padding: 14px 20px; border-radius: 14px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.floating-cart-bar.bump a { animation: bump .35s ease; }
@keyframes bump { 0%{transform:scale(1)} 50%{transform:scale(1.03)} 100%{transform:scale(1)} }

.checkout-form { display: flex; flex-direction: column; gap: 18px; }
.checkout-step { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; }
.checkout-step label { display: block; margin-bottom: 12px; font-size: 13.5px; font-weight: 600; color: var(--color-text-muted); }
.checkout-step input, .checkout-step textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--color-border);
  border-radius: 10px; font: inherit; color: var(--color-text);
}
.checkout-step input[readonly] { background: #f6f2ec; color: var(--color-text-muted); }

.segmented-control { display: flex; gap: 8px; margin-top: 6px; }
.segmented-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 10px; border: 1px solid var(--color-border); border-radius: 10px;
  background: #fff; color: var(--color-text); font-weight: 700; font-size: 14px; cursor: pointer;
}
.segmented-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.field-hint { display: block; margin-top: 4px; font-size: 12.5px; color: var(--color-text-muted); font-weight: 500; }
.freight-result { margin-top: 10px; }
.freight-result .alert { margin-bottom: 0; }

/* ---------- Forms genéricos (login, admin) ---------- */
label { font-size: 13.5px; font-weight: 600; color: var(--color-text-muted); }
input, select, textarea, button { font-family: inherit; }

/* ---------- Login do admin ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(160deg, #241a14, #402a1c); }
.login-box { background: var(--color-surface); border-radius: 18px; padding: 34px 30px; width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-box h1 { text-align: center; font-size: 22px; }
.login-subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 18px; }
.login-box label { display: block; margin-bottom: 14px; }
.login-box input { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; }

/* ---------- Painel administrativo ---------- */
.admin-body { background: var(--color-bg); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #201510; color: #f2e9e2; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.admin-sidebar-brand { font-weight: 800; font-size: 18px; padding: 20px 18px 14px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; overflow-y: auto; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #cdbfb4; font-weight: 600; font-size: 14px;
}
.admin-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav-item.active { background: var(--color-primary); color: #fff; }
.admin-sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.admin-user { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #cdbfb4; }
.admin-logout-link { display: flex; align-items: center; gap: 8px; color: #f2b9a4; }

.admin-content { flex: 1; min-width: 0; }
.admin-topbar { display: flex; align-items: center; gap: 12px; padding: 18px 24px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.admin-topbar h1 { font-size: 19px; }
.admin-menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.admin-main { padding: 22px 24px 50px; max-width: 1100px; }

.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-narrow { max-width: 560px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-header h2 { font-size: 17px; margin: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 6px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-label { display: block; font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-card-good .stat-value { color: var(--color-success); }
.stat-card-bad .stat-value { color: var(--color-error); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--color-border); text-align: left; }
.admin-table th { color: var(--color-text-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em; }
.admin-table tfoot td { border-top: 2px solid var(--color-border); border-bottom: none; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.admin-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }

.admin-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.admin-form label { display: block; }
.admin-form input[type=text], .admin-form input[type=email], .admin-form input[type=password],
.admin-form input[type=number], .admin-form input[type=date], .admin-form input[type=month],
.admin-form select, .admin-form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--color-border);
  border-radius: 10px; font: inherit; color: var(--color-text);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox-inline input { width: auto; margin: 0; }
.current-image-preview { display: flex; align-items: center; gap: 12px; margin-top: -6px; }
.current-image-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

.inline-form, .filters-row, .inline-search-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form input, .filters-row input, .filters-row select, .inline-search-form input {
  padding: 9px 11px; border: 1px solid var(--color-border); border-radius: 9px; font: inherit;
}
.filters-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }

.form-divider { border: none; border-top: 1px solid var(--color-border); margin: 18px 0; }
.dynamic-block { margin-top: 10px; margin-bottom: 4px; }
.dynamic-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.dynamic-row input { padding: 9px 11px; border: 1px solid var(--color-border); border-radius: 9px; font: inherit; }

.tracking-message { color: var(--color-text-muted); margin-bottom: 16px; }
.tracking-steps { display: flex; flex-direction: column; gap: 2px; }
.tracking-step {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--color-text-muted);
  border-left: 2px solid var(--color-border); margin-left: 13px; padding-left: 18px; position: relative;
}
.tracking-step:first-child { border-top-left-radius: 4px; }
.tracking-step:last-child { border-left-color: transparent; }
.tracking-step-icon {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: #f0ebe4; color: var(--color-text-muted); flex-shrink: 0; margin-left: -32px; border: 2px solid var(--color-bg);
}
.tracking-step.done { color: var(--color-text); font-weight: 600; }
.tracking-step.done .tracking-step-icon { background: var(--color-success); color: #fff; }
.tracking-step.current .tracking-step-icon { background: var(--color-primary); color: #fff; }
.tracking-step.current { color: var(--color-text); font-weight: 700; }
.tracking-step.cancelled .tracking-step-icon { background: var(--color-error); color: #fff; }
.tracking-step.cancelled { color: var(--color-error); font-weight: 700; }

.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; }
.order-items-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.order-totals .total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; border-top: 1px solid var(--color-border); padding-top: 8px; margin-top: 8px; }
.quick-actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.status-form { display: flex; gap: 10px; align-items: center; }
.status-form select { padding: 9px 11px; border: 1px solid var(--color-border); border-radius: 9px; }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 90px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-track { background: #f0ebe4; border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--color-primary); height: 100%; }
.bar-value { text-align: right; font-weight: 600; }

@media (max-width: 860px) {
  .order-detail-grid { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: -240px; top: 0; z-index: 50; transition: left .2s; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  .admin-layout.sidebar-open .admin-sidebar { left: 0; }
  .admin-menu-toggle { display: block; }
  .form-row-2 { grid-template-columns: 1fr; }
}
