/* ============================================================
   YELLA.UZ — Mobile Catalog Menu V3: Grid + Bottom Sheet
   Scope: Mobile only (max-width: 767px)
   Desktop is NOT affected.
   ============================================================ */

@media (max-width: 767px) {

  /* ── HIDE OLD MOBILE MENU ─────────────────────────────── */
  .mob-menu-info-fixed-left,
  #fm-fixed-mobile > .mob-menu-info-fixed-left {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* ── FULL-SCREEN GRID OVERLAY (Level 1) ────────────────── */
  .yella-cat-grid {
    position: fixed;
    inset: 0;
    background: #FFFFFF;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    flex-direction: column;
    will-change: transform;
  }
  .yella-cat-grid.open {
    transform: translateY(0);
  }

  /* Grid header */
  .yella-cat-grid__header {
    display: flex;
    align-items: center;
    padding: 0 4px;
    height: 56px;
    border-bottom: 1px solid #F0F0F0;
    flex-shrink: 0;
    background: #FFFFFF;
  }
  .yella-cat-grid__title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: #1A1A1A;
    padding-left: 12px;
  }
  .yella-cat-grid__close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
  }
  .yella-cat-grid__close:active {
    background: #F0F0F0;
  }
  .yella-cat-grid__close svg {
    width: 22px;
    height: 22px;
  }

  /* Grid scrollable area */
  .yella-cat-grid__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
  }

  /* Category cards */
  .yella-cat-card {
    background: #FFFFFF;
    border: 1.5px solid #F0F0F0;
    border-radius: 16px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .yella-cat-card:active {
    background: #F8F8F8;
    border-color: #CCFF00;
    transform: scale(0.97);
  }
  .yella-cat-card__icon {
    font-size: 36px;
    margin-bottom: 10px;
    line-height: 1;
  }
  .yella-cat-card__label {
    font-size: 13px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.3;
  }

  /* ── BOTTOM SHEET (Level 2/3) ──────────────────────────── */
  .yella-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .yella-sheet-backdrop.active {
    opacity: 1;
    pointer-events: all;
  }

  .yella-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: #FFFFFF;
    border-radius: 20px 20px 0 0;
    z-index: 10002;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    flex-direction: column;
    will-change: transform;
  }
  .yella-bottom-sheet.open {
    transform: translateY(0);
  }

  /* Sheet drag handle */
  .yella-sheet__handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
    flex-shrink: 0;
  }
  .yella-sheet__handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #DDD;
  }

  /* Sheet header */
  .yella-sheet__header {
    display: flex;
    align-items: center;
    padding: 0 4px 0 12px;
    height: 52px;
    border-bottom: 1px solid #F0F0F0;
    flex-shrink: 0;
  }
  .yella-sheet__back {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #1A1A1A;
    cursor: pointer;
    border-radius: 12px;
    margin-left: -4px;
    -webkit-tap-highlight-color: transparent;
  }
  .yella-sheet__back:active {
    background: #F0F0F0;
  }
  .yella-sheet__back svg {
    width: 20px;
    height: 20px;
  }
  .yella-sheet__back[style*="display: none"] + .yella-sheet__title {
    padding-left: 12px;
  }
  .yella-sheet__title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
  }
  .yella-sheet__close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
  }
  .yella-sheet__close:active {
    background: #F0F0F0;
  }
  .yella-sheet__close svg {
    width: 18px;
    height: 18px;
  }

  /* Breadcrumb dots */
  .yella-sheet__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 6px;
    flex-shrink: 0;
  }
  .yella-sheet__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E0E0E0;
    transition: all 0.25s;
  }
  .yella-sheet__dot.active {
    background: #CCFF00;
    width: 20px;
    border-radius: 4px;
  }

  /* Sheet scrollable body */
  .yella-sheet__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
  }

  /* Sheet menu items */
  .yella-sheet__item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #F4F4F4;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .yella-sheet__item:active {
    background: #F8F8F8;
  }
  .yella-sheet__item-label {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1A1A1A;
  }
  .yella-sheet__item-arrow {
    color: #CCC;
    flex-shrink: 0;
  }
  .yella-sheet__item-arrow svg {
    width: 18px;
    height: 18px;
  }
  .yella-sheet__item--leaf .yella-sheet__item-arrow {
    display: none;
  }

  /* ── SCROLL SHADOW on sheet body ───────────────────────── */
  .yella-sheet__body.has-scroll .yella-sheet__header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  /* ── BODY SCROLL LOCK ──────────────────────────────────── */
  body.yella-menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }
}

/* ── NARROW PHONES (<360px) ───────────────────────────────── */
@media (max-width: 359px) {
  .yella-cat-grid__body {
    gap: 10px !important;
    padding: 12px !important;
  }
  .yella-cat-card {
    padding: 16px 8px !important;
  }
  .yella-cat-card__icon {
    font-size: 30px !important;
  }
  .yella-cat-card__label {
    font-size: 12px !important;
  }
}
