/* =========================================================
   NERDVANA - FILTROS MÓVILES Y TABLET
========================================================= */

.nv-shop-mobile-filters {
  display: none;
}

@media (max-width: 1024px) {

  /* Sidebar original oculto */
  #sidebar {
    display: none !important;
  }
  
  .woocommerce-notices-wrapper{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:28px;
      
  }

  .nv-shop-mobile-filters{
    margin:0;
      
  }

  .woocommerce-ordering{
    margin:0 !important;
      
  }

  /* Contenedor del botón */
  .nv-shop-mobile-filters {
    display: block;
    width: 100%;
    margin: 28px 0 26px;
  }

  /* Botón principal */
  .nv-shop-filter-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: auto;
    min-height: 48px;
    padding: 0 20px;

    border: 1px solid #e1e5eb;
    border-radius: 14px;

    background: #fff;
    color: #111827;

    font-size: 15px;
    line-height: 1;
    font-weight: 700;

    box-shadow: 0 8px 22px rgba(0, 0, 0, .06);
    cursor: pointer;

    transition:
      border-color .2s ease,
      color .2s ease,
      transform .2s ease,
      box-shadow .2s ease;
  }

  .nv-shop-filter-open:hover {
    border-color: #e12626;
    color: #e12626;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .09);
  }

  .nv-shop-filter-open svg {
    flex: 0 0 20px;
  }

  /* Fondo oscuro */
  .nv-shop-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;

    background: rgba(3, 21, 30, .62);
    backdrop-filter: blur(2px);
  }

  .nv-shop-filter-overlay[hidden] {
    display: none !important;
  }

  /* Panel */
  .nv-shop-filter-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    z-index: 99998;

    width: min(390px, 90vw);
    max-width: 100%;

    display: flex;
    flex-direction: column;

    background: #fff;
    color: #111827;

    box-shadow: 20px 0 60px rgba(0, 0, 0, .24);

    transform: translateX(-105%);
    transition: transform .26s ease;
  }

  .nv-shop-filter-panel.is-open {
    transform: translateX(0);
  }

  /* Evitar que la barra de administración tape el encabezado */
  body.admin-bar .nv-shop-filter-panel {
    top: 32px;
  }

  /* Cabecera */
  .nv-shop-filter-header {
    position: relative;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 20px;

    background: #00384f;
    color: #fff;

    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }

  .nv-shop-filter-eyebrow {
    display: block;
    margin-bottom: 4px;

    color: rgba(255, 255, 255, .70);

    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .nv-shop-filter-header h2 {
    margin: 0;

    color: #fff;

    font-size: 21px;
    line-height: 1.2;
    font-weight: 800;
  }

  .nv-shop-filter-close {
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 0;
    border-radius: 12px;

    background: rgba(0, 0, 0, .20);
    color: #fff;

    cursor: pointer;
  }

  .nv-shop-filter-close:hover {
    background: rgba(0, 0, 0, .34);
  }

  /* Zona desplazable */
  .nv-shop-filter-content {
    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 20px;
    background: #f7f7f8;
  }

  /* Cada sección */
  .nv-shop-filter-section {
    width: 100%;
    margin: 0 0 18px !important;
    padding: 18px;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    background: #fff;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .035);
  }

  .nv-shop-filter-section:last-child {
    margin-bottom: 0 !important;
  }

  .nv-shop-filter-section h5,
  .nv-shop-filter-section .widget-title,
  .nv-shop-filter-section .wp-block-heading {
    margin: 0 0 14px !important;

    color: #111827;

    font-size: 16px !important;
    line-height: 1.3;
    font-weight: 800;
  }

  /* Categorías */
  .nv-shop-filter-content .nv-sidebar-categories select {
    width: 100%;
    min-height: 48px;

    padding: 0 14px;

    border: 1px solid #d9dee7;
    border-radius: 11px;

    background: #fff;
    color: #111827;

    font-size: 14px;
    box-sizing: border-box;
  }

  .nv-shop-filter-content .nv-sidebar-categories select:focus {
    border-color: #e12626;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(225, 38, 38, .10);
  }

  /* Estructura interna de filtros WooCommerce */
  .nv-shop-filter-content .wc-block-product-filters__overlay,
  .nv-shop-filter-content .wc-block-product-filters__overlay-wrapper,
  .nv-shop-filter-content .wc-block-product-filters__overlay-dialog,
  .nv-shop-filter-content .wc-block-product-filters__overlay-content {
    position: static !important;
    inset: auto !important;

    display: block !important;

    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    padding: 0 !important;
    margin: 0 !important;

    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;

    background: transparent !important;
    box-shadow: none !important;
  }

  /* Filtro por precio */
  .nv-shop-filter-content
  .wc-block-product-filter-price-slider__content {
    padding-top: 6px;
  }

  .nv-shop-filter-content
  .wc-block-product-filter-price-slider__range {
    margin-bottom: 18px;
  }

  .nv-shop-filter-content
  .wc-block-product-filter-price-slider__left.text input,
  .nv-shop-filter-content
  .wc-block-product-filter-price-slider__right.text input {
    min-height: 42px;
    border-radius: 9px;
    font-size: 13px;
  }

  /* Productos populares */
  .nv-shop-filter-popular {
    padding-bottom: 10px;
  }

  .nv-shop-filter-popular .nv-sidebar-products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .nv-shop-filter-popular .nv-sidebar-product {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;

    padding: 12px 0;

    border-bottom: 1px solid #eceff3;
  }

  .nv-shop-filter-popular .nv-sidebar-product:first-child {
    padding-top: 0;
  }

  .nv-shop-filter-popular .nv-sidebar-product:last-child {
    border-bottom: 0;
  }

  .nv-shop-filter-popular .nv-sidebar-product-image {
    display: block;
    width: 64px;
    height: 64px;
  }

  .nv-shop-filter-popular .nv-sidebar-product-image img {
    width: 64px;
    height: 64px;

    object-fit: cover;

    border: 1px solid #eceff3;
    border-radius: 10px;
    background: #fff;
  }

  .nv-shop-filter-popular .nv-sidebar-product-info {
    min-width: 0;
  }

  .nv-shop-filter-popular .nv-sidebar-product-info a {
    color: #111827;
    text-decoration: none;
  }

  .nv-shop-filter-popular .nv-sidebar-product-title {
    display: -webkit-box;
    overflow: hidden;

    color: #111827;

    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .nv-shop-filter-popular .nv-sidebar-product-price {
    display: block;
    margin-top: 5px;

    color: #6b7280;

    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
  }

  /* Pie fijo */
  .nv-shop-filter-footer {
    flex: 0 0 auto;

    padding: 16px 20px;

    border-top: 1px solid #e5e7eb;
    background: #fff;

    box-shadow: 0 -8px 20px rgba(0, 0, 0, .04);
  }

  .nv-shop-filter-view-products {
    width: 100%;
    min-height: 50px;

    padding: 0 18px;

    border: 0;
    border-radius: 12px;

    background: #e12626;
    color: #fff;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;
  }

  .nv-shop-filter-view-products:hover {
    background: #c91818;
  }

  html.nv-filters-open {
    overflow: hidden;
  }
}

/* Barra administrativa móvil */
@media (max-width: 782px) {
  body.admin-bar .nv-shop-filter-panel {
    top: 46px;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .nv-shop-mobile-filters {
    margin-top: 32px;
  }

  .nv-shop-filter-open {
    width: 100%;
  }

  .nv-shop-filter-panel {
    width: min(360px, 92vw);
  }

  .nv-shop-filter-content {
    padding: 14px;
  }

  .nv-shop-filter-section {
    padding: 15px;
    border-radius: 14px;
  }
}

/*FIX*/
@media (max-width: 1024px) {
  .nv-shop-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    margin: 26px 0;
  }

  .nv-shop-controls-row .nv-shop-mobile-filters {
    width: auto;
    margin: 0;
  }

  .nv-shop-controls-row .woocommerce-ordering {
    width: auto;
    margin: 0 !important;
  }

  .nv-shop-controls-row .woocommerce-ordering select {
    min-height: 48px;
    margin: 0;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .nv-shop-controls-row {
    gap: 10px;
    margin: 24px 0 20px;
  }

  .nv-shop-controls-row .nv-shop-mobile-filters,
  .nv-shop-controls-row .woocommerce-ordering {
    flex: 1 1 0;
    min-width: 0;
  }

  .nv-shop-controls-row .nv-shop-filter-open,
  .nv-shop-controls-row .woocommerce-ordering select {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
    font-size: 13px;
  }
}