/* Sección de Filtros */
.filter-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
}
.filter-item {
  display: flex;
  align-items: center;
  height: 40px; /* Altura uniforme */
  font-weight: normal;
  font-size: 14px;
  white-space: nowrap;
}
.filter-item.label {
  flex: 0 0 auto;
}
.filter-item.search {
  flex: 0 0 200px;
}
.filter-item.search label {
  margin-right: 5px;
}
.filter-item.details {
  flex: 0 0 150px;
  position: relative;
  z-index: 1; /* Base stacking to allow elevation when open */
  overflow: visible; /* Permite que el panel flotante se muestre fuera del contenedor */
}
/* Cuando el filtro está abierto, elevar el contenedor para evitar solapes con campos siguientes */
.filter-item.details.is-open {
  z-index: 10000;
}
.filter-item.checkbox {
  flex: 0 0 auto;
  padding: 0 5px;
}
.filter-item.buttons {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}
.filter-item.export {
  flex: 0 0 auto;
}
.filter-item.search input[type="text"] {
  height: 100%;
  padding: 0 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* Filtros desplegables */
details.filtro {

  background: none;
  width: 100%;
  position: relative;
  margin: 0;
}
/* Cuando el filtro está abierto, elevar por encima de los hermanos para que el panel no quede solapado */
details.filtro[open] {
  z-index: 5000;
}
details.filtro summary {
  display: block;
  width: 100%;
  padding: .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
  cursor: pointer;
  user-select: none;
  position: relative; /* Asegura un stacking context */
  z-index: 1001;      /* Base; en [open] elevamos para estar sobre el backdrop */
}
/* Cuando está abierto, elevamos el summary por encima del backdrop pero por debajo del panel */
/* Mantiene el summary por encima del contenido interno sin necesidad de overlay */
details.filtro[open] summary { z-index: 1001; }
/* Oculta el marcador nativo en Safari/WebKit para evitar duplicado con el pseudo-flecha */
details.filtro summary::-webkit-details-marker {
  display: none;
}
details.filtro summary::after {
  content: "▼";
  float: right;
  font-size: 1em;
  margin: auto;
  margin-left: 12px;
  /* Deja pasar los clics al summary en Safari */
  pointer-events: none;
}
details.filtro .checkbox-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max(240px, 100%);
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 40px 10px 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  z-index: 7000; /* Panel por encima de otros filtros */
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
details.filtro[open] .checkbox-list {
  display: block;
}
/* Eliminamos cualquier backdrop para mantener conexión visual con el summary */
.checkbox-list div {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}
.checkbox-list div label {
  margin-left: 5px;
}

/* Botones de la barra de filtros */
.filter-item.buttons button {
  height: 100%;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.filter-item.buttons button:hover {
  background: #333;
}
.filter-item.export button {
  height: 100%;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: none;
  color: #333;
  font-size: 14px;
  cursor: pointer;
}
.filter-item.export button:hover {
  background: #f0f0f0;
}
#seleccion-info {
  text-align: center;
  font-size: 14px;
  margin-top: 5px;
  font-weight: normal;
}

/* Sección de Categorías */

#cards-categorias {
  display: grid;
  gap: 2%;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
#cards-categorias div.card {
  cursor: pointer;
}
#catalogo-productos .cards-container {
  display: grid;
  /*grid-template-columns: repeat(4, minmax(23%, 23%));*/
  /*gap: 2rem;*/
}
.product-category-group {
  margin-bottom: 80px;
}
.product-category-header {
  margin-bottom: 40px;
  font-size: 20px;
  text-align: left;
}
/* Estructura de la Card de Producto */
.card.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}
.product-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 0;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
}
.export-checkbox {
  background: rgba(0,0,0,0.1);
  color: #000;
  text-align: center;
  padding: 5px;
}
.form-check-label {
  font-size: 14px;
  cursor: pointer;
}
.export-checkbox input[type="checkbox"] {
  margin-right: 5px;
}
.product-card-info {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  text-align: center;
  color: #000;
  font-weight: normal;
}
.product-card-info .variety-name {
  font-size: 32px;
  margin-bottom: 5px;
  font-weight: 300;
  color: rgba(0,0,0,0.6);
}
.product-card-info .variety-japan {
  font-size: 18px;
  margin-bottom: 5px;
}
.product-card-info .variety-color {
  font-size: 20px;
  font-weight: 400;
  color: rgba(0,0,0,0.6);  
}

