/* Стили компонентов кофейни «Кофейник».
 * Утилиты (отступы, сетка, цвета bg-coffee и т.п.) подключаются через
 * Tailwind CSS (CDN с инлайн-конфигом в base.html). Здесь — собственные
 * классы компонентов на чистом CSS, чтобы приложение работало и офлайн.
 */

:root {
  --coffee: #6f4e37;
  --coffee-dark: #4e342e;
  --cream: #fdf6ec;
  --milk: #fffaf3;
  --caramel: #d8b48a;
  --accent: #2e7d4f;
  --accent-dark: #256340;
  --terracotta: #c8654a;
}

body { font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif; }

/* Заголовки — изящный serif с поддержкой кириллицы. */
h1, h2, h3, .font-display {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* ---------- Кнопки (самодостаточные, не зависят от .btn) ---------- */
.btn,
.btn-accent,
.btn-coffee,
.btn-outline,
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .5rem 1rem; border-radius: .5rem;
  font-weight: 600; line-height: 1.2; cursor: pointer;
  border: none; text-decoration: none;
  transition: background-color .15s, opacity .15s;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-coffee { background: var(--coffee); color: var(--cream); }
.btn-coffee:hover { background: var(--coffee-dark); }
.btn-outline { background: transparent; border: 1px solid rgba(111,78,55,.4); color: var(--coffee); }
.btn-outline:hover { background: rgba(111,78,55,.1); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ---------- Карточки и формы ---------- */
.card {
  background: var(--milk); border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid rgba(216,180,138,.3);
}
.input {
  width: 100%; padding: .5rem .75rem; border-radius: .5rem;
  border: 1px solid rgba(216,180,138,.5); background: #fff;
  outline: none; font: inherit; color: var(--coffee-dark);
}
.input:focus { box-shadow: 0 0 0 2px rgba(46,125,79,.4); }
.label { display: block; font-size: .875rem; font-weight: 500; color: var(--coffee-dark); margin-bottom: .25rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .125rem .5rem; border-radius: 9999px; }

/* ---------- Боковое меню админки ---------- */
.admin-link { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: .5rem; color: var(--coffee-dark); text-decoration: none; }
.admin-link:hover { background: rgba(111,78,55,.1); }
.admin-link.active, .admin-link.active:hover { background: var(--coffee); color: var(--cream); }

.prose { line-height: 1.7; }

/* ---------- Верхнее меню иконками ---------- */
.topnav {
  display: flex; align-items: stretch; gap: .25rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.topnav::-webkit-scrollbar { display: none; }
.navitem {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 56px; padding: .35rem .5rem; border-radius: .6rem;
  color: var(--cream); text-decoration: none; flex: 0 0 auto;
  transition: background-color .15s;
}
.navitem:hover { background: rgba(255,255,255,.12); }
.navitem .ico { font-size: 1.25rem; line-height: 1; }
.navitem .lbl { font-size: .68rem; font-weight: 600; white-space: nowrap; }
.navitem.primary { color: #fff; }
.navitem.primary .ico { color: #aef0c6; }

/* ---------- Нижняя плавающая кнопка действия ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center;
  padding: 0 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
  pointer-events: none;
}
.fab {
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; max-width: 30rem;
  padding: 1rem 1.5rem; border-radius: 1.5rem;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  border: none; cursor: pointer; text-decoration: none;
  background: rgba(46,125,79,.88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(40,26,18,.45), 0 4px 10px rgba(0,0,0,.30);
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.fab:hover { background: rgba(37,99,64,.95); box-shadow: 0 16px 34px rgba(40,26,18,.5), 0 6px 12px rgba(0,0,0,.32); }
.fab:active { transform: translateY(2px) scale(.99); box-shadow: 0 6px 16px rgba(40,26,18,.4); }
.fab.coffee { background: rgba(111,78,55,.9); }
.fab.coffee:hover { background: rgba(78,52,46,.95); }
.fab .ico { font-size: 1.4rem; }

/* Отступ снизу у контента, чтобы плавающая кнопка не перекрывала */
.has-fab { padding-bottom: 6rem; }

/* ---------- Модальное окно QR ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(40,26,18,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-sheet {
  background: #ffffff; width: 100%; max-width: 26rem;
  border-radius: 1.5rem 1.5rem 0 0; padding: 1.5rem;
  text-align: center; transform: translateY(20px); transition: transform .25s;
  box-shadow: 0 -10px 30px rgba(0,0,0,.3);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 1.5rem; }
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 2.25rem; height: 2.25rem; border-radius: 9999px;
  background: rgba(0,0,0,.08); border: none; font-size: 1.25rem; cursor: pointer;
  color: var(--coffee-dark);
}
