/* ===========================================================================
 * Páginas públicas (directorio, hub de negocio, producto).
 * ========================================================================= */

/* Vars brand inicializadas por hub.controller.js/product.controller.js via <style id="hub-brand-css">.
   Aquí sólo defaults de respaldo. */
:root {
  --hub-primary: #696cff;
  --hub-secondary: #696cff;
  --hub-accent: #696cff;
  --hub-primary-rgb: 105, 108, 255;
}

/* --------- Directorio --------- */
.directory-card {
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.directory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(67, 89, 113, .12) !important;
}
.directory-cover {
  height: 140px;
  background-color: #eef0f2;
  position: relative;
  overflow: hidden;
}
.directory-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.directory-logo {
  position: absolute;
  top: -28px;
  left: 16px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.directory-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------- Hub hero --------- */
.hub-hero .hub-cover {
  height: 240px;
  background-size: cover;
  background-position: center;
  background-color: #eef0f2;
}

.hub-hero .hub-cover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, var(--bs-card-bg) 100%);
  pointer-events: none;
}

.hub-hero-row {
  margin-top: -48px;
  position: relative;
}
.hub-logo {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.hub-logo img { width: 100%; height: 100%; object-fit: cover; }

/* --------- Producto --------- */
.product-card {
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(67, 89, 113, .12) !important;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.product-card:hover .product-img { transform: scale(1.04); }

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  min-height: 2.5em;
}

/* --------- Galería producto --------- */
.pp-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f5f7;
  cursor: pointer;
}
.pp-thumb.active { border-color: var(--hub-primary, #696cff); }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --------- Hub: List view mode --------- */
.hub-list-mode > [class*="col-"] { width: 100%; flex: 0 0 100%; max-width: 100%; }
.hub-list-mode .product-card {
  flex-direction: row;
  align-items: stretch;
}
.hub-list-mode .product-card .ratio {
  width: 140px;
  min-width: 140px;
  flex-shrink: 0;
  --bs-aspect-ratio: 100%;
}
.hub-list-mode .product-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --------- Hub: Instagram view mode (feed tipo IG: 3 cols, sin texto) --------- */
#hub-products.hub-instagram-mode {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 0;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}
@media (min-width: 768px) {
  #hub-products.hub-instagram-mode { gap: 4px; }
}
.hub-ig-col { padding: 0; margin: 0; }
.hub-ig-tile {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bs-tertiary-bg, #f4f5f7);
  cursor: pointer;
}
.hub-ig-tile .product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.hub-ig-tile:hover .product-img { transform: scale(1.04); }
.hub-ig-tile.is-dim { opacity: .55; }
.hub-ig-badge {
  position: absolute;
  top: .4rem;
  right: .4rem;
  background: rgba(220, 53, 69, .92);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .15rem .4rem;
  border-radius: 3px;
  text-transform: uppercase;
  z-index: 2;
}

/* Info overlay: nombre + precio con gradiente inferior */
.hub-ig-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: .55rem .6rem .5rem;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.78) 100%);
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .25s ease;
  z-index: 1;
}
.hub-ig-info .hub-ig-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.hub-ig-info .hub-ig-price {
  font-size: .9rem;
  margin-top: .15rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
/* El precio (text-primary) queda forzado a blanco dentro del overlay oscuro */
.hub-ig-info .hub-ig-price .text-primary { color: #fff !important; font-weight: 600; }
.hub-ig-info .hub-ig-price .text-decoration-line-through { color: rgba(255,255,255,.7) !important; }

/* Desktop (tiene hover real): reveal on hover */
@media (hover: hover) and (pointer: fine) {
  .hub-ig-tile:hover .hub-ig-info {
    opacity: 1;
    transform: translateY(0);
  }
  .hub-ig-tile:hover .product-img {
    transform: scale(1.04);
  }
}

/* Mobile / touch (sin hover): info siempre visible como un post de IG */
@media (hover: none), (pointer: coarse) {
  .hub-ig-info {
    opacity: 1;
    transform: none;
  }
}

/* --------- Hub: Pagos aceptados (explícitos) --------- */
.hub-pay-item {
  padding: .5rem 0;
  border-bottom: 1px solid var(--bs-border-color, rgba(0,0,0,.08));
}
.hub-pay-item:last-child { border-bottom: 0; }
.hub-pay-head {
  user-select: none;
}
.hub-pay-expandable { cursor: pointer; }
.hub-pay-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--hub-primary-rgb, 105,108,255), .12);
  color: var(--hub-primary, #696cff);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.hub-pay-caret {
  transition: transform .2s ease;
  color: var(--bs-secondary-color, #6c757d);
}
.hub-pay-expandable.is-open .hub-pay-caret { transform: rotate(180deg); }
.hub-pay-body { margin-top: .35rem; padding-left: 44px; }
.hub-pay-copy {
  background: transparent;
  border: 0;
  color: var(--hub-primary, #696cff);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hub-pay-badge-primary {
  background: var(--hub-accent, var(--hub-primary, #696cff));
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: .2rem .45rem;
  border-radius: 10px;
}

/* --------- Hub: WhatsApp CTA --------- */
.hub-wa-float {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

/* --------- Animaciones Premium --------- */
@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up-enter {
  opacity: 0;
  animation: fadeUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-50 { animation-delay: 50ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
