/* --------------------------------------------------------------------------
   1. Contenedor
   -------------------------------------------------------------------------- */
.NM_hero-carousel {
  position: relative;
  width: 100%;
  margin: 12px auto 0;
  padding: 0;
  box-sizing: border-box;
}

/* Espaciado hacia la sección siguiente (con o sin <script> de por medio) */
.NM_hero-carousel + section.section,
.NM_hero-carousel + script + section.section {
  padding-top: 24px; /* ajustá este valor */
}

/* --------------------------------------------------------------------------
   2. Track (contenedor scrolleable de slides)
   -------------------------------------------------------------------------- */
.NM_hero-carousel__track {
  display: flex;
  width: 100%;
  aspect-ratio: 1800 / 480;
  border-radius: 5;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-shadow: var(--shadow-lg);
  background-color: var(--bg-secondary);
}

.NM_hero-carousel__track::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   3. Slide / Imagen
   -------------------------------------------------------------------------- */
.NM_hero-carousel__slide {
  position: relative;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.NM_hero-carousel__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: var(--focus-x, 50%) center;
  display: block;
}

/* --------------------------------------------------------------------------
   4. Flechas prev/next
   Sutiles, casi invisibles hasta hacer hover/focus
   -------------------------------------------------------------------------- */
.NM_hero-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(3px);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  z-index: 5;
  opacity: 0.4;
  box-shadow: none;
  transition: opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.NM_hero-carousel__arrow:hover {
  background: rgba(255, 255, 255, 0.85);
  opacity: 1;
  box-shadow: var(--shadow-md);
  transform: translateY(-50%) scale(1.05);
}

.NM_hero-carousel__arrow:focus-visible {
  opacity: 1;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.NM_hero-carousel__arrow--prev {
  left: 40px;
}

.NM_hero-carousel__arrow--next {
  right: 40px;
}

/* --------------------------------------------------------------------------
   5. Dots indicadores
   -------------------------------------------------------------------------- */
.NM_hero-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0px;
  bottom: 0px;
  margin-top: 0px;
  z-index: 5;
}

.NM_hero-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--color-accent);
  background-color: transparent;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, width 0.2s ease, border-radius 0.2s ease;
}

.NM_hero-carousel__dot:hover {
  background-color: var(--color-accent-glow);
}

.NM_hero-carousel__dot.NM_is-active {
  background-color: var(--color-accent);
  width: 26px;
  border-radius: 6px;
}

.NM_hero-carousel__dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   6. Responsive — Hero Carousel
   -------------------------------------------------------------------------- */

/* Tablet: la imagen sigue siendo protagonista, se recorta un poco más
   vertical en vez de quedar como una tira delgada */
@media (max-width: 768px) {
  .NM_hero-carousel__track ,
  .NM_hero-carousel__slide,
  .NM_hero-carousel {           /* Cambia según el selector real de tu sitio */
      aspect-ratio: 20 / 9;
      height: 160px !important;     /* Antes probablemente era 400-500px */
      max-height: 160px !important;
      border-radius: 5;
  }


}

@media (max-width: 576px) {
  .NM_hero-carousel {
    padding: 0;
    margin-top: 6px;
  }

  .NM_hero-carousel__track {
    aspect-ratio: 20 / 9;
   
  }

  .NM_hero-carousel__arrow {
    width: 40px;
    height: 40px;
  }

  .NM_hero-carousel__arrow--prev {
    left: 16px;
  }

  .NM_hero-carousel__arrow--next {
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .NM_hero-carousel__track {
    scroll-behavior: auto;
  }
}

/* --------------------------------------------------------------------------
   7. Responsive — Productos Destacados (2 columnas en mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .NM_featured-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .NM_featured-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   7b. Responsive — Categorías Destacadas (cards pegadas, sin margen)
   -------------------------------------------------------------------------- */
/* 1. Creamos una "caja" rígida cuadrada (1/1) para la imagen */
.NM_category-card .category-card__image-container {
  width: 100%;
  aspect-ratio: 1 / 1; /* 1/1 hace un cuadrado. Si las querés rectangulares, usá 4/3 */
  overflow: hidden;     /* Oculta lo que sobra de la imagen */
  background-color: var(--bg-secondary); /* Fondo gris suave mientras carga */
  display: flex;
  align-items: center;
  justify-content: center; /* Centra el icono de fallback si no hay imagen */
  border-radius: var(--border-radius-sm); /* Bordes redondeados en PC */
}

/* 2. Obligamos a la imagen a llenar esa caja sin deformarse */
.NM_category-card .category-card__image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* ¡La magia está acá! Rellena el espacio y recorta los sobrantes */
  display: block;
  transition: transform 0.3s ease; /* Opcional: efecto zoom suave al pasar el mouse */
}




.NM_categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; /* Ajustá este valor si querés más o menos separación */
}

/* Responsive: En mobile las cards se pegan y pierden el borde redondeado */
@media (max-width: 768px) {
  .NM_categories-grid {
    gap: 0 !important;
    row-gap: 0 !important;
    column-gap: 0 !important;
  }

  .NM_category-card {
    margin: 0 !important;
    border-radius: 0;
    padding: 0px !important;
  }
}

