/* Página general de Portafolio: escena de la portada, filtros y grilla de casos. Clases con prefijo pf-. */

/* ── Portada: las tiendas reales se turnan en un navegador y al lado sus resultados ── */
.pf-in { position: relative; z-index: 2; display: grid; width: min(100%, 560px); }
.pf-win { width: 100%; padding: 0 8px 8px; border-radius: 16px; box-shadow: 0 24px 60px rgba(29, 42, 61, .24); }
.pf-shots { display: grid; overflow: hidden; border-radius: 4px; }
.pf-shots img { grid-area: 1 / 1; width: 100%; aspect-ratio: 16 / 9.2; object-fit: cover; object-position: top; border-radius: 4px; transition: opacity .6s ease, scale .9s var(--ease-out); }
.pf-shots img + img { visibility: hidden; }
.pf-stage.is-live .pf-shots img { visibility: visible; }
.pf-stage.is-live .pf-shots img:not(.is-on) { opacity: 0; scale: 1.05; }
.pf-stage.is-live .dv-url span { visibility: hidden; }
.pf-stage.is-live .dv-url span.is-on { visibility: visible; }

.pf-res { position: relative; z-index: 3; width: min(92%, 470px); margin: -54px 0 0 auto; padding: 0; overflow: hidden; border-radius: 18px; font-size: 1rem; box-shadow: 0 22px 54px rgba(29, 42, 61, .26); }
.pf-res-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #eef1ee; color: #1d2a3d; font-size: .875rem; }
.pf-res-head b { font-weight: 600; }
.pf-tabs { display: flex; gap: 6px; padding: 12px 14px 0; }
.pf-tab { flex: 1; min-height: 40px; padding: 0 10px; border: 0; border-radius: 999px; background: #f0f3f1; color: #4f5c70; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.pf-tab:hover { background: #e2e7e2; color: #1d2a3d; }
.pf-tab[aria-selected="true"] { background: var(--navy); color: #ffffff; }
.pf-tab:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.pf-panels { display: grid; padding: 12px 14px 14px; }
.pf-p { grid-area: 1 / 1; min-width: 0; }
.pf-p[hidden] { display: block; visibility: hidden; }
.pf-p-tag { font-size: .875rem; font-weight: 500; color: #4f5c70; }
.pf-m { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 0; }
.pf-m > div { display: flex; flex-direction: column; padding: 10px 12px 12px; border-radius: 12px; background: #f0f3f1; }
.pf-m dt { order: 2; font-size: .8125rem; font-weight: 600; line-height: 1.2; color: #1d2a3d; }
.pf-m dd { order: 1; margin: 0 0 4px; font-size: clamp(1.375rem, 1.1rem + .9vw, 1.75rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; color: #1d2a3d; white-space: nowrap; }
.pf-m small { order: 3; margin-top: 2px; font-size: .8125rem; line-height: 1.25; color: #4f5c70; }
.pf-m > div:first-child { background: #eef3b3; box-shadow: inset 0 0 0 2px var(--lime); }

.pf-3d { width: clamp(84px, 7.6vw, 118px); right: clamp(10px, 1.4vw, 22px); top: clamp(8px, 1.2vw, 18px); }

/* ── Filtros ── */
.pf-head { align-items: flex-end; }
.pf-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 40rem; }
.pf-f { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 16px; border: 0; border-radius: 999px; background: var(--tile); color: var(--ink); font: inherit; font-size: var(--t-small); font-weight: 500; cursor: pointer; transition: background-color .18s ease, color .18s ease, scale .18s var(--ease-out); }
.pf-f-n { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; background: var(--surface); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .18s ease, color .18s ease; }
.pf-f:hover { background: var(--lime); color: var(--on-lime); }
.pf-f:active { scale: .97; }
.pf-f[aria-pressed="true"] { background: var(--navy); color: #ffffff; }
.pf-f[aria-pressed="true"] .pf-f-n { background: var(--lime); color: var(--on-lime); }
.pf-f:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
html.dark .pf-f[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
html.dark .pf-f[aria-pressed="true"] .pf-f-n { background: var(--navy); color: var(--lime); }
.pf-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Grilla de casos ── */
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: var(--gap); }
.pf-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--tile-r); transition: background-color .25s ease, translate .25s var(--ease-out), box-shadow .25s ease; }
.pf-card[hidden] { display: none; }
.pf-card:hover { translate: 0 -4px; box-shadow: 0 18px 44px rgba(29, 42, 61, .12); }
.pf-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.pf-card.is-link { cursor: pointer; }

.pf-shot { position: relative; overflow: hidden; background: var(--surface); }
.pf-shot > img:not(.t3d) { display: block; width: 100%; aspect-ratio: 16 / 9.2; object-fit: cover; object-position: top; transition: scale .6s var(--ease-out); }
.pf-card:hover .pf-shot > img:not(.t3d) { scale: 1.04; }
.pf-badge { position: absolute; z-index: 1; left: 14px; bottom: 14px; display: grid; gap: 1px; max-width: calc(100% - 28px); padding: 8px 14px 9px; border-radius: 14px; background: #ffffff; color: #4f5c70; font-size: .8125rem; line-height: 1.2; box-shadow: 0 10px 26px rgba(20, 30, 50, .22); }
.pf-badge b { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; color: #1d2a3d; }

.pf-body { flex: 1; display: flex; flex-direction: column; padding: clamp(20px, 2.1vw, 30px); }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pf-tags li { padding: 4px 11px; border-radius: 999px; background: var(--surface); color: var(--soft); font-size: .8125rem; font-weight: 600; line-height: 1.25; }
.pf-name { margin-top: 14px; font-size: clamp(1.625rem, 1.25rem + 1.1vw, 2.25rem); font-weight: 600; letter-spacing: -0.032em; line-height: 1.05; }
.pf-sub { margin-top: 4px; font-weight: 500; color: var(--soft); }
.pf-desc { margin-top: 10px; color: var(--ink); line-height: 1.42; }
.pf-go { display: inline-flex; align-items: center; gap: .3em; margin-top: auto; padding-top: 18px; font-weight: 600; color: var(--brand); }
.pf-go svg { width: 1.1em; height: 1.1em; transition: translate .18s var(--ease-out); }
.pf-card:hover .pf-go svg { translate: 2px -2px; }

/* Caso destacado: Los Del Mar ocupa dos columnas, con su tienda y sus cifras */
.pf-feat { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.pf-feat .pf-shot { display: flex; align-items: center; justify-content: center; padding: clamp(28px, 3vw, 48px) clamp(18px, 2.2vw, 34px); background: var(--lime); }
.pf-shot-win { width: 100%; padding: 0 6px 6px; border-radius: 14px; box-shadow: 0 20px 48px rgba(29, 42, 61, .24); transition: translate .5s var(--ease-out); }
.pf-shot-win img { aspect-ratio: 1200 / 660; }
.pf-feat:hover .pf-shot-win { translate: 0 -6px; }
.pf-feat-3d { width: clamp(70px, 6.4vw, 104px); left: clamp(10px, 1.2vw, 18px); bottom: clamp(8px, 1vw, 16px); }
.pf-star { display: flex; align-items: center; gap: .45em; margin-bottom: 12px; font-size: var(--t-small); font-weight: 600; color: var(--brand); }
.pf-star svg { width: 1.1em; height: 1.1em; fill: var(--lime); }
.pf-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 18px; }
.pf-kpi { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; border-radius: 14px; background: var(--surface); }
.pf-kpi strong { font-size: clamp(1.5rem, 1.2rem + .9vw, 2rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-kpi > span:last-child { font-size: .8125rem; line-height: 1.25; color: var(--soft); }
.pf-kpi-x { background: var(--navy); color: #f2f5f8; }
.pf-kpi-x strong { color: var(--lime); }
.pf-kpi-x > span:last-child { color: #c8d1dc; }
.pf-x { display: inline-block; transform-origin: left bottom; }
.pf-x-bars { display: flex; align-items: flex-end; gap: 5px; height: 30px; }
.pf-x-bars i { display: block; width: 14px; height: var(--h); border-radius: 4px 4px 2px 2px; background: rgba(255, 255, 255, .28); transform-origin: 50% 100%; }
.pf-x-bars i.is-now { background: var(--lime); }
.pf-speed { display: grid; gap: 4px; }
.pf-speed i { display: block; width: var(--w); height: 6px; border-radius: 6px; background: var(--lime); transform-origin: left center; }
.pf-speed i.is-before { background: #c2362f; }
html.dark .pf-speed i.is-before { background: #ff8a80; }
html.dark .t-white .pf-star svg { color: var(--lime); }

/* Cierre de la grilla: tu proyecto */
.pf-cta { justify-content: flex-end; min-height: 320px; padding: clamp(104px, 9vw, 140px) var(--tile-pad) var(--tile-pad); }
.pf-cta-3d { width: clamp(80px, 7vw, 116px); right: clamp(14px, 1.6vw, 24px); top: clamp(12px, 1.4vw, 22px); }
.pf-cta-h { margin-top: 10px; font-size: clamp(1.875rem, 1.3rem + 1.4vw, 2.625rem); }
.pf-cta-p { margin-top: 10px; color: #c8d1dc; line-height: 1.42; }
.pf-cta .btn { align-self: flex-start; margin-top: 20px; }

/* ── Tamaños ── */
@media (max-width: 1023px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-head { flex-direction: column; align-items: flex-start; }
  .pf-filters { justify-content: flex-start; max-width: none; }
  .pf-feat { grid-column: 1 / -1; }
}
/* Cuando el caso destacado queda angosto, sus cifras pasan a filas: número y texto lado a lado. */
@media (min-width: 1024px) and (max-width: 1180px), (max-width: 720px) {
  .pf-kpis { grid-template-columns: minmax(0, 1fr); }
  .pf-kpi { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .pf-viz { display: none; }
}
@media (max-width: 720px) {
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-feat { grid-template-columns: minmax(0, 1fr); }
  .pf-res { width: 100%; margin-top: 10px; }
  .pf-tabs { padding-inline: 8px; gap: 4px; }
  .pf-tab { flex: 1 1 auto; padding: 0 4px; font-size: .8125rem; letter-spacing: -0.01em; white-space: nowrap; }
  .pf-panels { padding: 10px; }
  .pf-m > div { padding: 8px 9px 10px; }
  .pf-m dd { font-size: 1.1875rem; }
  .pf-3d { width: 64px; top: 8px; right: 8px; }
  .pf-feat-3d { width: 64px; }
  .pf-f { min-height: 40px; padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-shots img, .pf-card, .pf-shot > img, .pf-shot-win { transition: none; }
}

/* La dirección del navegador se lee: mínimo 13 px. */
.pf-win .dv-url, .pf-shot-win .dv-url { font-size: .8125rem; }

/* Con 8 casos (el destacado ocupa dos columnas) la grilla de tres columnas suma 10 celdas:
   la tarjeta final pasa a ocupar la fila completa, en horizontal, para cerrar la grilla. */
@media (min-width: 1024px) {
  .pf-cta { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: clamp(24px, 3.4vw, 56px); align-items: end; min-height: 0; padding: var(--tile-pad); padding-right: calc(var(--tile-pad) + clamp(96px, 9vw, 140px)); }
  .pf-cta .kicker { grid-column: 1; grid-row: 1; }
  .pf-cta-h { grid-column: 1; grid-row: 2; }
  .pf-cta-p { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin-top: 0; }
  .pf-cta .btn { grid-column: 3; grid-row: 1 / span 2; align-self: end; margin-top: 0; }
}
