/* =========================================================
   Antojitos La Ceiba — estilos propios sobre Bootstrap 5.3
   Todo lo de marca vive en las variables de :root.
   ========================================================= */

:root {
  --ac-brand:        #c1440e;   /* terracota */
  --ac-brand-dark:   #8f3209;
  --ac-brand-soft:   #fdece5;
  --ac-accent:       #f2a007;   /* amarillo maíz */
  --ac-green:        #1f7a5a;
  --ac-red:          #b02a37;

  --ac-side-bg:      #241713;
  --ac-side-bg-2:    #32201a;
  --ac-side-text:    #e7d9d3;
  --ac-side-muted:   #a98c82;

  --ac-body-bg:      #f6f4f1;
  --ac-card-bg:      #ffffff;
  --ac-border:       #e6e1db;
  --ac-text:         #2b2320;
  --ac-muted:        #8a7d76;

  --ac-sidebar-w:    248px;
  --ac-radius:       14px;
  --ac-shadow:       0 1px 2px rgba(43,35,32,.06), 0 8px 24px rgba(43,35,32,.06);
}

/* ---------- base ---------- */
body {
  background: var(--ac-body-bg);
  color: var(--ac-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
.text-muted-2 { color: var(--ac-muted) !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.ac-shell { display: flex; min-height: 100vh; }

.ac-sidebar {
  width: var(--ac-sidebar-w);
  flex: 0 0 var(--ac-sidebar-w);
  background: linear-gradient(180deg, var(--ac-side-bg) 0%, var(--ac-side-bg-2) 100%);
  color: var(--ac-side-text);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1045;
  display: flex;
  flex-direction: column;
  transition: transform .22s ease;
}
.ac-main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--ac-sidebar-w);
  display: flex;
  flex-direction: column;
}
.ac-content { padding: 22px 26px 48px; }

/* ---------- marca ---------- */
.ac-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.ac-brand-logo {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ac-brand) 0%, var(--ac-accent) 100%);
  display: grid; place-items: center;
  font-size: 1.35rem;
}
.ac-brand-name { font-weight: 700; line-height: 1.1; letter-spacing: .2px; }
.ac-brand-sub  { font-size: .72rem; color: var(--ac-side-muted); }

/* ---------- navegación ---------- */
.ac-nav { padding: 14px 10px; overflow-y: auto; flex: 1 1 auto; }
.ac-nav-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .9px;
  color: var(--ac-side-muted); padding: 14px 12px 6px; font-weight: 600;
}
.ac-nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: 10px;
  color: var(--ac-side-text);
  font-size: .925rem;
  transition: background .15s ease, color .15s ease;
}
.ac-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .85; }
.ac-nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.ac-nav-link.active {
  background: var(--ac-brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(193,68,14,.35);
}
.ac-nav-link.active i { opacity: 1; }
.ac-nav-badge { margin-left: auto; font-size: .7rem; }

.ac-side-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .75rem; color: var(--ac-side-muted);
}

/* ---------- topbar ---------- */
.ac-topbar {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ac-border);
  padding: 12px 26px;
  display: flex; align-items: center; gap: 14px;
}
.ac-topbar h1 { font-size: 1.12rem; font-weight: 700; margin: 0; }
.ac-topbar .ac-sub { font-size: .78rem; color: var(--ac-muted); }
.ac-burger { display: none; }

/* ---------- tarjetas ---------- */
.card {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  background: var(--ac-card-bg);
  box-shadow: var(--ac-shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--ac-border);
  padding: 14px 18px;
  font-weight: 600;
}
.card-body { padding: 18px; }

