/* ==========================================================
   Angal · Parrilla editorial (listados de producto)
   ========================================================== */

/* Parrilla de 12 columnas: casillas normales = 3 por fila */
#js-product-list .products.ap-grid {
  display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense; column-gap: 16px; row-gap: 32px; margin-left: 0; margin-right: 0;
}
#js-product-list .products.ap-grid::before,
#js-product-list .products.ap-grid::after { display: none; }
#js-product-list .products.ap-grid > * {
  grid-column: span 3; width: auto !important; max-width: none !important; flex: none !important;
  padding-left: 0 !important; padding-right: 0 !important; min-width: 0;
}

/* Vista de galería: producto destacado a 2×2 (columnas y filas) y 4 productos normales al lado */
#js-product-list .products.ap-grid.ap-cols-3 > * { grid-column: span 4; }
#js-product-list .products.ap-grid > .ap-small { grid-column: span 3; }
#js-product-list .products.ap-grid.ap-cols-3 > .ap-small { grid-column: span 4; }
#js-product-list .products.ap-grid > .ap-feat { grid-column: span 6; grid-row: span 2; }
#js-product-list .products.ap-grid.ap-cols-3 > .ap-feat { grid-column: span 8; }
/* la foto del destacado llena el alto de las dos filas (el texto va debajo, como en el resto) */
.ap-feat > .js-product-miniature { height: 100%; }
.ap-feat > .js-product-miniature { display: flex; flex-direction: column; }
.ap-feat .thumbnail-container { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.ap-feat .product-thumbnail { flex: 1 1 auto; display: block; position: relative; min-height: 0; }
.ap-feat .product-thumbnail { overflow: hidden; }
.ap-feat .product-thumbnail picture, .ap-feat .product-thumbnail img { display: block; width: 100%; height: 100%; }
/* la 2.ª foto (la del rollover) va superpuesta: su <picture> no debe ocupar sitio, o tapa el texto y la lupa de color */
.ap-feat .product-thumbnail picture:not(:first-of-type) { height: 0 !important; }
.ap-feat .product-thumbnail img { object-fit: cover; aspect-ratio: auto !important; }
.ap-feat .product-description { flex: none; }

/* Casilla con foto de detalle */
.ap-detail .product-thumbnail img.product-thumbnail-first { object-fit: cover; }

/* Lupa de color */
.ap-has-colors { flex-wrap: wrap; }
.ap-colors { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 8px; justify-content: inherit; }
.ap-color {
  display: block; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background-color: #ddd; background-size: 900%; background-position: 50% 45%; background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); transition: box-shadow .15s ease, transform .15s ease;
}
.ap-color.is-current { box-shadow: 0 0 0 1px #fff, 0 0 0 2px #1a1a1a; }
a.ap-color:hover, a.ap-color:focus-visible { transform: scale(1.25); box-shadow: 0 0 0 1px #fff, 0 0 0 2px #767676; outline: none; }

/* Tablet y móvil: 2 productos por fila; el destacado ocupa la fila entera */
@media (max-width: 991px) {
  #js-product-list .products.ap-grid { column-gap: 12px; row-gap: 24px; }
  #js-product-list .products.ap-grid > *, #js-product-list .products.ap-grid.ap-cols-3 > * { grid-column: span 6; }
  #js-product-list .products.ap-grid > .ap-small, #js-product-list .products.ap-grid.ap-cols-3 > .ap-small { grid-column: span 6; }
  #js-product-list .products.ap-grid > .ap-feat, #js-product-list .products.ap-grid.ap-cols-3 > .ap-feat { grid-column: span 12; grid-row: auto; }
}
/* Móvil: igual que en tablet, 2 productos por fila y el destacado a todo el ancho (1 por fila) */
@media (max-width: 575px) {
  #js-product-list .products.ap-grid { column-gap: 8px; row-gap: 20px; }
  /* la regla del Theme Editor «Listado en móvil: 1 columna» no debe ensanchar las casillas de la rejilla */
  #js-product-list .products.ap-grid > .js-product-miniature-wrapper { width: auto !important; max-width: none !important; flex: none !important; }
  .ap-color { width: 12px; height: 12px; }
}

/* Favoritos (iqitwishlist): corazón siempre visible arriba a la derecha de la foto */
#js-product-list .products.ap-grid .product-functional-buttons {
  display: block !important; opacity: 1 !important; visibility: visible !important;
  position: absolute !important; top: 8px !important; right: 8px !important; left: auto !important; bottom: auto !important;
  width: auto !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; background: transparent !important; transform: none !important; z-index: 4;
}
#js-product-list .products.ap-grid .product-functional-buttons-links { display: flex; justify-content: flex-end; width: auto !important; min-width: 0 !important; gap: 6px; padding: 0 !important; margin: 0 !important; background: transparent !important; box-shadow: none !important; }
#js-product-list .products.ap-grid .product-functional-buttons .js-quick-view-iqit { display: none !important; }
#js-product-list .products.ap-grid .btn-iqitwishlist-add {
  display: flex !important; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0 !important; padding: 0 !important;
  border-radius: 50%; background: rgba(255, 255, 255, .85) !important; color: #1a1a1a !important; font-size: 17px; line-height: 1;
  box-shadow: none; transition: background .15s ease, transform .15s ease;
}
#js-product-list .products.ap-grid .btn-iqitwishlist-add:hover { background: #fff !important; transform: scale(1.08); }
#js-product-list .products.ap-grid .btn-iqitwishlist-add .fa { margin: 0 !important; }
@media (max-width: 575px) {
  #js-product-list .products.ap-grid .product-functional-buttons { top: 6px !important; right: 6px !important; }
  #js-product-list .products.ap-grid .btn-iqitwishlist-add { width: 30px; height: 30px; font-size: 15px; }
}

/* ---------- Scroll infinito: productos nuevos, aviso de carga y esqueleto ---------- */
/* Los que llegan se ocultan hasta tener su sitio en la parrilla (así el destacado no «salta») */
#js-product-list .products.ap-grid.ap-built > .js-product-miniature-wrapper:not(.ap-ready) { display: none !important; }
@keyframes apIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
#js-product-list .products.ap-grid > .ap-in { animation: apIn .5s ease-out both; }

.ap-loader { margin: 40px 0 0; }
.ap-loader__bar { display: flex; align-items: center; gap: 20px; margin: 0 0 32px; }
.ap-loader__line { flex: 1 1 auto; height: 1px; background: #e6e1dc; }
.ap-loader__msg { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.ap-loader__dots { display: flex; gap: 6px; align-items: center; }
.ap-loader__dots i { width: 8px; height: 8px; border-radius: 50%; background: #ce0e2d; animation: apDot 1.2s ease-in-out infinite; }
.ap-loader__dots i:nth-child(2) { animation-delay: .15s; }
.ap-loader__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes apDot { 0%, 80%, 100% { transform: scale(.6); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }
.ap-loader__txt { font-size: 14px; font-weight: 500; color: #1a1a1a; }
.ap-loader__count { font-size: 13px; color: #767676; }

.ap-loader__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; column-gap: 16px; row-gap: 32px; }
.ap-sk-tile { grid-column: span 3; display: flex; flex-direction: column; gap: 10px; }
.ap-loader__grid.ap-cols-3 .ap-sk-tile { grid-column: span 4; }
.ap-sk-feat { grid-column: span 6 !important; grid-row: span 2; }
.ap-loader__grid.ap-cols-3 .ap-sk-feat { grid-column: span 8 !important; }
@keyframes apPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.ap-sk { background: #efebe7; border-radius: 2px; animation: apPulse 1.6s ease-in-out infinite; }
.ap-sk-tile:nth-child(4n+2) .ap-sk { animation-delay: .15s; }
.ap-sk-tile:nth-child(4n+3) .ap-sk { animation-delay: .3s; }
.ap-sk-tile:nth-child(4n) .ap-sk { animation-delay: .45s; }
.ap-sk-img { aspect-ratio: 570 / 708; }
.ap-sk-feat .ap-sk-img { aspect-ratio: auto; flex: 1 1 auto; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.ap-sk-logo { font-size: 44px; font-weight: 700; letter-spacing: -.02em; color: #d9d2cb; font-style: normal; }
.ap-sk-logo i { font-style: normal; color: #e7a3ae; }
.ap-sk-l1 { height: 14px; width: 85%; }
.ap-sk-l2 { height: 14px; width: 35%; }
.ap-sk-feat .ap-sk-l1 { width: 60%; }
.ap-sk-feat .ap-sk-l2 { width: 22%; }

@media (max-width: 991px) {
  .ap-loader__grid { column-gap: 12px; row-gap: 24px; }
  .ap-sk-tile, .ap-loader__grid.ap-cols-3 .ap-sk-tile { grid-column: span 6; }
  .ap-sk-feat, .ap-loader__grid.ap-cols-3 .ap-sk-feat { grid-column: span 12 !important; grid-row: auto; }
  .ap-sk-feat .ap-sk-img { aspect-ratio: 570 / 708; min-height: 0; }
  .ap-loader__bar { gap: 12px; }
  .ap-loader__count { display: none; }
}
@media (max-width: 575px) {
  .ap-loader__grid { column-gap: 8px; row-gap: 20px; }
  .ap-sk-tile:nth-child(n+3):not(.ap-sk-feat) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-sk, .ap-loader__dots i, #js-product-list .products.ap-grid > .ap-in { animation: none; }
}
/* el icono de carga del tema lo sustituye el aviso del módulo */
#infinity-loader-icon { display: none !important; }
