/* mobile-catalog-sheet.css v3 — iOS-safe full-screen catalog sheet */

/* Hide on desktop */
@media (min-width: 769px) {
  .mcs { display: none !important; }
}

/* Sheet — full-screen, slide up from bottom */
.mcs {
  position: fixed;
  inset: 0;
  background: #fafaf7;
  z-index: 2147483600; /* выше всего что есть на сайте кроме claude-glow */
  display: none; /* hidden by default; .is-open switches to flex */
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: #0a0a0a;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  padding-top: env(safe-area-inset-top, 0);
  isolation: isolate; /* собственный stacking context */
  overflow: hidden;
  /* Body lock на iOS */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mcs.is-open {
  display: flex;
  transform: translateY(0);
}

/* Лёгкий темнящий слой ВНУТРИ sheet поверх корней (имитирует depth без отдельного backdrop) */
.mcs::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.45);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease-out;
}
.mcs.is-open::before { opacity: 1; }

/* Drag handle */
.mcs-handle {
  flex-shrink: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: relative;
  z-index: 2;
}
.mcs-handle::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: #d6d3d1;
  border-radius: 2px;
}

/* Header — search + close */
.mcs-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 14px;
  border-bottom: 1px solid #ececec;
  position: relative;
  z-index: 2;
  background: #fafaf7;
}
.mcs-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e8e6e1;
  border-radius: 12px;
  font-size: 15px;
}
.mcs-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: #0a0a0a;
  -webkit-tap-highlight-color: transparent;
}
.mcs-search input::placeholder { color: #94a3b8; }
.mcs-search svg { flex-shrink: 0; color: #94a3b8; width: 18px; height: 18px; }
.mcs-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  background: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mcs-close:active { background: #ececec; }
.mcs-close svg { width: 20px; height: 20px; }

/* Body — scrollable */
.mcs-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0 calc(80px + env(safe-area-inset-bottom, 0));
  overscroll-behavior: contain;
  position: relative;
  z-index: 2;
  background: #fafaf7;
}

/* Quick links */
.mcs-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 18px;
}
.mcs-quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 8px;
  background: #fff;
  border-radius: 14px;
  text-decoration: none;
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #f0eeeb;
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
}
.mcs-quick a:active { background: #f5f3ef; transform: scale(0.98); }
.mcs-quick-i { font-size: 24px; line-height: 1; }

/* Section title */
.mcs-title {
  font-size: 12px;
  font-weight: 600;
  color: #6b6b6b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 8px 16px 10px;
}

/* Themes list */
.mcs-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  background: #fff;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
}
.mcs-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border-bottom: 1px solid #f5f3ef;
  font-size: 15px;
}
.mcs-list li:last-child { border-bottom: 0; }
.mcs-list li a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #0a0a0a;
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  padding: 14px 16px;
}
.mcs-list li a:active { background: #f5f3ef; }
.mcs-list .mcs-cnt {
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  margin-left: 12px;
}
.mcs-list .mcs-chev {
  margin-left: 8px;
  color: #cbd5e1;
  flex-shrink: 0;
}

/* Color swatches */
.mcs-colors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 16px 24px;
}
.mcs-colors a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #0a0a0a;
  font-size: 12px;
  -webkit-tap-highlight-color: transparent;
  padding: 4px;
}
.mcs-colors a:active { transform: scale(0.95); }
.mcs-sw {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c, #ccc);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.mcs-sw[data-bw="1"] {
  background: linear-gradient(135deg, #1a1a1a 50%, #fff 50%);
}

/* Chips */
.mcs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 24px;
}
.mcs-chips a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #e8e6e1;
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
  color: #0a0a0a;
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
}
.mcs-chips a:active { background: #f5f3ef; transform: scale(0.97); }
.mcs-chips small { color: #94a3b8; font-size: 11px; }

.mcs-empty {
  padding: 32px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* Body lock */
body.mcs-lock {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
