/* ============================================================
   TRIBU ANIMAL — shop.css
   Exclusivo de la tienda: layout, sidebar, filtros,
   shop-grid, carrito drawer, toast, filtro móvil.
   Los componentes de producto (product-card, stars, badges,
   section-header) están en common_v2.css
   ============================================================ */

/* ============================================================
   SHOP HERO
   ============================================================ */

.shop-hero {
  background: var(--c-cream);
  padding: 32px 0 40px;
  border-bottom: 0.5px solid var(--c-cream-border);
  position: relative;
  overflow: hidden;
}

/* Grain texture */
.shop-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
}

/* Número decorativo de fondo */
.shop-hero::after {
  content: '10';
  position: absolute;
  right: -1%;
  bottom: -20%;
  font-family: var(--f-display);
  font-size: clamp(160px, 18vw, 260px);
  font-weight: 400;
  font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1px rgba(61,92,58,0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.03em;
}

.shop-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-lg);
  position: relative;
}

/* Animaciones entrada */
.shop-hero-text .eyebrow {
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(12px);
  animation: shopHeroUp 0.5s ease forwards 0s;
}

.shop-hero-title {
  font-family: var(--f-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  color: var(--c-ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(12px);
  animation: shopHeroUp 0.55s ease forwards 0.1s;
}

.shop-hero-title em {
  font-style: italic;
  color: var(--c-moss);
}

@keyframes shopHeroUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Lado derecho — editorial */
.shop-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  transform: translateY(12px);
  animation: shopHeroUp 0.55s ease forwards 0.2s;
  flex-shrink: 0;
}

.shop-hero-count {
  font-family: var(--f-numeric);
  font-size: 11px;
  font-weight: 300;
  color: var(--c-ink-light);
  letter-spacing: 0.04em;
}

/* Chips de categoría en el hero */
.shop-hero-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shop-hero-cat {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--c-cream-border);
  color: var(--c-ink-light);
  background: transparent;
}

.shop-hero-cat.cat-nutricion  { border-color: var(--c-moss);  color: var(--c-moss); }
.shop-hero-cat.cat-accesorios { border-color: var(--c-ochre); color: var(--c-ochre); }
.shop-hero-cat.cat-bienestar  { border-color: var(--c-terra); color: var(--c-terra); }
.shop-hero-cat.cat-salud      { border-color: var(--c-slate); color: var(--c-slate); }

/* ============================================================
   LAYOUT PRINCIPAL — sidebar + grid
   ============================================================ */

.shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
  align-items: start;
}

/* ============================================================
   SIDEBAR DE FILTROS
   ============================================================ */

.shop-sidebar {
  position: sticky;
  top: 76px;
}

.sidebar-block { margin-bottom: var(--space-lg); }

.sidebar-block + .sidebar-block {
  padding-top: var(--space-lg);
  border-top: 0.5px solid var(--c-cream-border);
}

.sidebar-label {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
  margin-bottom: var(--space-md);
  display: block;
}

.filter-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--c-ink-mid);
  background: transparent;
  border: 0.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-align: left;
  width: 100%;
}

.filter-pill:hover {
  background: var(--c-moss-light);
  color: var(--c-moss);
}

.filter-pill.active {
  background: var(--c-moss-light);
  color: var(--c-moss);
  font-weight: 500;
  border-color: rgba(61,92,58,0.15);
}

.filter-pill-count {
  font-size: 10px;
  font-weight: 300;
  color: var(--c-ink-light);
}

.filter-pill.active .filter-pill-count {
  color: var(--c-moss);
  opacity: 0.7;
}

.filter-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
}

.dot-todos      { background: var(--c-ink-light); }
.dot-nutricion  { background: var(--c-moss); }
.dot-accesorios { background: var(--c-ochre); }
.dot-bienestar  { background: var(--c-terra); }
.dot-salud      { background: var(--c-slate); }

.filter-pill-label { flex: 1; }

.sort-select {
  width: 100%;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--c-ink-soft);
  background: var(--c-white);
  border: 0.5px solid var(--c-cream-border);
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9D90' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--c-moss);
}

/* ============================================================
   TOOLBAR MÓVIL
   ============================================================ */

.shop-toolbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 0.5px solid var(--c-cream-border);
}

.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink-soft);
  background: transparent;
  border: 0.5px solid var(--c-cream-border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.btn-filter-toggle svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-filter-toggle:hover {
  border-color: var(--c-moss);
  color: var(--c-moss);
}

.shop-result-count {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 300;
  color: var(--c-ink-light);
}

/* ============================================================
   SHOP GRID — 3 columnas
   product-card base viene de common_v2.css;
   aquí solo el grid y el flex interno para igualar alturas
   ============================================================ */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* Flex interno para que el footer de cada card quede abajo */
.shop-grid .product-card {
  display: flex;
  flex-direction: column;
}

/* El <a> ocupa toda la card en altura */
.shop-grid .product-card > a {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Sin flex en el hijo directo de la card la imagen
     conserva su aspect-ratio correctamente */
}

/* product-image como bloque sin flex-shrink para
   que aspect-ratio: 1 funcione dentro del flex column */
.shop-grid .product-image {
  flex-shrink: 0;
}

.shop-grid .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shop-grid .product-footer { margin-top: auto; }

/* ============================================================
   ESTADO VACÍO
   ============================================================ */

.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xl) 0;
}