/* --------------------------------------------------------------------------
   8. Responsive — Footer grid
   (antes estaba disperso dentro de los media queries del carrusel)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CAT_ — Estilos de Catálogo (catalog.html)
   Clases con prefijo CAT_ para no colisionar con otros templates.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Contenedor / Breadcrumbs
   -------------------------------------------------------------------------- */
.CAT_container {
  padding-top: 0px;
}

.CAT_breadcrumbs {
  font-size: 14px;
  margin-bottom: 0px;
  color: var(--text-secondary);
}

.CAT_breadcrumb-current {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   2. Encabezado de Categoría
   -------------------------------------------------------------------------- */
.CAT_header {
  margin-bottom: 0px;
  padding: 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  position: relative;
  overflow: hidden;
}

.CAT_header-inner {
  position: relative;
  z-index: 0;
  max-width: 1000px;
}

.CAT_header-title {
  font-size: 28px;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.CAT_header-description {
  color: var(--text-secondary);
  font-size: 15px;
}

.CAT_header-banner-mask {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
  mask-image: linear-gradient(to left, rgba(0,0,0,1), rgba(0,0,0,0));
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1), rgba(0,0,0,0));
}

.CAT_header-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   3. Filtros (Sidebar)
   -------------------------------------------------------------------------- */
.CAT_sort-select {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
}

.CAT_price-range {
  display: flex;
  gap: 8px;
  align-items: center;
}

.CAT_price-range-separator {
  color: var(--text-muted);
}

.CAT_price-input {
  padding: 8px 12px;
  font-size: 13px;
}

.CAT_price-apply-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   4. Estado vacío (sin productos)
   -------------------------------------------------------------------------- */
.CAT_empty-state {
  text-align: center;
  padding: 60px 40px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
}

.CAT_empty-state-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.CAT_empty-state-title {
  font-size: 20px;
  margin-bottom: 8px;
}

.CAT_empty-state-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ==========================================================================
   Catálogo Layout (Desktop por defecto)
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr; /* 280px es el ancho del sidebar, ajustalo si es distinto */
  gap: 24px;
  align-items: start;
}

/* Ocultar botón y overlay en PC */
.CAT_filter-mobile-toggle,
.CAT_filter-overlay {
  display: none;
}

/* ==========================================================================
   Catálogo Layout (Mobile / Tablet)
   ========================================================================== */
@media (max-width: 768px) {

  /* 1. El grid pasa a 1 sola columna para los productos */
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  /* 2. Mostramos el botón de filtros */
  .CAT_filter-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
  }

  /* Convertimos el sidebar en un cajón fijo que sale de la pantalla */
  .catalog-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh; /* Ocupa toda la altura de la pantalla */
    background-color: var(--bg-primary);
    z-index: 1000;
    padding: 24px;
    padding-top: 40px;
    overflow-y: auto; /* Por si los filtros son más largos que la pantalla */
    box-shadow: var(--shadow-lg);
    /* Lo escondemos hacia la izquierda */
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  /* Clase que se agrega con JS para mostrarlo */
  .catalog-sidebar.CAT_is-open {
    transform: translateX(0);
  }

  /* fondo oscuro (overlay) */
  .CAT_filter-overlay {
    display: block;
    position: fixed;
    inset: 0; /* Cubre toda la pantalla */
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .CAT_filter-overlay.CAT_is-open {
    opacity: 1;
    visibility: visible;
  }

  .CAT_featured-grid {

    grid-template-columns: repeat(2, 1fr) !important;

    gap: 12px;

  }


}

@media (max-width: 480px) {

  .CAT_featured-grid {

    grid-template-columns: repeat(2, 1fr) !important;

    gap: 8px;

  }

}

/* ==========================================================================
   NM_footer-bar — Barra de navegación inferior (solo mobile)
   ========================================================================== */
.NM_footer-bar {
  display: none; /* oculta por defecto en desktop */
}

@media (max-width: 768px) {

  .nav-brand{
      position: relative;
      top: 0px;
      left: 0px;
      z-index: 20; /* por encima del contenido del header, no del documento entero */
      display: flex;
      align-items: left;
      flex-direction: column-reverse;
  }
  .NM_footer-bar {
    display: flex;              /* fila horizontal */
    flex-direction: row;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-gray);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--bg-secondary);
    border-radius: 20px;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    margin: 0;
    list-style: none;
    will-change: bottom;
  }
  .NM_hero-carousel__img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: var(--focus-x, 50%) center;
      display: block;
      /* Opcional: para más control */
      /* max-width: none; */
  }
  .NM_footer-bar__item {
    flex: 1 1 0;
    display: flex;
  }

  .NM_footer-bar__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 4px 0;
  }

  .NM_footer-bar__icon {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .NM_footer-bar__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .NM_footer-bar__badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background-color: var(--color-danger, red);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
  }

  .NM_footer-bar__text {
    font-size: 11px;
  }

  .NM_footer-bar__link.NM_is-active {
    color: var(--color-accent);
  }

  /* Evita que el contenido quede tapado detrás de la barra fija */
  body {
    padding-bottom: 56px;
  }
}