/* =========================================================
   VITRINA · catálogo de cachorros en cuadrícula + ficha en ventana
   Se activa con html.vt-on (lo agrega vitrina.js). Sin JS queda la lista larga de siempre.
   ========================================================= */

/* la lista larga queda como fuente de datos y respaldo */
html.vt-on .ej-line,
html.vt-on #ej-empty,
html.vt-on .ej-pick { display: none !important; }
.ej-pill[hidden] { display: none; }

.vt { margin: 0 0 3.2rem; }
html:not(.vt-on) .vt { display: none; }

.vt-head { margin: 0 auto 1.6rem; text-align: center; }
.vt-count { margin: 0; color: var(--text-soft); font-size: 1rem; }
.vt-count strong { font-family: "Playfair Display", serif; font-size: 1.5rem; color: var(--primary); margin-right: .15em; }

/* ---------- Grilla ---------- */
.vt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.vt-grid > [hidden] { display: none; }
.vt-tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-sm);
  transition: transform .35s ease, box-shadow .35s ease;
}
.vt-tile--promo { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-sm); }
.vt-tile__img { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #2a211a; }
.vt-tile__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 36%; transition: transform .7s cubic-bezier(.22, 1, .36, 1); }
.vt-tile__img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; pointer-events: none; background: linear-gradient(to top, rgba(24, 14, 6, .5), transparent); }
.vt-chip {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: .38rem .7rem; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--primary); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.vt-ribbon {
  position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border-radius: 999px;
  background: linear-gradient(120deg, var(--gold-soft), var(--gold)); color: var(--primary); font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(60, 30, 20, .25);
}
.vt-play {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(24, 14, 6, .55); color: #fff; font-size: .7rem; border: 1px solid rgba(255, 255, 255, .55); backdrop-filter: blur(4px);
}
.vt-play i { margin-left: 2px; }
.vt-tile__meta { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; }
.vt-tile__group { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-3); }
.vt-tile__name { font-family: "Playfair Display", serif; font-size: 1.55rem; line-height: 1.1; color: var(--primary); }
.vt-tile__sub { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--text-soft); line-height: 1.3; }
.vt-tile__cta { display: inline-flex; align-items: center; gap: .45rem; margin-top: .55rem; font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-2); }
.vt-tile__cta i { transition: transform .25s ease; }
@media (hover: hover) {
  .vt-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
  .vt-tile:hover .vt-tile__img img { transform: scale(1.06); }
  .vt-tile:hover .vt-tile__cta i { transform: translateX(4px); }
}
.vt-tile:focus-visible, .vt-mini:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.vt-empty { padding: 2.4rem 1rem; text-align: center; color: var(--text-soft); }
.vt-empty .btn { width: auto; margin-top: 1rem; }

.vt-seo { margin: 2.2rem auto 0; max-width: 64ch; text-align: center; color: var(--text-soft); font-size: .95rem; }
.vt-seo a { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(122, 82, 48, .4); }

/* ---------- Ya encontraron familia ---------- */
.vt-done { margin-top: 3.4rem; padding-top: 2.4rem; border-top: 1px solid var(--border); }
.vt-done__head { max-width: 640px; margin: 0 auto 1.6rem; text-align: center; }
.vt-done__head p { margin: .4rem 0 0; color: var(--text-soft); font-size: .95rem; }
.vt-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px; max-width: 1000px; margin: 0 auto; }
.vt-mini { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--primary); text-align: center; }
.vt-mini__img { display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 16px; background: #2a211a; box-shadow: var(--shadow-sm); }
.vt-mini__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 36%; filter: blur(3px) saturate(1.12) brightness(.95); transform: scale(1.06); transition: filter .3s ease, transform .5s ease; }
.vt-mini strong { margin-top: .5rem; font-family: "Playfair Display", serif; font-size: 1.05rem; line-height: 1.1; }
.vt-mini small { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-soft); }
@media (hover: hover) { .vt-mini:hover .vt-mini__img img { filter: blur(1.5px) saturate(1.12); transform: scale(1.1); } }

