/* Product gallery and card styles extracted from styles.css. */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(135, 125, 211, .18), 0 1px 3px rgba(85, 120, 184, .16);
  overflow: hidden;
  border: 1px solid rgba(85, 120, 184, .18);
  transition: box-shadow .28s ease, transform .28s ease, border-color .28s ease;
}

.card:hover,
.card:focus-within {
  box-shadow: 0 14px 34px rgba(85, 120, 184, .34), 0 10px 22px rgba(132, 187, 208, .28), 0 0 0 2px rgba(135, 125, 211, .22) inset;
  border-color: rgba(85, 120, 184, .38);
}

.image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 884;
  overflow: hidden;
  background: #f8f8f8;
  border-radius: var(--radius) var(--radius) 0 0;
}

.image-wrap:hover {
  cursor: pointer;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 0;
  transition: transform .32s ease;
  will-change: transform;
}

.card:hover .image-wrap img,
.card:focus-within .image-wrap img {
  transform: scale(1.02);
}

.image-wrap img.main {
  position: absolute;
  inset: 0;
  opacity: 1;
}

.image-wrap img.alt {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.card-body {
  padding: 12px 12px 16px;
  display: grid;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.btn-info-card,
.btn-buy-card {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.94rem;
  padding: 10px 10px;
}

.btn-info-card {
  background: linear-gradient(90deg, var(--primary) 0%, var(--brand) 100%);
}

.btn-buy-card {
  background: #25D366;
  box-shadow: 0 6px 14px rgba(37, 211, 102, .28);
}

.btn-buy-card .wa-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background: url('recursos/iconos/WhatsApp.svg') center/contain no-repeat;
  flex-shrink: 0;
}

.btn-buy-card.is-disabled,
.btn-buy-card:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.15);
  box-shadow: none;
}

.btn-buy-card.is-disabled:hover,
.btn-buy-card:disabled:hover {
  transform: none;
  filter: grayscale(.15);
}

.card,
.catalog-card {
  will-change: opacity, transform;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .7s ease, transform .7s ease;
}

.badges-container {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
  align-items: flex-start;
}

.image-wrap .badge {
  position: relative;
  top: auto;
  left: auto;
  margin: 0;
}

.image-wrap.agotado img {
  filter: grayscale(100%) opacity(0.7);
}

.image-wrap.agotado::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(50, 50, 50, 0.4);
  z-index: 1;
  pointer-events: none;
}

.image-wrap .badge.agotado {
  position: absolute;
  top: 50%;
  left: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  padding: 10px 20px;
  border: 2px solid #fff;
}

.gallery.is-loading {
  min-height: 220px;
}

.gallery-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
  box-shadow: 0 10px 24px rgba(124, 105, 239, 0.08);
}

.gallery-empty__content {
  max-width: 420px;
  text-align: center;
}

.gallery-empty h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #1f2937;
}

.gallery-empty p {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
}

.card-price-box {
  border: 1.5px solid #7c69ef;
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  width: 100%;
  margin: 4px 0 8px;
  box-shadow: 0 4px 12px rgba(124, 105, 239, 0.04);
  position: relative;
  overflow: hidden;
}

.card-price-box .price-row .label {
  font-size: 0.85rem;
}

.card-price-box .price-row .value {
  font-size: 1.25rem;
}

.card-price-box .price-row .currency {
  font-size: 0.75rem;
}

.card-price-box .separator {
  margin: 8px 0;
}

.card-price-box .price-row.secondary .label {
  font-size: 0.75rem;
}

.card-price-box .price-row.secondary .value {
  font-size: 1.05rem;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (max-height: 700px) and (min-width: 769px) {
  .card,
  .card.reveal.revealed {
    transform: scale(0.88);
    transform-origin: top center;
    margin-bottom: -8%;
    margin-top: 1.5%;
  }

  .gallery {
    gap: 12px !important;
  }
}

@media (max-width: 380px) {
  .gallery {
    padding: 0 12px;
  }
}