/* ══════════════════════════════════════════════════════
   RiceCity Delivery — Cart & Menu overlay styles
   Все классы корзины с префиксом rc-
   Стили карточек меню (mc-*) — оригинальный стиль сайта
══════════════════════════════════════════════════════ */

/* Локальные шрифты (дублируем для cart.css, загружаемого отдельно) */
@font-face {
  font-family: 'Soyuz Grotesk';
  src: url('../fonts/SoyuzGroteskBold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Angry';
  src: url('../fonts/Angry.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Ceremonious One';
  src: url('../fonts/ceremoniousone.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Кнопка корзины в навбаре ── */
.nav-cart-btn {
  /* Уменьшаем относительно .mob-btn в нижней полосе */
  width: 38px !important;
  height: 38px !important;
  margin-left: clamp(10px, 1.2vw, 20px);
  flex-shrink: 0;
}
.nav-cart-btn svg {
  width: 18px !important;
  height: 18px !important;
  margin-right: 0 !important;
}

/* На мобиле — навбар показывает бургер + корзину рядом */
@media (max-width: 767px) {
  .nav-cart-btn {
    width: 36px !important;
    height: 36px !important;
    margin-left: 0;
    margin-right: 8px; /* отступ слева от бургера */
  }
}

body.rc-no-scroll {
  overflow: hidden;
}

/* ── Затемняющий оверлей ── */
.rc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.rc-overlay--active {
  display: block;
  opacity: 1;
}

/* ════════════════════════════════════════
   Боковая панель корзины
════════════════════════════════════════ */
.rc-cart-sidebar {
  position: fixed;
  top: 0;
  right: -110%;
  width: min(440px, 100vw);
  height: 100dvh;
  height: 100vh;
  background: var(--cream, #f5f0e8);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.22);
  font-family: 'Oswald', sans-serif;
}
.rc-cart-sidebar--open {
  right: 0;
}

.rc-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--dark, #1a1208);
  color: #fff;
  flex-shrink: 0;
}
.rc-cart-title {
  font-family: 'Angry', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
}
.rc-cart-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
}
.rc-cart-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.rc-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line, #e0d6c4) transparent;
}
.rc-cart-body::-webkit-scrollbar { width: 4px; }
.rc-cart-body::-webkit-scrollbar-track { background: transparent; }
.rc-cart-body::-webkit-scrollbar-thumb { background: var(--line, #e0d6c4); border-radius: 2px; }

.rc-cart-empty {
  text-align: center;
  color: var(--light, #8a7a62);
  font-size: 16px;
  padding: 48px 0 24px;
}

.rc-cart-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--line, #e0d6c4);
  padding: 12px 0;
}
.rc-cart-row-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--dark, #1a1208);
  line-height: 1.3;
}
.rc-cart-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rc-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--orange, #ea6009);
  background: none;
  color: var(--orange, #ea6009);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.rc-qty-btn:hover {
  background: var(--orange, #ea6009);
  color: #fff;
}
.rc-qty-val {
  font-size: 16px;
  font-weight: 600;
  min-width: 26px;
  text-align: center;
  color: var(--dark, #1a1208);
}
.rc-row-price {
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark, #1a1208);
  white-space: nowrap;
}
.rc-remove-btn {
  background: none;
  border: none;
  color: var(--light, #8a7a62);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}
.rc-remove-btn:hover { color: var(--dark, #1a1208); }

.rc-cart-footer {
  padding: 14px 16px 20px;
  border-top: 2px solid var(--line, #e0d6c4);
  background: #fff;
  flex-shrink: 0;
}
.rc-cart-total {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark, #1a1208);
  margin-bottom: 14px;
}

.rc-order-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rc-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line, #e0d6c4);
  border-radius: 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  background: var(--cream, #f5f0e8);
  color: var(--dark, #1a1208);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.rc-input:focus {
  border-color: var(--orange, #ea6009);
  background: #fff;
}
.rc-input::placeholder {
  color: var(--light, #8a7a62);
}
.rc-btn-order {
  width: 100%;
  padding: 13px;
  background: var(--orange, #ea6009);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 2px;
}
.rc-btn-order:hover:not(:disabled) {
  background: var(--orange-dark, #c94f00);
}
.rc-btn-order:active:not(:disabled) {
  transform: scale(0.98);
}
.rc-btn-order:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rc-order-success {
  text-align: center;
  padding: 10px 0 4px;
}
.rc-success-icon {
  width: 52px;
  height: 52px;
  background: var(--orange, #ea6009);
  color: #fff;
  border-radius: 50%;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.rc-success-title {
  font-family: 'Angry', sans-serif;
  font-size: 22px;
  color: var(--dark, #1a1208);
  margin-bottom: 8px;
}
.rc-success-text {
  font-size: 14px;
  color: var(--mid, #5a4a32);
  margin-bottom: 4px;
}

/* ── Бейдж количества на кнопке корзины ── */
.rc-cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  background: var(--orange, #ea6009);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-family: 'Soyuz Grotesk', 'Arial Black', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ════════════════════════════════════════
   Секция меню с доставкой
════════════════════════════════════════ */
#rc-delivery-root {
  margin-top: clamp(20px, 3vh, 32px);
  position: relative;
  z-index: 3;
}

/* ── Полоса фильтров категорий ── */
.rc-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(73, 64, 31, 0.7);
  border-radius: 12px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
  overflow: visible; /* JS сам скрывает лишние, выпадашка должна вылезать */
}

.rc-filter-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.35px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.rc-filter-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.rc-filter-btn--active {
  background: var(--orange, #ea6009);
  border-color: var(--orange, #ea6009);
  color: #fff;
}

/* ── Обёртка кнопки "•••" + выпадашка ── */
.rc-filter-more-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Кнопка "•••" */
.rc-filter-more-btn {
  padding: 7px 13px;
  letter-spacing: 2px;
  font-size: 11px;
}

/* Выпадающая панель с остальными категориями */
.rc-filter-more-panel {
  display: none;
  flex-direction: column;
  gap: 3px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(42, 35, 15, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px;
  z-index: 50;
  min-width: 170px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.rc-filter-more-panel--open {
  display: flex;
}
.rc-filter-more-panel .rc-filter-btn {
  width: 100%;
  border-radius: 7px;
  border-color: transparent;
  padding: 8px 13px;
  text-align: left;
}
.rc-filter-more-panel .rc-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ════════════════════════════════════════
   Сетка карточек: 3 колонки → 1 на мобиле
════════════════════════════════════════ */
#rc-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;      /* важно: карточки не растягиваются по высоте */
  margin-top: 4px;
  position: relative;
  z-index: 3;
}

/* ════════════════════════════════════════
   Карточки меню — стиль оригинального сайта
════════════════════════════════════════ */

.menu-card {
  height: 130px;
  position: relative;
  z-index: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Открытая карточка перекрывает соседей */
.menu-card.is-open {
  z-index: 10;
}

/* Недоступное блюдо (стоп-лист) */
.menu-card.rc-stopped {
  opacity: 0.5;
  filter: grayscale(1);
}

.menu-card-inner {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: auto;
  min-height: 130px;
  max-height: 130px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 18px rgba(0,0,0,0.18);
  transition: max-height var(--ease, 0.6s cubic-bezier(0.4,0,0.2,1)),
              box-shadow var(--ease, 0.6s cubic-bezier(0.4,0,0.2,1)),
              transform 0.2s;
}

@media (hover: hover) {
  .menu-card:not(.is-open):hover .menu-card-inner {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }
}

.menu-card.is-open .menu-card-inner {
  max-height: 600px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

/* ─── Свёрнутое состояние ─── */
.mc-collapsed {
  position: absolute;
  top: 0; left: 0; width: 100%;
  display: flex;
  height: 130px;
  flex-shrink: 0;
  z-index: 2;
  transition: opacity 0.18s ease;
}
.menu-card.is-open .mc-collapsed {
  opacity: 0;
  pointer-events: none;
}

.mc-thumb {
  width: 38%;
  height: 130px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}
/* Заглушка если нет фото */
.mc-thumb--placeholder {
  width: 38%;
  height: 130px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--line, #e0d6c4), var(--cream, #f5f0e8));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(0,0,0,0.2);
}

.mc-info {
  flex: 1;
  padding: 13px 16px 11px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mc-name {
  font-family: 'Soyuz Grotesk', 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark, #1a1208);
  line-height: 1.2;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.mc-desc {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--mid, #5a4a32);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.mc-line {
  height: 1px;
  background: var(--line, #e0d6c4);
  margin: 6px 0;
  flex-shrink: 0;
}
.mc-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 4px;
}
.mc-weight {
  font-family: 'Ceremonious One', Arial, sans-serif;
  font-size: 22px;
  color: var(--light, #8a7a62);
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
}
.mc-price {
  font-family: 'Angry', sans-serif;
  font-size: 22px;
  color: var(--orange, #ea6009);
  line-height: 1;
  white-space: nowrap;
}

/* ─── Развёрнутое состояние ─── */
.mc-expanded {
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s ease 0.1s;
}
.menu-card.is-open .mc-expanded {
  opacity: 1;
  transition-delay: 0.15s;
}

.mc-exp-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  display: block;
}
.mc-exp-photo--placeholder {
  width: 100%;
  height: 180px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--line, #e0d6c4), var(--cream, #f5f0e8));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(0,0,0,0.15);
}

.mc-exp-body {
  flex: 1;
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.mc-exp-type {
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--orange, #ea6009);
}
.mc-exp-name {
  font-family: 'Soyuz Grotesk', 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--dark, #1a1208);
  line-height: 1.15;
  letter-spacing: 0.3px;
}
.mc-exp-desc {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  color: var(--mid, #5a4a32);
  line-height: 1.6;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.mc-exp-line {
  height: 1px;
  background: var(--line, #e0d6c4);
  flex-shrink: 0;
}
.mc-exp-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 2px;
}
.mc-exp-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mc-exp-weight {
  font-family: 'Ceremonious One', Arial, sans-serif;
  font-size: 26px;
  color: var(--light, #8a7a62);
  line-height: 1;
}
.mc-exp-price {
  font-family: 'Angry', sans-serif;
  font-size: 26px;
  color: var(--dark, #1a1208);
  line-height: 1;
}

/* Кнопка "В корзину" в развёрнутой карточке */
.mc-exp-btn {
  margin-left: auto;
  padding: 11px 22px;
  background: var(--orange, #ea6009);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: 'Soyuz Grotesk', 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.mc-exp-btn:hover:not(:disabled) {
  background: var(--orange-dark, #c94f00);
}
.mc-exp-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.mc-exp-btn:disabled,
.mc-exp-btn--disabled {
  background: var(--light, #8a7a62);
  cursor: not-allowed;
  opacity: 0.85;
}

/* ════════════════════════════════════════
   Адаптация: 2 колонки на планшете, 1 на мобиле
════════════════════════════════════════ */
@media (max-width: 900px) {
  #rc-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  #rc-items {
    grid-template-columns: 1fr;
  }

  .rc-cart-sidebar {
    width: 100vw;
  }

  /* На мобиле карточка полная ширина, немного выше */
  .menu-card {
    height: 120px;
  }
  .mc-collapsed,
  .menu-card-inner { min-height: 110px; }
  .mc-collapsed { height: 120px; }
  .mc-thumb { height: 130px; }
  .mc-thumb--placeholder { height: 130px; }
  .mc-name { font-size: 14px; }
  .mc-weight, .mc-price { font-size: 18px; }
}
