/* La Ordinaria — estilos compartidos (menú público + panel del negocio) */
/* Paleta "Papel y tinta": crema, tinta café, terracota. */

:root {
  --ink: #2e2620;
  --ink-soft: #6f6456;
  --muted: #8a7d6f;
  --muted-2: #6b5f50;
  --accent: #b8583a;
  --accent-ink: #fbf1ea;
  --cream: #f4ede1;
  --cream-2: #efe9df;
  --canvas: #e9e4da;
  --line: #e4d9c6;
  --line-soft: #eae1d2;
  --danger: #a8442a;
  --danger-bg: #fbeee8;
  --danger-line: #f0d4c8;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 20px 45px -25px rgba(40, 25, 15, 0.35);
}

* { box-sizing: border-box; }

/* El atributo hidden debe ganar siempre, aunque el elemento tenga display:flex por su clase. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Hanken Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: 'Spectral', serif; }
.eyebrow {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

input, textarea, select {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  border: none;
  border-radius: 13px;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { background: #cfc6b6; color: #efe9df; cursor: not-allowed; }
.btn-ghost { background: none; border: 1.5px solid var(--line); color: var(--ink); }
.btn-danger-ghost { background: none; border: 1.5px solid #ecd6cd; color: var(--accent); }
.btn-text { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }

.switch {
  width: 42px; height: 24px; border-radius: 20px; padding: 3px;
  display: flex; align-items: center; cursor: pointer; flex: none;
  background: #cfc6b6; transition: background .15s ease;
  border: none;
}
.switch.on { background: var(--accent); justify-content: flex-end; }
.switch:not(.on) { justify-content: flex-start; }
.switch span {
  width: 18px; height: 18px; border-radius: 50%; background: #fff; display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); background: #efe6d6; border-radius: 20px; padding: 4px 10px;
  white-space: nowrap;
}

.photo-placeholder {
  background: repeating-linear-gradient(135deg, #e8ddc9, #e8ddc9 8px, #e2d5bd 8px, #e2d5bd 16px);
  display: flex; align-items: center; justify-content: center;
  font-family: monospace; font-size: 10px; color: #a3927a;
  position: relative;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===================== MENÚ PÚBLICO ===================== */

.menu-page { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

.menu-header {
  padding: 28px 20px 0;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.menu-header__name { font-family: 'Spectral', serif; font-size: 27px; font-weight: 700; line-height: 1; }
.menu-header__tag { font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent); margin-top: 6px; }

.tabs {
  display: flex; gap: 22px; margin-top: 20px; padding: 0 20px;
  overflow-x: auto; border-bottom: 1px solid rgba(46,38,32,.1);
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  position: relative; background: none; border: none; padding: 0 0 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--muted-2);
}
.tab-btn[aria-selected="true"] { color: var(--ink); }
.tab-btn[aria-selected="true"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  background: var(--accent); border-radius: 3px;
}

.product-list { flex: 1; padding: 6px 20px 120px; }

