/* =====================================================
   TIENDA – CSS AISLADO Y COMPATIBLE
===================================================== */

.shop-layout,
.shop-layout * {
  font-family: inherit;
}

/* ======================
   LAYOUT GENERAL
====================== */

.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 64px 20px;
}

/* =========================
   SIDEBAR / CATEGORÍAS
========================= */

.shop-sidebar h3 {
  margin-bottom: 16px;
}

.shop-sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-sidebar li {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark);
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.shop-sidebar li:hover {
  background: rgba(79,110,247,0.08);
  color: var(--primary);
}

.shop-sidebar li.active {
  background: var(--gradient-primary);
  color: var(--light);
  font-weight: 600;
}

/* ======================
   CONTENT
====================== */

.shop-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ======================
   TOOLBAR
====================== */

.shop-toolbar input {
  width: 100%;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: var(--light);
}

.shop-toolbar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.2);
}

/* ======================
   GRID PRODUCTOS
====================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

/* Fade controlado SOLO por el grid */
.products-grid.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

.products-grid.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.products-grid {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ======================
   CARD PRODUCTO
====================== */

.product-card {
  background: var(--light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15,23,42,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(79,110,247,0.25);
}

/* ======================
   IMAGEN (CUADRADA)
====================== */

.product-img {
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ======================
   TEXTO CARD
====================== */

.product-card h4 {
  padding: 18px 20px 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.product-card .price {
  padding: 0 20px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* =========================
   BOTÓN VER PRODUCTO
========================= */

.shop-layout .btn {
  margin: 16px 20px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: var(--light);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 22px rgba(79,110,247,0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shop-layout .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(79,110,247,0.45);
}

.shop-layout .btn:active {
  transform: scale(0.96);
}

/* =========================
   SKELETON LOADER
========================= */

.product-card.skeleton {
  pointer-events: none;
  position: relative;
  background: #f1f5f9;
  box-shadow: none;
  overflow: hidden;
}

.product-card.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.6),
    transparent
  );
  animation: skeleton-shimmer 1.2s infinite;
}

.product-card.skeleton .product-img,
.product-card.skeleton h4,
.product-card.skeleton .btn {
  background: #e5e7eb;
  color: transparent;
  border-radius: 8px;
}

.product-card.skeleton h4 {
  height: 18px;
  margin: 16px 20px;
}

.product-card.skeleton .btn {
  height: 38px;
  margin: 16px 20px 20px;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
/* =========================
   ENTRADA SUAVE DE PRODUCTOS
========================= */

.product-card {
  opacity: 0;
  transform: translateY(8px);
  animation: card-enter 0.45s ease forwards;
}

/* Stagger natural */
.product-card:nth-child(1) { animation-delay: 0.04s; }
.product-card:nth-child(2) { animation-delay: 0.08s; }
.product-card:nth-child(3) { animation-delay: 0.12s; }
.product-card:nth-child(4) { animation-delay: 0.16s; }
.product-card:nth-child(5) { animation-delay: 0.20s; }
.product-card:nth-child(6) { animation-delay: 0.24s; }
.product-card:nth-child(7) { animation-delay: 0.28s; }
.product-card:nth-child(8) { animation-delay: 0.32s; }

@keyframes card-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton no anima */
.product-card.skeleton {
  animation: none;
  opacity: 1;
  transform: none;
}


/* ======================
   RESPONSIVE
====================== */

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    order: -1;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}