/* Etiqueta NEW en productos */
.new-badge {
  position: absolute;
  top: 0;
  left: 20px;
  background: var(--colibri-violeta);
  color: #fff;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 0 0 5px 5px;
  z-index: 5;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  width: 50%;
  /* max-width: 800px; */
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 10dvh 25%;
  height: 80vh;
}
.modal-header {
  background: #000;
  color: #fff;
  border: unset;
  border-top-left-radius: unset;
  border-top-right-radius: unset;
}
.modal-subheader {
  display: flex;
  width: 95%;
  text-align: center;
  flex-direction: column;
}
h4#modal-title {
  font-size: 1.2rem;
}
#modal-color {
  font-size: 1rem;
}
.modal-close {
  position: absolute;
  width: 5%;
  top: 0.5rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-content {
  width: 100%;
  border: unset;
  padding: 16px 16px 0 16px;
  height: inherit;
}
.modal-main-image {
  object-fit: contain;
  height: 50dvh;
  margin: 10px 10px 0 10px;
}
.modal-main-arrow {
  max-width: 40px;
  height: auto;
  margin: auto auto 0 auto;
}
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
}
.modal-prev {
  left: 0;
}
.modal-next {
  right: 0;
}
.modal-prev img, .modal-next img {
  width: 60px;
}
.modal-thumbnails {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f0f0f0;
}
.modal-thumb {
  width: 60px;
  height: auto;
  cursor: pointer;
  border: 1px solid #ccc;
}
.modal-footer {
  border-top: unset;
  justify-content: start;
}

/* Modal PDF */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
}
.pdf-column {
  border: 1px solid #ccc;
  padding: 0;
}
.pdf-heading {
  display: block;               /* Se comporta como bloque para ocupar todo el ancho */
  background-color: #000;         /* Fondo negro */
  color: #fff;                  /* Texto en blanco */
  text-align: center;           /* Texto centrado */
  width: 100%;                  /* Ocupa el 100% del ancho del contenedor */
  padding: 0.5rem;              /* Espaciado interno para darle altura */
  box-sizing: border-box;       /* Para que el padding se sume al ancho total */
}
.pdf-quality-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 10px;
  margin-left: 10px;
  gap: 10px;
}
.checklist {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 0.5rem;
}
.checklist-header {
  font-weight: normal;
  background: #444;
  color: #fff;
  padding: 0.3rem;
  margin-top: 0.5rem;
}
.checklist-item {
  display: flex;
  align-items: center;
  margin: 0.3rem;
}
.checklist-item label {
  margin-left: 0.3rem;
  font-weight: normal;
}


@media (max-width: 768px) {
  /* En móvil: mantener barra compacta, listas ancladas al summary con scroll interno */
  .filter-item { height: 40px; align-items: center; }
  details.filtro .checkbox-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 60vh; /* Más alta en móvil para facilitar navegación */
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  }
  .modal {
    background: #fff;
    width: 90vw;
    /* max-width: 800px; */
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 10dvh 5dvw;
    height: 80vh;
  }
  h4#modal-title {
    font-size: 0.8rem;
  }
  #modal-color {
    font-size: 0.7rem;
  }
  .modal-prev img, .modal-next img {
    width: 30px;
  }
  .modal-main-image {
    height: auto;
    bottom: 0;
    position: absolute;
  }
  #catalogo-productos .cards-container {
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
  }
}
@media (min-width: 992px) {
  #catalogo-productos .cards-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}
@media (min-width: 1200px) {
  #catalogo-productos .cards-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}
@media (min-width: 1400px) {
  #catalogo-productos .cards-container {
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
  }
}
/* Sin bloqueo de scroll ni backdrop: se mantiene navegación del fondo */