.producto-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.producto-card:hover {
  transform: translateY(-4px);
}
.producto-card .thumb-icon {
  transition: transform 0.35s ease, background 0.35s ease;
}
.producto-card:hover .thumb-icon {
  transform: scale(1.03);
}

.lista-producto {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lista-producto:hover {
  transform: translateX(4px);
}

.skeleton-item {
  position: relative;
  overflow: hidden;
  background: #efe9dc;
}
.skeleton-item::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: rima-shimmer 1.4s infinite;
}
@keyframes rima-shimmer {
  100% { transform: translateX(100%); }
}

.producto-descripcion {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#grid-productos,
#estado-carga {
  min-height: 320px;
}
#estado-carga:empty {
  display: none;
}

.chip-categoria {
  cursor: pointer;
  user-select: none;
}

.modal {
  background: rgba(17, 17, 17, 0.45);
  backdrop-filter: blur(6px);
}

.miniatura-foto {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.miniatura-foto:hover {
  transform: translateY(-2px);
}
.miniatura-foto img {
  pointer-events: none;
}
#foto-principal img {
  transition: opacity 0.2s ease, transform 0.3s ease;
}
#foto-principal img.cambiando {
  opacity: 0.4;
  transform: scale(0.98);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d9cdb8;
  border-radius: 9999px;
  border: 2px solid #F8F5EE;
}
::-webkit-scrollbar-thumb:hover {
  background: #E36D0C;
}

/* Modal de fotos/videos: 95% de ancho y alto de la pantalla */
#modal-fotos .modal-box,
#modal-videos .modal-box {
  width: 95vw !important;
  height: 95vh !important;
  max-width: 95vw !important;
  max-height: 95vh !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
/* Las cuadriculas ocupan todo el alto y hacen scroll interno */
#modal-fotos .modal-box,
#modal-videos .modal-box {
  display: flex;
  flex-direction: column;
}
#mf-grid,
#mv-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  align-content: start;
}

/* Lightbox de foto ampliada */
#mf-lightbox {
  animation: mfFade .15s ease;
}
@keyframes mfFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Miniatura de foto: ALTO FIJO uniforme (gana a cualquier utilidad) */
#mf-grid .mf-item {
  align-self: start;
  height: 190px !important;
  overflow: hidden;
}
#mf-grid .mf-item .mf-ver {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
}
#mf-grid .mf-item img.mf-thumb,
#mf-grid .mf-thumb {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 190px !important;
  object-fit: contain !important;
}
@media (min-width: 640px) {
  #mf-grid .mf-item { height: 210px !important; }
  #mf-grid .mf-item img.mf-thumb,
  #mf-grid .mf-thumb { max-height: 210px !important; }
}

/* Modal de producto: aprovecha el alto, sin scroll en la caja; cada columna gestiona el suyo */
#modal-producto .modal-producto-box {
  width: 82vw !important;
  max-width: 82vw !important;
  height: 85vh !important;
  max-height: 85vh !important;
  overflow: hidden !important;
}
#modal-producto #modal-contenido {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#modal-producto .modal-info {
  min-height: 0;
  overflow-y: auto;
}
#modal-producto #foto-principal {
  min-height: 0;
}
#modal-producto #foto-principal img {
  max-height: 100%;
}
@media (max-width: 767px) {
  #modal-producto .modal-producto-box {
    width: 95vw !important;
    max-width: 95vw !important;
    height: 92vh !important;
    max-height: 92vh !important;
  }
  #modal-producto #modal-contenido {
    grid-template-rows: minmax(0, 45%) minmax(0, 55%);
    overflow-y: auto;
  }
  #modal-producto .modal-info {
    overflow-y: visible;
  }
}
