/**
 * mobile-panels.css — Clean mobile sliding panels
 * Replaces the old broken .mobile-filter / .menu-panel mess.
 *
 * Architecture:
 *   .mp-overlay   — semi-transparent backdrop
 *   .mp-panel     — slide-up sheet from bottom
 *   .mp-panel--menu — slide-in menu from left
 *
 * Only active at ≤ 962px; hidden on desktop.
 */

/* ============================================
   0.  DESKTOP: hide everything
   ============================================ */
.mp-overlay,
.mp-panel {
  display: none;
}

/* Scroll lock: applied by JS when a panel is open */
.mp-body-locked {
  overflow: hidden !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
}

/* ============================================
   1.  MOBILE: ≤ 962px
   ============================================ */
@media screen and (max-width: 962px) {

  /* ----------  backdrop  ---------- */
  .mp-overlay {
    display: none;                       /* toggled to block via JS */
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 250ms ease;
    touch-action: none;
    -webkit-overflow-scrolling: auto;
  }
  .mp-overlay.mp-visible {
    display: block;
    opacity: 1;
  }

  /* ----------  base panel (slide-up sheet)  ---------- */
  .mp-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    max-height: 90vh;
    height: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 20px 20px 0 0;
    background: #1e1e1e;
    color: #fff;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(105%);
    transition: transform 300ms cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .mp-panel.mp-open {
    transform: translateY(0);
  }

  /* ----------  panel header  ---------- */
  .mp-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .mp-panel__title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: #aaa;
  }
  .mp-panel__close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mp-panel__close svg {
    width: 18px;
    height: 18px;
  }
  .mp-panel__close svg line {
    stroke: #DBF40C;
    stroke-width: 2.5;
    stroke-linecap: round;
  }

  /* ----------  panel body (scrollable)  ---------- */
  .mp-panel__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px 32px;
    overscroll-behavior: contain;
  }

  /* ============================================
     2.  FILTER panel contents
     ============================================ */

  /* date row */
  .mpf-date {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(170, 170, 170, 0.35);
    border-radius: 12px;
    margin-bottom: 24px;
    cursor: pointer;
  }
  .mpf-date svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    opacity: 0.6;
  }
  .mpf-date__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mpf-date__label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .mpf-date__value {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
  }

  /* filter group */
  .mpf-group {
    margin-bottom: 20px;
  }
  .mpf-group__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mpf-group__label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #DBF40C;
    flex-shrink: 0;
  }

  /* group header (collapsed "выбор") */
  .mpf-group__selected {
    font-size: 15px;
    padding: 12px 16px;
    border: 1px solid rgba(170, 170, 170, 0.35);
    border-radius: 12px;
    cursor: pointer;
    color: #ccc;
    transition: border-color 200ms;
  }
  .mpf-group__selected.mpf-active {
    border-color: #DBF40C;
    color: #fff;
  }

  /* chips (tag grid) */
  .mpf-chips {
    display: none;            /* toggled via JS */
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
  }
  .mpf-chips.mpf-expanded {
    display: flex;
  }
  .mpf-chip {
    font-size: 13px;
    line-height: 1.3;
    padding: 10px 14px;
    border: 1px solid rgba(170, 170, 170, 0.3);
    border-radius: 10px;
    color: #ddd;
    cursor: pointer;
    flex: 0 0 calc(50% - 4px);
    box-sizing: border-box;
    text-align: center;
    transition: all 150ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mpf-chip:active {
    transform: scale(0.96);
  }
  .mpf-chip.mpf-selected {
    border-color: #DBF40C;
    color: #fff;
    background: rgba(219, 244, 12, 0.08);
  }

  /* action buttons */
  .mpf-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
  }
  .mpf-submit {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #DBF40C;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mpf-submit:active {
    opacity: 0.85;
  }
  .mpf-reset {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    text-decoration: underline;
  }

  /* ============================================
     3.  DATEPICKER panel
     ============================================ */
  .mpf-datepicker-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0;
  }
  .mpf-datepicker-wrap .datepicker {
    width: 100% !important;
  }
  .mpf-datepicker-wrap .datepicker-inline {
    width: 100% !important;
  }
  .mpf-datepicker-wrap .datepicker table {
    width: 100%;
  }

  /* ============================================
     4.  MENU panel (slide from left)
     ============================================ */
  .mp-panel--menu {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 88vw;
    max-width: 380px;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0 20px 20px 0;
    transform: translateX(-105%);
    transition: transform 300ms cubic-bezier(.4, 0, .2, 1);
  }
  .mp-panel--menu.mp-open {
    transform: translateX(0);
  }

  /* menu items */
  .mp-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .mp-menu-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .mp-menu-list a {
    display: block;
    padding: 18px 0;
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    text-decoration: none;
    letter-spacing: -0.2px;
  }
  .mp-menu-list a:active {
    opacity: 0.7;
  }

  /* menu footer (phone + socials) */
  .mp-menu-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
  }
  .mp-menu-footer__phone {
    flex: 1 1 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 12px;
    background: #DBF40C;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
  }
  .mp-menu-footer__phone:active {
    opacity: 0.85;
  }
  .mp-menu-footer__socials {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: center;
  }
  .mp-menu-footer__socials a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mp-menu-footer__socials a svg {
    width: 24px;
    height: 24px;
  }

} /* end @media 962px */
