/* Модуль заказа блюд на /restoran */

.rm-cats {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 0.15rem 0 0.85rem;
  margin-bottom: 0.5rem;
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.92));
  backdrop-filter: blur(6px);
}

.dark .rm-cats {
  background: linear-gradient(to bottom, rgba(30, 41, 59, 0.97), rgba(30, 41, 59, 0.92));
}

.rm-cat {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rm-cat:hover {
  border-color: #c4a35a;
  color: #8a6d2f;
}

.rm-cat.is-active {
  border-color: #2f7d4a;
  background: #2f7d4a;
  color: #fff;
}

.dark .rm-cat {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.dark .rm-cat:hover {
  border-color: #c4a35a;
  color: #fbbf24;
}

.dark .rm-cat.is-active {
  border-color: #2f7d4a;
  background: #2f7d4a;
  color: #fff;
}

.ro-dish-ctrl {
  margin-top: 0.25rem;
}

.ro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.ro-btn--add {
  width: 100%;
  background: #fff;
  border-color: #c4a35a;
  color: #8a6d2f;
}

.ro-btn--add:hover {
  background: rgba(196, 163, 90, 0.1);
}

.ro-btn--primary {
  background: #2f7d4a;
  color: #fff;
}

.ro-btn--primary:hover {
  background: #25653c;
}

.ro-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ro-btn--ghost {
  background: transparent;
  border-color: #d1d5db;
  color: #374151;
}

.ro-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  justify-content: space-between;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.15rem;
  background: #f9fafb;
}

.ro-qty__btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.4rem;
  background: #fff;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.ro-qty__btn:active {
  background: #eef2f0;
}

.ro-qty__val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.ro-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92) 28%);
  pointer-events: none;
}

.ro-bar__btn {
  pointer-events: auto;
  display: flex;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: #1f4d32;
  color: #fff;
  box-shadow: 0 10px 28px rgba(31, 77, 50, 0.35);
  cursor: pointer;
}

.ro-bar__label {
  font-size: 0.95rem;
  font-weight: 600;
}

.ro-bar__dot {
  opacity: 0.7;
  margin: 0 0.2rem;
}

.ro-bar__cta {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.16);
}

@media (min-width: 900px) {
  .ro-bar {
    display: none !important;
  }
}

.ro-aside-cart__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.ro-aside-cart__name {
  color: #374151;
}

.ro-aside-cart__meta {
  color: #6b7280;
  white-space: nowrap;
}

.ro-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.ro-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.ro-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92vh, 44rem);
  display: flex;
  flex-direction: column;
  border-radius: 1rem 1rem 0 0;
  background: #fff;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}

@media (min-width: 768px) {
  .ro-sheet__panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(32rem, calc(100vw - 2rem));
    max-height: min(90vh, 40rem);
    transform: translate(-50%, -50%);
    border-radius: 1rem;
  }
}

.ro-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid #eee;
}

.ro-sheet__close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #374151;
}

.ro-sheet__body {
  overflow: auto;
  padding: 1rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
}

.ro-sheet__cart {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.ro-sheet__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f3f4f6;
}

.ro-sheet__row-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.ro-sheet__row-sub {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ro-sheet__row-sum {
  font-size: 0.875rem;
  font-weight: 700;
  color: #2f7d4a;
  white-space: nowrap;
}

.ro-sheet__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.ro-sheet__sum strong {
  font-size: 1.125rem;
  color: #1f4d32;
}

.ro-form {
  display: grid;
  gap: 0.75rem;
}

.ro-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ro-field {
  display: grid;
  gap: 0.35rem;
}

.ro-field input,
.ro-field textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: #111827;
  font-size: 1rem;
}

.ro-field textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.ro-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.875rem;
}

.ro-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.ro-consent input {
  margin-top: 0.15rem;
}

.ro-consent a {
  text-decoration: underline;
}

.ro-success {
  text-align: center;
  padding: 1rem 0.25rem 0.5rem;
}

body.ro-sheet-open {
  overflow: hidden;
}

.dark .ro-btn--add {
  background: #0f172a;
  border-color: #fbbf24;
  color: #fbbf24;
}

.dark .ro-qty {
  background: #0f172a;
  border-color: #334155;
}

.dark .ro-qty__btn {
  background: #1e293b;
  color: #e2e8f0;
}

.dark .ro-sheet__panel {
  background: #0f172a;
  color: #e2e8f0;
}

.dark .ro-sheet__head {
  border-bottom-color: #1e293b;
}

.dark .ro-sheet__close {
  background: #1e293b;
  color: #e2e8f0;
}

.dark .ro-sheet__row {
  border-bottom-color: #1e293b;
}

.dark .ro-sheet__row-name {
  color: #f8fafc;
}

.dark .ro-sheet__sum {
  border-color: #1e293b;
}

.dark .ro-sheet__sum strong {
  color: #86efac;
}

.dark .ro-field input,
.dark .ro-field textarea {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}
