/* =============================================================
   ALFONSINA BORDADOS - catalog.css
   Hero, filtros, grid de productos y cards
   ============================================================= */

/* ----- Animaciones de entrada del hero ----- */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.45; }
  50%       { transform: translateX(-50%) translateY(8px); opacity: 0.85; }
}

/* ----- Hero ----- */
.hero {
  background-color: var(--color-beige);
  padding: var(--space-24) var(--container-pad) var(--space-20);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background-color: rgba(232, 183, 199, 0.20);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background-color: rgba(232, 183, 199, 0.15);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-rose-dark);
  margin-bottom: var(--space-4);
  animation: hero-fade-up 0.6s ease 0.05s both;
}

.hero__eyebrow::before,
.hero__eyebrow::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background-color: var(--color-rose-dark);
  opacity: 0.5;
}

.hero__title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 400;
  color: var(--color-brown);
  line-height: 1.15;
  margin-bottom: var(--space-5);
  animation: hero-fade-up 0.7s ease 0.2s both;
}

.hero__title em {
  font-style: italic;
  color: var(--color-rose-dark);
}

.hero__subtitle {
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--color-gray);
  line-height: 1.8;
  max-width: 480px;
  margin: 0 auto;
  animation: hero-fade-up 0.6s ease 0.38s both;
}

/* Indicador de scroll */
.hero__scroll {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  color: var(--color-rose-dark);
  animation: hero-fade-up 0.5s ease 0.65s both, scroll-bounce 2.2s ease 1.15s infinite;
}

/* ----- Barra de filtros ----- */
.filters {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: var(--navbar-height);
  z-index: 50;
  padding: var(--space-4) 0;
}

.filters__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Botones de categoria */
.filters__categories {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex: 1;
}

.filter-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background-color: var(--color-white);
  color: var(--color-text-light);
  font-size: var(--text-sm);
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--color-rose);
  color: var(--color-brown);
  background-color: rgba(232, 183, 199, 0.1);
}

.filter-btn.filter-btn--active {
  background-color: var(--color-brown);
  border-color: var(--color-brown);
  color: var(--color-white);
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(107, 79, 58, 0.25);
}

/* Ordenar */
.filters__sort {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.filters__sort-label {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  white-space: nowrap;
}

.sort-select {
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-white);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C7B6D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  transition: border-color var(--transition-fast);
}

.sort-select:focus {
  border-color: var(--color-rose-dark);
}

/* ----- Seccion del catalogo ----- */
.catalog {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-10) var(--container-pad) var(--space-20);
}

.catalog__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
}

.catalog__title {
  font-size: var(--text-2xl);
  color: var(--color-brown);
}

.catalog__count {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  white-space: nowrap;
}

/* ----- Grid de productos ----- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

/* ----- Skeleton cards ----- */
.product-card-skeleton {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background-color: var(--color-white);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 3 / 4;
}

.skeleton-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skeleton-line {
  height: 14px;
  border-radius: var(--radius-sm);
}

.skeleton-line--short {
  width: 60%;
}

.skeleton-line--medium {
  width: 80%;
}

/* ----- Card de producto ----- */
.product-card {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(107, 79, 58, 0.07), 0 4px 16px rgba(107, 79, 58, 0.05);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: default;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px);
  animation: card-appear 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes card-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:hover {
  box-shadow: 0 8px 32px rgba(107, 79, 58, 0.14), 0 2px 8px rgba(107, 79, 58, 0.08);
  transform: translateY(-5px);
}

/* Imagen del producto */
.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: var(--color-beige);
  cursor: zoom-in;
}

/* ----- Sistema de carrusel de imagenes ----- */

/* Todas las imagenes: absolutas, apiladas */
.product-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.55s ease, transform var(--transition-slow);
}

/* Imagen activa (primera por defecto, rotada por JS) */
.product-card__img--active {
  opacity: 1;
}

/* Escala sutil en desktop al hacer hover sobre la card */
@media (hover: hover) {
  .product-card:hover .product-card__img {
    transform: scale(1.04);
  }
}

/* Badge de categoria */
.product-card__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-brown);
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 6px rgba(107, 79, 58, 0.1);
}

/* Imagen placeholder cuando no hay imagen */
.product-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-beige) 0%, var(--color-beige-dark) 100%);
  color: var(--color-gray-light);
}

/* Cuerpo de la card */
.product-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.product-card__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-brown);
  line-height: 1.3;
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: calc(var(--space-1) * -1);
}

.product-card__price {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.product-card__price-label {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: var(--space-1);
}

/* Medidas del producto */
.product-card__medidas {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-light);
  background-color: var(--color-beige);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px var(--space-3);
  align-self: flex-start;
}

/* Talles del producto */
.product-card__talles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.product-card__talle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-brown);
  background-color: var(--color-white);
  border: 1.5px solid rgba(107, 79, 58, 0.22);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
}

