/* IDEAS Web v10 · Mobile Catalog UX
   Non-sticky, non-overlay filtering. Controls stay in normal document flow. */

.mobile-catalog-tools,
.catalog-load-more-wrap,
.mobile-filter-backdrop,
.mobile-filter-sheet-head,
.mobile-apply-filters{display:none}

.filter-panel-top{display:flex;justify-content:space-between;align-items:center}
.catalog-load-more-wrap{align-items:center;justify-content:center;flex-direction:column;gap:8px;margin:26px 0 4px}
.catalog-load-more{min-width:220px;min-height:48px;border:1px solid #111316;border-radius:10px;background:#111316;color:#fff;font-weight:600;padding:0 20px;cursor:pointer}
.catalog-load-more-wrap span{font-size:12px;color:var(--muted)}

@media(max-width:900px){
  .shop-toolbar{display:none!important}

  /* The entire mobile catalog toolbar stays in normal flow.
     No sticky layer means it never covers product content while scrolling. */
  .mobile-catalog-tools{
    display:block;
    position:static!important;
    top:auto!important;
    z-index:auto!important;
    background:transparent!important;
    backdrop-filter:none!important;
    padding:0 0 14px!important;
    border-bottom:0!important;
    margin:0 0 6px!important;
  }

  .mobile-catalog-topline{
    display:flex;justify-content:space-between;align-items:center;gap:12px;
    margin-bottom:12px
  }
  .mobile-catalog-topline strong{font-size:18px}
  .mobile-catalog-topline span{font-size:13px;color:var(--muted)}

  .mobile-search-wrap{position:relative}
  .mobile-search-icon{
    position:absolute;left:15px;top:50%;transform:translateY(-50%);
    font-size:18px;color:#707780;pointer-events:none
  }
  .mobile-shop-search{
    width:100%;height:52px;border:1px solid var(--line);border-radius:12px;
    background:var(--paper);padding:0 14px 0 44px;font:inherit;color:inherit;outline:none
  }
  .mobile-shop-search:focus{
    border-color:#8f969f;box-shadow:0 0 0 3px rgba(17,19,22,.05)
  }

  /* Category shortcuts are horizontal and self-contained. */
  .mobile-category-chips{
    display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;
    padding:11px 0 5px;scrollbar-width:none;scroll-snap-type:x proximity
  }
  .mobile-category-chips::-webkit-scrollbar{display:none}
  .mobile-category-chip{
    flex:0 0 auto;scroll-snap-align:start;white-space:nowrap;
    border:1px solid var(--line);background:var(--paper);color:var(--ink);
    border-radius:999px;min-height:38px;padding:0 14px;font-size:13px;font-weight:600
  }
  .mobile-category-chip.active{background:var(--ink);color:var(--paper);border-color:var(--ink)}

  .mobile-actions-row{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}
  .mobile-filter-btn,.mobile-reset-btn{
    min-height:44px;border-radius:10px;border:1px solid var(--line);
    background:var(--paper);color:var(--ink);font-weight:600;padding:0 15px
  }
  .mobile-filter-btn{
    display:flex;align-items:center;gap:8px;justify-content:center
  }
  .mobile-filter-btn b{
    min-width:22px;height:22px;border-radius:50%;background:var(--red);color:#fff;
    display:inline-grid;place-items:center;font-size:11px
  }
  .mobile-reset-btn{color:var(--muted)}

  /* No modal backdrop and no fixed/bottom sheet. */
  .mobile-filter-backdrop{display:none!important}

  /* Inline collapsible filters. They open immediately below the mobile controls,
     push content down, and cannot overlap product cards. */
  .filters-panel{
    display:none!important;
    position:static!important;
    inset:auto!important;
    z-index:auto!important;
    width:100%!important;
    max-height:none!important;
    overflow:visible!important;
    transform:none!important;
    box-shadow:none!important;
    border:1px solid var(--line)!important;
    border-radius:12px!important;
    padding:14px 16px!important;
    margin:0 0 16px!important;
    background:var(--paper)!important;
  }
  .filters-panel.open{display:block!important}

  .mobile-filter-sheet-head{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:0 0 10px;border-bottom:1px solid var(--line);margin-bottom:2px
  }
  .mobile-filter-sheet-head small{display:none}
  .mobile-filter-sheet-head h3{margin:0;font-size:18px}
  .mobile-filter-close{
    width:38px;height:38px;border-radius:10px;border:1px solid var(--line);
    background:var(--paper);color:var(--ink);font-size:22px;line-height:1
  }
  .filter-panel-top{display:none}
  .mobile-apply-filters{
    display:block;width:100%;height:46px;border:0;border-radius:10px;
    background:var(--ink);color:var(--paper);font-weight:700;margin-top:12px
  }

  .filter-group{padding:12px 0;border-bottom:1px solid var(--line)}
  .filter-group:last-of-type{border-bottom:0}
  .filter-group h4{font-size:14px;margin:0 0 7px}
  .check{font-size:14px;padding:7px 0;min-height:42px}

  /* Product listing starts cleanly after filters. */
  .shop-main{min-width:0}
  .shop-grid{gap:14px}
  .shop-grid .p-card{border-radius:12px;overflow:hidden}

  /* More compact image field on phones. Avoid a single card taking the entire screen. */
  .shop-grid .p-media{
    aspect-ratio:4/3!important;
    height:auto!important;
    min-height:0!important;
  }
  .shop-grid .p-media img{
    width:100%!important;height:100%!important;object-fit:contain!important;
    padding:8px!important
  }
  .shop-grid .p-body{padding:15px 14px 16px}
  .shop-grid .p-card h3{font-size:22px;min-height:0}
  .shop-grid .p-card p{
    font-size:14px;line-height:1.45;
    -webkit-line-clamp:3!important;min-height:0!important
  }
  .shop-grid .colors{min-height:28px}
  .shop-grid .product-price{min-height:30px}
  .shop-grid .p-actions{grid-template-columns:1fr 1fr!important;gap:9px}
  .shop-grid .p-actions .btn{min-height:46px;font-size:14px}

  .catalog-load-more-wrap:not([hidden]){display:flex}

  /* Floating helpers should not cover purchase buttons on mobile. */
  .backtop{display:none!important}
  .wa{right:14px!important;bottom:14px!important;width:54px!important;height:54px!important}
}

@media(max-width:520px){
  .shop-grid .p-media{aspect-ratio:1/1!important}
  .mobile-category-chip{padding:0 13px;font-size:12px}
  .shop-grid .p-actions{grid-template-columns:1fr 1fr!important}
  .catalog-load-more{width:100%;min-height:50px}
}


/* =========================================================
   v11 · FILTROS MOBILE COMPACTOS
========================================================= */
@media(max-width:900px){
  .mobile-catalog-tools{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }

  .mobile-category-chips{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  .mobile-actions-row{
    width:100%!important;
    max-width:100%!important;
  }

  .filters-panel.open{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }

  .filter-accordion{
    display:block!important;
    padding:0!important;
    border-bottom:1px solid var(--line)!important;
  }

  .filter-accordion:last-of-type{
    border-bottom:0!important;
  }

  .filter-accordion summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:50px;
    padding:0!important;
    cursor:pointer;
    list-style:none;
    font-size:14px;
    font-weight:700;
    color:var(--ink);
    user-select:none;
  }

  .filter-accordion summary::-webkit-details-marker{
    display:none;
  }

  .filter-accordion summary b{
    display:grid;
    place-items:center;
    width:28px;
    height:28px;
    border-radius:8px;
    background:var(--soft);
    color:var(--muted);
    font-size:16px;
    line-height:1;
    transition:transform .18s ease;
  }

  .filter-accordion[open] summary b{
    transform:rotate(180deg);
  }

  .filter-options{
    padding:0 0 10px;
  }

  .filter-accordion:not([open]) .filter-options{
    display:none!important;
  }

  .filter-options .check{
    min-height:40px;
    padding:6px 2px;
  }

  /* Botón de resultados queda visible al final del bloque,
     pero el usuario no necesita bajar por listas infinitas. */
  .mobile-apply-filters{
    position:static!important;
    margin-top:12px!important;
  }
}

/* Desktop conserva filtros completamente desplegados */
@media(min-width:901px){
  .filter-accordion summary{
    pointer-events:none;
    list-style:none;
  }
  .filter-accordion summary::-webkit-details-marker{
    display:none;
  }
  .filter-accordion summary b{
    display:none;
  }
  .filter-options{
    display:block!important;
  }
}