/* ---------- KPI ---------- */
.kpi { display: flex; gap: 14px; align-items: flex-start; }
.kpi-icon {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 12px; display: grid; place-items: center;
  font-size: 1.25rem;
}
.kpi-label { font-size: .78rem; color: var(--ac-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.kpi-foot  { font-size: .78rem; color: var(--ac-muted); }

.bg-brand-soft { background: var(--ac-brand-soft); color: var(--ac-brand); }
.bg-green-soft { background: #e4f3ed; color: var(--ac-green); }
.bg-amber-soft { background: #fdf2dc; color: #a56a04; }
.bg-red-soft   { background: #fbe6e8; color: var(--ac-red); }
.bg-blue-soft  { background: #e6eefb; color: #14548f; }

/* ---------- tablas ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ac-muted); font-weight: 700;
  border-bottom: 1px solid var(--ac-border);
  padding: 10px 14px; white-space: nowrap;
}
.table > tbody td { padding: 11px 14px; vertical-align: middle; border-color: #f0ece7; }
.table-hover > tbody > tr:hover > * { background: #faf8f6; }
.table-wrap { overflow-x: auto; }

/* ---------- botones ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-brand { background: var(--ac-brand); border-color: var(--ac-brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--ac-brand-dark); border-color: var(--ac-brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--ac-brand); color: var(--ac-brand); }
.btn-outline-brand:hover { background: var(--ac-brand); color: #fff; }

.badge-soft-green { background: #e4f3ed; color: var(--ac-green); }
.badge-soft-red   { background: #fbe6e8; color: var(--ac-red); }
.badge-soft-amber { background: #fdf2dc; color: #a56a04; }
.badge-soft-gray  { background: #efebe7; color: #6b5f59; }

/* ---------- POS ---------- */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.pos-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-cat {
  border: 1px solid var(--ac-border); background: #fff;
  border-radius: 999px; padding: 6px 14px; font-size: .86rem; cursor: pointer;
  transition: all .15s ease;
}
.pos-cat.active { background: var(--ac-brand); border-color: var(--ac-brand); color: #fff; }

.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.pos-item {
  background: #fff; border: 1px solid var(--ac-border); border-radius: var(--ac-radius);
  padding: 14px 12px; cursor: pointer; text-align: left;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.pos-item:hover { transform: translateY(-2px); box-shadow: var(--ac-shadow); border-color: var(--ac-brand); }
.pos-item:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.pos-item-emoji { font-size: 1.7rem; line-height: 1; }
.pos-item-name  { font-weight: 600; font-size: .9rem; margin-top: 8px; }
.pos-item-price { color: var(--ac-brand); font-weight: 700; }
.pos-item-stock { font-size: .72rem; color: var(--ac-muted); }

.pos-ticket { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 110px); }
.pos-lines { overflow-y: auto; flex: 1 1 auto; min-height: 120px; }
.pos-line { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed #eee6df; }
.pos-line:last-child { border-bottom: 0; }
.pos-line-name { font-size: .88rem; font-weight: 600; line-height: 1.2; }
.pos-line-unit { font-size: .74rem; color: var(--ac-muted); }
.pos-qty { display: flex; align-items: center; gap: 4px; }
.pos-qty button {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--ac-border);
  background: #fff; line-height: 1; display: grid; place-items: center;
}
.pos-qty span { min-width: 26px; text-align: center; font-weight: 600; }
.pos-empty { text-align: center; color: var(--ac-muted); padding: 34px 10px; }

/* ---------- utilidades ---------- */
.stock-bar { height: 5px; border-radius: 999px; background: #efebe7; overflow: hidden; }
.stock-bar > span { display: block; height: 100%; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--ac-muted); }
.empty-state i { font-size: 2.4rem; opacity: .35; display: block; margin-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .pos-grid { grid-template-columns: 1fr 330px; }
}
@media (max-width: 991.98px) {
  .ac-sidebar { transform: translateX(-100%); }
  .ac-sidebar.open { transform: translateX(0); box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
  .ac-main { margin-left: 0; }
  .ac-burger { display: inline-flex; }
  .pos-grid { grid-template-columns: 1fr; }
  .pos-ticket { position: static; max-height: none; }
}
@media (max-width: 575.98px) {
  .ac-content { padding: 16px 16px 40px; }
  .ac-topbar { padding: 10px 16px; }
  .kpi-value { font-size: 1.35rem; }
}

/* ---------- impresión de ticket ---------- */
@media print {
  .ac-sidebar, .ac-topbar, .no-print { display: none !important; }
  .ac-main { margin-left: 0; }
  body { background: #fff; }
}
