/* Naturista Mexicana V40 — Predictive Search Component */
/* NM_V40_1_REFINED */

.nm40-panel,
.nm40-panel *{box-sizing:border-box}

.nm40-panel{
  position:fixed;
  z-index:2147483000;
  background:#fff;
  color:#172b49;
  border:1px solid #dfe6ee;
  border-radius:16px;
  box-shadow:0 22px 58px rgba(19,48,82,.18);
  overflow:auto;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  text-align:left;
}

.nm40-panel[hidden],
.nm40-backdrop[hidden]{display:none!important}

.nm40-backdrop{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:2147482000;
  background:rgba(25,45,70,.10);
  backdrop-filter:blur(.7px);
}

.nm40-shell{
  display:grid;
  grid-template-columns:235px minmax(0,1fr);
  min-height:285px;
}

.nm40-left{
  padding:20px 16px;
  background:#fbfcfe;
  border-right:1px solid #e8edf3;
}

.nm40-block + .nm40-block{margin-top:20px}

.nm40-heading{
  color:#172b49;
  font-size:11px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:.72px;
  text-transform:uppercase;
}

.nm40-subtitle{
  margin-top:4px;
  color:#8491a1;
  font-size:10.5px;
}

.nm40-list{
  display:grid;
  gap:3px;
  margin-top:9px;
}

.nm40-suggestion,
.nm40-category{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:36px;
  padding:6px 8px;
  border-radius:9px;
  color:#344a64;
  font-size:11.5px;
  line-height:1.35;
  text-decoration:none;
  transition:background .14s ease,color .14s ease;
}

.nm40-suggestion:hover,
.nm40-category:hover,
.nm40-suggestion.nm40-active,
.nm40-category.nm40-active{
  background:#edf5ff;
  color:#0b5caf;
}

.nm40-suggestion strong,
.nm40-category strong{color:#0d56a4}

.nm40-search-icon,
.nm40-category-icon{
  width:28px;
  height:28px;
  flex:0 0 28px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#edf5ff;
  color:#1260c4;
  font-size:12px;
  font-weight:900;
}

.nm40-muted{
  padding:8px;
  color:#8997a6;
  font-size:11px;
}

.nm40-right{
  min-width:0;
  padding:20px 22px 18px;
}

.nm40-products-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding-bottom:12px;
  border-bottom:1px solid #edf1f5;
}

.nm40-catalog-link{
  color:#1260c4;
  font-size:10.5px;
  font-weight:900;
  text-decoration:none;
  white-space:nowrap;
  padding-top:1px;
}

.nm40-products{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:12px;
  padding-top:16px;
}

.nm40-product{
  display:block;
  flex:0 1 235px;
  width:min(100%,235px);
  min-width:0;
  padding:10px;
  border:1px solid #edf1f5;
  border-radius:14px;
  background:#fff;
  color:#172b49;
  text-decoration:none;
  transition:background .14s ease,border-color .14s ease,transform .14s ease,box-shadow .14s ease;
}

.nm40-product:hover,
.nm40-product.nm40-active{
  background:#fff;
  border-color:#d6e5f7;
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(18,67,119,.08);
}