/* ---------- Ficha en ventana ---------- */
.vt-sheet { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.vt-sheet[hidden] { display: none; }
.vt-sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 12, 6, .74); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: vt-fade .25s ease; }
.vt-sheet__panel {
  position: relative; display: flex; flex-direction: column; width: min(1060px, 100%); max-height: calc(100vh - 40px); overflow: hidden;
  background: var(--white); border-radius: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: vt-rise .35s cubic-bezier(.22, 1, .36, 1);
}
.vt-sheet__bar { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-bottom: 1px solid var(--border); background: var(--bg, #faf5ee); }
.vt-sheet__pos { flex: 1; text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-2); font-variant-numeric: tabular-nums; }
.vt-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; background: var(--white); color: var(--primary);
  cursor: pointer; font-size: .95rem; transition: background .2s ease, transform .2s ease;
}
.vt-btn:hover { background: var(--accent); transform: scale(1.05); }
.vt-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.vt-btn[hidden] { display: none; }
.vt-close { order: 3; background: var(--primary); color: var(--white); border-color: var(--primary); }
.vt-close:hover { background: var(--primary-2); }
.vt-sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
body.vt-open { overflow: hidden; }

.vt-sheet .ej-card {
  flex-direction: row; border: 0; border-radius: 0; box-shadow: none; overflow: visible; opacity: 1 !important; filter: none !important; transform: none !important;
}
.vt-sheet .ej-card .ej-media { flex: 0 0 46%; align-self: stretch; }
.vt-sheet .ej-card .ej-body { flex: 1; justify-content: center; padding: clamp(24px, 3.2vw, 44px); }
.vt-sheet .ej-card .ej-name { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.vt-sheet .ej-card .ej-nav { opacity: 1; }
@keyframes vt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vt-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Promo de la Madre (Arabella y Balthazar) ---------- */
.promo-madre__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.promo-dog { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--primary); text-align: center; }
.promo-dog__img { display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 999px 999px 18px 18px; border: 3px solid var(--gold); background: #2a211a; box-shadow: 0 16px 34px rgba(60, 30, 20, .24); }
.promo-dog__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform .6s ease; }
.promo-dog__ribbon {
  position: absolute; left: 50%; bottom: 64px; z-index: 2; transform: translateX(-50%) rotate(-6deg); white-space: nowrap; padding: .4rem .9rem; border-radius: 6px;
  background: linear-gradient(120deg, var(--gold-soft), var(--gold)); color: var(--primary); font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(60, 30, 20, .3); pointer-events: none;
}
.promo-dog strong { margin-top: .6rem; font-family: "Playfair Display", serif; font-size: 1.35rem; line-height: 1.1; }
.promo-dog small { font-size: .74rem; letter-spacing: .06em; color: var(--text-soft); }
@media (hover: hover) { .promo-dog:hover .promo-dog__img img { transform: scale(1.06); } }
.promo-dog:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 18px; }
@media (max-width: 680px) { .promo-madre__duo { width: min(360px, 100%); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .vt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 820px) {
  .vt-sheet { align-items: flex-end; padding: 0; }
  .vt-sheet__panel { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .vt-sheet .ej-card { flex-direction: column; }
  .vt-sheet .ej-card .ej-media { flex: 0 0 auto; align-self: auto; width: 100%; }
  .vt-sheet .ej-card .ej-body { padding: 22px 20px 28px; }
}
@media (max-width: 640px) {
  .vt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .vt-tile { border-radius: 18px; }
  .vt-tile__meta { padding: 11px 12px 13px; }
  .vt-tile__name { font-size: 1.28rem; }
  .vt-tile__sub { font-size: .76rem; }
  .vt-tile__cta { font-size: .68rem; }
  .vt-chip { top: 9px; left: 9px; font-size: .56rem; padding: .32rem .55rem; }
  .vt-ribbon { top: 9px; right: 9px; font-size: .56rem; padding: .32rem .55rem; }
  .vt-minis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .vt-tile, .vt-tile__img img, .vt-mini__img img, .vt-btn, .promo-dog__img img { transition: none; }
  .vt-sheet__backdrop, .vt-sheet__panel { animation: none; }
}