/* Pie de la card */
.product-card__footer {
  padding: 0 var(--space-5) var(--space-5);
}

.product-card__add-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background-color: var(--color-beige);
  color: var(--color-brown);
  border: 1.5px solid rgba(107, 79, 58, 0.18);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: all var(--transition-base);
  letter-spacing: 0.02em;
}

.product-card__add-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.product-card__add-btn:hover {
  background-color: var(--color-brown);
  border-color: var(--color-brown);
  color: var(--color-white);
  transform: none;
  box-shadow: var(--shadow-md);
}

.product-card__add-btn:hover svg {
  transform: rotate(90deg);
}

.product-card__add-btn:active {
  transform: scale(0.98);
}

/* Estado "agregado" del boton */
.product-card__add-btn.btn--added {
  background-color: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-white);
}

/* Estado "agotado" del boton */
.product-card__add-btn--agotado,
.product-card__add-btn--agotado:hover,
.product-card__add-btn--agotado:active {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-light);
  cursor: not-allowed;
  opacity: 0.75;
  transform: none;
}

/* Overlay agotado sobre la imagen */
.product-card__agotado-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
}

.product-card__agotado-overlay span {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(176, 49, 42, 0.88);
  padding: 5px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

/* ----- Modal de producto ----- */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.product-modal--open {
  opacity: 1;
  pointer-events: all;
}

.product-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(20, 10, 3, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.product-modal__panel {
  position: relative;
  z-index: 1;
  background-color: var(--color-white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(40px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-modal--open .product-modal__panel {
  transform: translateY(0);
}

/* Handle bar */
.product-modal__panel::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background-color: var(--color-border);
  border-radius: 2px;
  margin: var(--space-3) auto 0;
}

/* Imagen del modal */
.product-modal__image-section {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-beige);
}

.product-modal__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product-modal__img--active {
  opacity: 1;
}

.product-modal__no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-light);
}

/* Flechas de navegacion */
.product-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--color-brown);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.product-modal__nav:hover {
  background-color: var(--color-white);
  transform: translateY(-50%) scale(1.08);
}

.product-modal__nav--prev { left: var(--space-3); }
.product-modal__nav--next { right: var(--space-3); }

/* Puntos de paginacion */
.product-modal__dots {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 2;
}

.product-modal__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.product-modal__dot--active {
  background-color: var(--color-white);
  transform: scale(1.3);
}

/* Info del producto */
.product-modal__info {
  padding: var(--space-6);
  position: relative;
}

.product-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--color-beige);
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brown);
  transition: all var(--transition-fast);
}

.product-modal__close:hover {
  background-color: var(--color-brown);
  color: var(--color-white);
  border-color: var(--color-brown);
}

.product-modal__name {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-brown);
  line-height: 1.25;
  margin-bottom: var(--space-3);
  padding-right: var(--space-10);
}

.product-modal__desc {
  font-size: var(--text-sm);
  color: var(--color-gray);
  line-height: 1.75;
  margin-bottom: var(--space-4);
}

.product-modal__price-wrap {
  margin-bottom: var(--space-4);
}

.product-modal__price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.product-modal__add-btn {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-base);
}

/* Desktop: imagen izquierda, info derecha */
@media (min-width: 640px) {
  .product-modal {
    align-items: center;
    padding: var(--space-6);
  }

  .product-modal__panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: var(--radius-xl);
    max-width: 760px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(24px);
  }

  .product-modal__panel::before {
    display: none;
  }

  .product-modal__image-section {
    aspect-ratio: unset;
    min-height: 420px;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  }

  .product-modal__info {
    overflow-y: auto;
    max-height: 85vh;
  }
}

/* ----- Estado vacio del catalogo ----- */
.catalog-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-20) var(--space-8);
  text-align: center;
  color: var(--color-text-light);
}

.catalog-empty__icon {
  color: var(--color-gray-light);
  margin-bottom: var(--space-2);
}

.catalog-empty__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-brown);
}

.catalog-empty__text {
  font-size: var(--text-sm);
  max-width: 300px;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) var(--container-pad);
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
  }

  .filters__container {
    gap: var(--space-3);
  }

  .filters__sort-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .product-card__body {
    padding: var(--space-4);
    gap: var(--space-2);
  }

  .product-card__footer {
    padding: 0 var(--space-4) var(--space-4);
  }

  .product-card__name {
    font-size: var(--text-base);
  }

  .product-card__desc {
    display: none;
  }

  .product-card__add-btn {
    padding: var(--space-3);
    font-size: var(--text-xs);
  }

  .hero {
    padding: var(--space-12) var(--container-pad);
  }

  .filters {
    padding: var(--space-3) 0;
  }

  .filters__categories {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-1);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filters__categories::-webkit-scrollbar {
    display: none;
  }
}

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