.product-row {
  display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(46,38,32,.07);
  cursor: pointer; text-align: left; width: 100%; background: none; border-left: none; border-right: none; border-top: none;
}
.product-row__photo { width: 94px; height: 94px; border-radius: 16px; overflow: hidden; flex: none; }
.product-row__body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.product-row__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.product-row__name { font-family: 'Spectral', serif; font-size: 17px; font-weight: 600; color: var(--ink); }
.product-row__price { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.product-row__desc { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.product-row__out { align-self: flex-start; margin-top: 3px; font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; color: var(--accent); border: 1px solid #dcb6a6; border-radius: 20px; padding: 3px 10px; }
.product-row__photo.is-out::after {
  content: ''; position: absolute; inset: 0; background: rgba(244,237,225,.6);
}

.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 44px; gap: 14px;
}
.empty-state__icon {
  width: 66px; height: 66px; border-radius: 20px; border: 1.5px dashed #cbbfa9;
  display: flex; align-items: center; justify-content: center;
}
.empty-state__icon::after { content: ''; width: 26px; height: 26px; border-radius: 8px; background: #e8ddc9; }
.empty-state__title { font-family: 'Spectral', serif; font-size: 20px; font-weight: 600; }
.empty-state__desc { font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 340px; }

/* overlay / bottom sheet */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(30,20,12,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-overlay[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; background: var(--cream);
  border-radius: 26px 26px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up .22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet__grabber { display: flex; justify-content: center; padding: 10px 0 4px; flex: none; }
.sheet__grabber span { width: 42px; height: 5px; border-radius: 5px; background: #d8cbb6; }
.sheet__scroll { flex: 1; overflow-y: auto; }
.sheet__photo { position: relative; width: 100%; height: 220px; }
.sheet__close {
  position: absolute; top: 12px; left: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(38,32,27,.55); display: flex; align-items: center; justify-content: center;
  color: var(--cream); font-size: 16px; border: none; cursor: pointer;
}
.sheet__body { padding: 20px 22px 8px; }
.sheet__title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet__title { font-family: 'Spectral', serif; font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.05; }
.sheet__from-price { font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; margin-top: 6px; }
.sheet__desc { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

.opt-group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 12px; }
.opt-group-head__label { font-family: 'Spectral', serif; font-size: 19px; font-weight: 600; }
.opt-group-head__hint { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; }
.opt-group-head__hint.required { color: var(--accent); }
.opt-group-head__hint.optional { color: var(--muted); }

.size-row { display: flex; gap: 9px; }
.size-pill {
  flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: center;
  padding: 13px 6px; border-radius: 14px; cursor: pointer;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line);
}
.size-pill.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.size-pill__label { font-weight: 700; font-size: 14px; }
.size-pill__price { font-size: 11.5px; opacity: .85; }

.opt-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; border-radius: 14px; cursor: pointer; margin-bottom: 8px;
  background: #fff; border: 1.5px solid var(--line-soft); color: var(--ink);
}
.opt-row.selected { background: #faf3ea; border-color: #d9a08b; }
.opt-row__left { display: flex; align-items: center; gap: 13px; }
.opt-row__name { font-size: 15px; }
.opt-row__price { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.opt-row__dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #c9bda9; display: flex; align-items: center; justify-content: center; flex: none; }
.opt-row.selected .opt-row__dot { border-color: var(--accent); }
.opt-row__dot-fill { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.opt-row__box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #c9bda9; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.opt-row.selected .opt-row__box { border-color: var(--accent); background: var(--accent); }
.opt-row__check { width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; }

.sheet__footer {
  flex: none; padding: 15px 20px 22px; background: var(--cream);
  border-top: 1px solid rgba(46,38,32,.1); display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -10px 26px -18px rgba(0,0,0,.2);
}
.sheet__total-label { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.sheet__total-value { font-family: 'Spectral', serif; font-size: 31px; font-weight: 700; line-height: 1; }
.sheet__footer .btn-primary { flex: 1; padding: 16px; font-size: 16px; }
.sheet__unavailable-msg { text-align: center; font-size: 12.5px; color: var(--muted); }

.cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; width: calc(100% - 40px);
  max-width: 600px; background: var(--ink); color: var(--cream); border: none; border-radius: 18px;
  padding: 16px 20px; display: flex; align-items: center; gap: 12px; cursor: pointer;
  box-shadow: var(--shadow); font-size: 15px; font-weight: 600; z-index: 40;
}
.cart-bar[hidden] { display: none; }
.cart-bar__count { background: var(--accent); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; flex: none; }
.cart-bar__total { flex: 1; }

.cart-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(46,38,32,.08); }
.cart-item__body { flex: 1; }
.cart-item__name { font-weight: 600; font-size: 15px; }
.cart-item__opts { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cart-item__price { font-weight: 700; white-space: nowrap; }
.cart-item__remove { background: none; border: none; color: #c0b09a; font-size: 20px; cursor: pointer; line-height: 1; }

/* ===================== PANEL DEL NEGOCIO ===================== */

.panel-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #241f1b; padding: 40px 20px;
}
.panel-login__card {
  width: 380px; max-width: 100%; background: var(--cream); border-radius: var(--radius-lg);
  padding: 40px 36px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}
.panel-login__head { text-align: center; }
.panel-login__title { font-family: 'Spectral', serif; font-size: 27px; font-weight: 700; margin-top: 8px; }
.panel-login__sub { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.panel-login form { margin-top: 30px; display: flex; flex-direction: column; gap: 8px; }
.panel-login label { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.panel-login input { width: 100%; margin-top: 2px; }
.panel-login .btn-primary { width: 100%; margin-top: 18px; padding: 15px; font-size: 16px; }
.panel-login__links { margin-top: 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.panel-login__error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; }

.panel-shell { display: flex; min-height: 100vh; background: var(--cream-2); }
.panel-sidebar {
  width: 236px; background: #2e2620; flex: none; display: flex; flex-direction: column;
  padding: 24px 16px; color: #e7dccb;
}
.panel-sidebar__brand { padding: 0 8px; }
.panel-sidebar__brand-name { font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; font-weight: 700; color: var(--cream); }
.panel-sidebar__brand-sub { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #a08c78; margin-top: 3px; }
.panel-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 30px; }
.panel-nav__item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px;
  color: #c7b9a6; font-size: 14.5px; cursor: pointer; background: none; border: none; text-align: left; width: 100%;
}
.panel-nav__item.active { background: #453a30; color: var(--cream); font-weight: 600; }
.panel-nav__dot { width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid #8a7460; flex: none; }
.panel-nav__item.active .panel-nav__dot { background: #e08a5a; border: none; }
.panel-sidebar__user {
  margin-top: auto; padding: 14px 12px; border-radius: 12px; background: #241d17;
}
.panel-sidebar__user-name { font-size: 13px; font-weight: 600; color: var(--cream); }
.panel-sidebar__logout { font-size: 11.5px; color: #a08c78; margin-top: 2px; background: none; border: none; cursor: pointer; padding: 0; }
.panel-sidebar__logout:hover { text-decoration: underline; }

.panel-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.panel-view { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.panel-view.active { display: flex; }

.panel-topbar {
  padding: 26px 32px 18px; border-bottom: 1px solid #e2dacd; background: var(--cream-2); flex: none;
}
.panel-topbar__row { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.panel-topbar__title { font-family: 'Spectral', serif; font-size: 25px; font-weight: 700; }
.panel-topbar__sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.panel-search {
  margin-top: 18px; display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1.5px solid #e4dccd; border-radius: 12px; padding: 4px 15px; max-width: 360px;
}
.panel-search input { border: none; padding: 8px 0; flex: 1; }
.panel-search input:focus { outline: none; }

.panel-scroll { flex: 1; overflow-y: auto; padding: 8px 32px 40px; }

.cat-group { margin-top: 22px; }
.cat-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat-group__name { font-family: 'Spectral', serif; font-size: 16px; font-weight: 600; }
.cat-group__count { font-size: 12px; font-weight: 600; color: #a2947f; background: #e7ddce; border-radius: 20px; padding: 2px 10px; }
.cat-group__list { background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; }
.cat-group__empty { background: #fff; border: 1px dashed #dcd0bd; border-radius: 16px; padding: 26px; text-align: center; }

.product-item-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid #f1e9dc;
}
.product-item-row:last-child { border-bottom: none; }
.product-item-row.hidden-item { opacity: .55; }
.product-item-row__photo { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.product-item-row__name { font-size: 14.5px; font-weight: 600; }
.product-item-row__price { font-size: 12.5px; color: var(--muted); }
.product-item-row__actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.panel-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; padding: 20px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted-2); }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 130px; }

.price-input { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; }
.price-input span { font-size: 15px; color: var(--muted); }
.price-input input { border: none; padding: 13px 8px; width: 100%; background: none; }

.avail-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px;
}
.avail-toggle-row__title { font-size: 15px; font-weight: 700; }
.avail-toggle-row__desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.extras-group-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; }
.extras-group-card__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #f7f1e7; border-bottom: 1px solid #ece3d4; }
.extras-group-card__head input { flex: 1; font-weight: 600; padding: 9px 12px; }
.extras-group-card__type {
  font-size: 11.5px; font-weight: 700; color: var(--accent); background: #f6e6df; border-radius: 20px;
  padding: 5px 12px; white-space: nowrap; border: none; cursor: pointer;
}
.extras-group-card__body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.extras-opt-row { display: flex; align-items: center; gap: 12px; }
.extras-opt-row input[type=text] { flex: 1; padding: 9px 12px; font-size: 14px; background: #faf7f1; border-color: #ece3d4; }
.extras-opt-row .price-input { width: 110px; background: #faf7f1; border-color: #ece3d4; }
.extras-opt-row .price-input input { padding: 9px 6px; font-size: 14px; }
.extras-opt-row__remove { background: none; border: none; color: #c0b09a; font-size: 18px; cursor: pointer; flex: none; }

.category-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; padding: 15px 18px; }
.category-row__reorder { display: flex; flex-direction: column; gap: 2px; }
.category-row__reorder button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1; padding: 2px; }
.category-row__reorder button:disabled { opacity: .25; cursor: not-allowed; }
.category-row__name { font-size: 15.5px; font-weight: 600; }
.category-row__count { font-size: 12.5px; color: var(--muted); }

.category-warning { background: var(--danger-bg); border-top: 1px solid var(--danger-line); padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.category-warning__title { font-size: 13.5px; font-weight: 700; color: var(--danger); }
.category-warning__desc { font-size: 12.5px; color: #95604f; margin-top: 2px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: var(--cream);
  padding: 13px 20px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow);
  z-index: 100; opacity: 0; transform: translateY(8px); transition: all .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .panel-shell { flex-direction: column; }
  .panel-sidebar { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; gap: 20px; }
  .panel-sidebar__brand-sub { display: none; }
  .panel-nav { flex-direction: row; margin-top: 0; }
  .panel-sidebar__user { margin-top: 0; margin-left: auto; padding: 6px 0; background: none; text-align: right; }
}
@media (max-width: 560px) {
  .panel-topbar, .panel-scroll { padding-left: 18px; padding-right: 18px; }
  .field-row { flex-direction: column; }
}
