/* ==========================================================================
   Bottom Sheet — модальная панель снизу для mobile (фильтры, опции, поиск)
   ========================================================================== */

.mc-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

.mc-bottom-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mc-bottom-sheet {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: var(--z-bottom-sheet);
  background: var(--color-bg);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  box-shadow: 0 -16px 48px rgba(34, 31, 30, .18);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  padding-block-end: env(safe-area-inset-bottom, 0px);
}

.mc-bottom-sheet.is-open {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .mc-bottom-sheet {
    inset-inline: 50%;
    transform: translate(-50%, 100%);
    max-width: 600px;
    border-radius: var(--radius-2xl);
    inset-block-end: var(--space-5);
  }
  .mc-bottom-sheet.is-open {
    transform: translate(-50%, 0);
  }
}

.mc-bottom-sheet__handle {
  display: flex;
  justify-content: center;
  padding: var(--space-2) 0 var(--space-1);
  cursor: grab;
}

.mc-bottom-sheet__handle::after {
  content: '';
  width: 40px;
  height: 4px;
  background: var(--color-border-strong);
  border-radius: var(--radius-pill);
}

.mc-bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-3);
  border-block-end: 1px solid var(--color-border);
}

.mc-bottom-sheet__title {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
  margin: 0;
}

.mc-bottom-sheet__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-light);
  border: 0;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.mc-bottom-sheet__close:hover {
  background: var(--color-border);
}

.mc-bottom-sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-4);
  -webkit-overflow-scrolling: touch;
}

.mc-bottom-sheet__footer {
  flex-shrink: 0;
  padding: var(--space-4);
  border-block-start: 1px solid var(--color-border);
}

/* Список категорий внутри bottom-sheet (для каталога) */
.mc-bottom-sheet-categories {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mc-bottom-sheet-categories a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.mc-bottom-sheet-categories a:hover,
.mc-bottom-sheet-categories a.is-active {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  text-decoration: none;
}

.mc-bottom-sheet-categories img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--color-bg-light);
  flex-shrink: 0;
}

/* Off-canvas меню (бургер на mobile) — на основе bottom-sheet, но слева */
.mc-offcanvas-menu {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: var(--z-bottom-sheet);
  width: min(85vw, 360px);
  background: var(--color-bg);
  box-shadow: 16px 0 48px rgba(34, 31, 30, .18);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--dur-slow) var(--ease-out);
  padding-block-end: env(safe-area-inset-bottom, 0px);
}

.mc-offcanvas-menu.is-open {
  transform: translateX(0);
}

.mc-offcanvas-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-block-end: 1px solid var(--color-border);
}

.mc-offcanvas-menu__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-4);
}

.mc-offcanvas-menu__footer {
  padding: var(--space-4);
  border-block-start: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.mc-offcanvas-menu__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mc-offcanvas-menu__list a {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-weight: var(--fw-medium);
}

.mc-offcanvas-menu__list a:hover,
.mc-offcanvas-menu__list a.is-active {
  background: var(--color-bg-cream);
  color: var(--color-primary);
  text-decoration: none;
}