.nm40-photo{
  width:100%;
  height:155px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:11px;
  background:linear-gradient(145deg,#fbfcfe,#f4f7fa);
}

.nm40-photo img{
  display:block;
  width:100%;
  height:100%;
  padding:7px;
  object-fit:contain!important;
  object-position:center;
}

.nm40-noimage{
  color:#8c99a8;
  font-size:10px;
}

.nm40-product-copy{padding:9px 2px 2px}

.nm40-product-meta{
  color:#8492a2;
  font-size:8.5px;
  line-height:1.3;
  font-weight:850;
  letter-spacing:.42px;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.nm40-product-name{
  margin-top:5px;
  min-height:36px;
  color:#172b49;
  font-size:12px;
  line-height:1.35;
  font-weight:850;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.nm40-product-name strong{color:#0c5db5}

.nm40-product-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  margin-top:10px;
}

.nm40-price{
  color:#0d4f96;
  font-size:13px;
  font-weight:950;
  white-space:nowrap;
}

.nm40-stock{
  padding:4px 7px;
  border-radius:999px;
  background:#eaf8f1;
  color:#087249;
  font-size:7.8px;
  font-weight:900;
  white-space:nowrap;
}

.nm40-stock.nm40-out{
  background:#f4f5f7;
  color:#7d8896;
}

.nm40-showall{
  display:block;
  padding:12px 18px 13px;
  border-top:1px solid #e8eef4;
  background:#fbfcfe;
  color:#27415f;
  font-size:10.5px;
  font-weight:800;
  text-align:center;
  text-decoration:none;
}

.nm40-showall:hover,
.nm40-showall.nm40-active{
  background:#f1f7fd;
  color:#0d59ad;
}

.nm40-loading,
.nm40-empty{
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:8px;
  padding:23px;
  color:#718096;
  font-size:11.5px;
  text-align:center;
}

.nm40-empty strong{
  color:#172b49;
  font-size:14px;
}

.nm40-empty a{
  margin-top:4px;
  color:#1260c4;
  font-weight:850;
  text-decoration:none;
}

.nm40-spinner{
  width:19px;
  height:19px;
  border:2px solid #dbe7f4;
  border-top-color:#1260c4;
  border-radius:50%;
  animation:nm40spin .7s linear infinite;
}

.nm40-no-products{
  width:100%;
  padding:25px;
  color:#8290a0;
  font-size:11.5px;
  text-align:center;
}

@keyframes nm40spin{to{transform:rotate(360deg)}}

@media(max-width:1030px){
  .nm40-shell{grid-template-columns:220px minmax(0,1fr)}
  .nm40-product{flex-basis:210px;width:min(100%,210px)}
  .nm40-photo{height:140px}
}

@media(max-width:760px){
  .nm40-panel{border-radius:14px}
  .nm40-backdrop{background:rgba(20,42,70,.16)}
  .nm40-shell{display:block;min-height:0}
  .nm40-left{
    padding:14px 12px 10px;
    border-right:0;
    border-bottom:1px solid #e7edf4;
  }
  .nm40-category-block{display:none}
  .nm40-list{
    display:flex;
    gap:7px;
    overflow-x:auto;
    padding-bottom:3px;
  }
  .nm40-suggestion{
    flex:0 0 auto;
    min-height:33px;
    padding:6px 9px;
    background:#f2f6fb;
  }
  .nm40-search-icon{display:none}
  .nm40-right{padding:14px 11px 11px}
  .nm40-products{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding-top:11px;
  }
  .nm40-product{width:auto;max-width:none;padding:6px}
  .nm40-photo{height:125px}
  .nm40-products-head{padding:0 2px 10px}
  .nm40-product-name{font-size:11px}
  .nm40-price{font-size:12px}
  .nm40-stock{display:none}
  .nm40-showall{padding:11px}
}

/* NM_V40_2_IMAGE_FIT */

/* La foto deja de depender de <img>; el producto siempre entra completo. */
.nm40-photo{
  height:172px;
  padding:12px;
  background:linear-gradient(145deg,#fbfcfe,#f3f6f9);
}

.nm40-photo-bg{
  width:100%;
  height:100%;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
}

/* La regla antigua de img queda anulada por compatibilidad. */
.nm40-photo img{display:none!important}

/* Con un solo producto, la tarjeta respira mejor pero no se hace enorme. */
.nm40-panel[data-product-count="1"] .nm40-product{
  flex-basis:250px;
  width:min(100%,250px);
}

.nm40-panel[data-product-count="1"] .nm40-products{
  gap:0;
}

.nm40-panel[data-product-count="2"] .nm40-product{
  flex-basis:230px;
  width:min(100%,230px);
}

@media(max-width:1030px){
  .nm40-photo{height:155px}
}

@media(max-width:760px){
  .nm40-photo{
    height:135px;
    padding:8px;
  }

  .nm40-panel[data-product-count="1"] .nm40-product,
  .nm40-panel[data-product-count="2"] .nm40-product{
    width:auto;
    max-width:none;
  }
}