.shop-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--c-ink-light);
  margin: 0 auto var(--space-md);
}

.shop-empty-icon svg {
  width: 100%; height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-empty h3 {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--c-ink-soft);
  margin-bottom: var(--space-sm);
}

.shop-empty p { font-size: 13px; color: var(--c-ink-light); }

/* ============================================================
   ANIMACIÓN DE FILTRADO
   ============================================================ */

.product-card.hidden { display: none; }

.product-card.fade-in {
  animation: fadeUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card.scroll-reveal {
  opacity: 0 !important;
  transform: translateY(40px) !important; /* Aumentado a 40px para que se note */
  transition: none !important; /* Sin transición mientras están ocultas */
}

/* 2. ESTADO ACTIVO: Cuando el JS entra en acción */
.product-card.scroll-reveal.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  /* La transición solo ocurre AQUÍ */
  transition: opacity 0.3s ease-out, 
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* 3. EL HOVER: Aseguramos que sea superior a todo */
.shop-grid .product-card.is-visible:hover {
  transform: translateY(-8px) !important; /* Sube al hacer hover */
  box-shadow: 0 12px 30px rgba(61, 92, 58, 0.15);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out !important;
  /* ESTA LÍNEA ES CLAVE: anula el delay del JS solo al tocar con el ratón */
  transition-delay: 0s !important;
}
/* ============================================================
   FILTROS DRAWER MÓVIL
   ============================================================ */

.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,28,24,0.35);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.filter-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.filter-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--c-white);
  z-index: 201;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-drawer.open { transform: translateY(0); }

.filter-drawer-handle {
  width: 36px; height: 3px;
  background: var(--c-cream-border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.filter-drawer-title {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--c-ink);
  margin-bottom: var(--space-md);
}

.filter-drawer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.filter-drawer-pill {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink-mid);
  background: transparent;
  border: 0.5px solid var(--c-cream-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-drawer-pill.active {
  background: var(--c-moss);
  color: #fff;
  border-color: var(--c-moss);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */


/* ============================================================
   SIDEBAR SHIPPING CARD — mini-card envío memorable
   ============================================================ */

.sidebar-shipping-card {
  background: var(--c-cream);
  border: 0.5px solid var(--c-cream-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-shipping-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-shipping-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-shipping-icon.icon-truck { background: var(--c-moss-light); }
.sidebar-shipping-icon.icon-clock { background: var(--c-ochre-light); }

.sidebar-shipping-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-truck svg { stroke: var(--c-moss); }
.icon-clock svg { stroke: var(--c-ochre); }

.sidebar-shipping-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-shipping-label {
  font-size: 10px;
  font-weight: 300;
  color: var(--c-ink-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-shipping-value {
  font-family: var(--f-numeric);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink-soft);
}

/* ============================================================
   SIDEBAR TEXT — sustituye inline styles del bloque envío
   ============================================================ */

.sidebar-text {
  font-size: 12px;
  line-height: 1.7;
  color: var(--c-ink-light);
}

.sidebar-text strong {
  font-weight: 500;
  color: var(--c-ink-soft);
}

/* ============================================================
   BTN INLINE LINK — estado vacío, enlace textual
   ============================================================ */

.btn-inline-link {
  color: var(--c-moss);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.btn-inline-link:hover {
  color: #2e4529;
}

/* ============================================================
   BTN BLOCK — botón primario a ancho completo
   ============================================================ */

.btn-block {
  width: 100%;
}

@media (max-width: 767px) {
  .shop-hero              { padding: 28px 0 28px; }
  .shop-hero::after       { display: none; }
  .shop-hero-inner        { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
  .shop-hero-title        { font-size: 26px; }
  .shop-hero-meta         { align-items: flex-start; }
  .shop-hero-cats         { justify-content: flex-start; }
  .shop-layout            { grid-template-columns: 1fr; padding: var(--space-md) 0 var(--space-xl); gap: 0; }
  .shop-sidebar           { display: none; }
  .shop-toolbar-mobile    { display: flex; }
  .shop-grid              { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .shop-layout            { grid-template-columns: 180px 1fr; gap: var(--space-lg); }
  .shop-grid              { grid-template-columns: repeat(2, 1fr); }
  .shop-hero-title        { font-size: 36px; }
}
