/* ============================================
   UTILITIES — Skeletons, toast, hover premium, force image contain — Tu Rincón Ferretero
   Extraído de style.css en Fase 2 (Solución 2.0).
   No modificar selectores ni valores: paridad 1:1 con el original.
   ============================================ */

/* ============================================
   SKELETONS — placeholder de carga
   ============================================ */
.skeleton-loading {
  position: relative;
  background: linear-gradient(90deg, #ebe7dc 25%, #f3efe6 50%, #ebe7dc 75%);
  background-size: 200% 100%;
  animation: tr-skeleton-shimmer 1.2s ease-in-out infinite;
  color: transparent !important;
}
@keyframes tr-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
img.skeleton-loading { opacity: 0.8; }
img.tr-loaded { animation: tr-fade-in 0.35s ease; }
@keyframes tr-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.tr-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.tr-toast {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 2px;
  box-shadow: 4px 4px 0 var(--line);
  padding: 12px 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.9,.35,1.2);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tr-toast.tr-toast-show { opacity: 1; transform: translateX(0); }
.tr-toast.tr-toast-success { border-left: 6px solid #22c55e; }
.tr-toast.tr-toast-error   { border-left: 6px solid #e53935; }
.tr-toast.tr-toast-info    { border-left: 6px solid var(--accent-cyan); }
.tr-toast-icon { font-size: 18px; line-height: 1; }
@media (max-width: 640px) {
  .tr-toast-container { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
  .tr-toast { min-width: 0; max-width: none; }
}

/* ============================================
   HOVER PREMIUM — transiciones elásticas
   ============================================ */
.product-card {
  transition: transform .18s cubic-bezier(.2,.9,.35,1.2),
              box-shadow .18s cubic-bezier(.2,.9,.35,1.2);
}
.product-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--line);
}
.btn:not(.tu-rincon-wishlist-btn), button.btn:not(.tu-rincon-wishlist-btn) {
  transition: transform .15s cubic-bezier(.2,.9,.35,1.2),
              box-shadow .15s cubic-bezier(.2,.9,.35,1.2),
              background .12s ease;
}
.btn:not(.tu-rincon-wishlist-btn):hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--line);
}
.btn:not(.tu-rincon-wishlist-btn):active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--line);
}

/* ============================================
   FORCE IMAGE CONTAIN (FINAL OVERRIDE)
   Solo aplicar a imágenes de productos y galería
   NO afectar header/footer/logo
   ============================================ */
.main-image img,
.thumbnail img,
.product-gallery img,
.product-image img,
.products-grid .product-card img,
.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img,
.related-products img,
.cart-item-thumb img {
  object-fit: contain !important;
  width: auto !important;
  height: auto !important;
  max-width: 95% !important;
  max-height: 95% !important;
}

