/* ══════════════════════════════════════════════════════════
 *  PIR – Hero + vitrina en dos columnas (task_130, ap_112)
 *  template-parts/homepage/section-hero-vitrina.php
 *  Traducido del prototipo de Tailwind; sin CDN.
 * ══════════════════════════════════════════════════════════ */

.pir-hv {
    --pir-hv-teal: #0f766e;
    --pir-hv-teal-d: #115e59;
    --pir-hv-navy: #0f172a;
    --pir-hv-slate: #475569;
    --pir-hv-muted: #64748b;
    --pir-hv-line: #e2e8f0;
    background: #f8fafc;
    border-bottom: 1px solid var(--pir-hv-line);
    color: var(--pir-hv-navy);
}
.pir-hv *, .pir-hv *::before, .pir-hv *::after { box-sizing: border-box; }
.pir-hv-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 16px;
}
.pir-hv-sr {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Columna izquierda: buscador ───────────────────────── */
.pir-hv-kicker {
    display: inline-block;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(13, 148, 136, .1); color: var(--pir-hv-teal-d);
    font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.pir-hv-h1 {
    margin: 16px 0 0;
    font-size: 1.875rem; line-height: 1.2; font-weight: 800; letter-spacing: -.01em;
    color: var(--pir-hv-navy);
}
.pir-hv-sub {
    margin: 16px 0 0;
    font-size: 1rem; line-height: 1.65; color: var(--pir-hv-slate);
}
.pir-hv-badges {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 20px 0 0; padding: 0; list-style: none;
    font-size: .875rem; color: #334155;
}
.pir-hv-badges li {
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--pir-hv-line); background: #fff;
}

.pir-hv-form {
    margin-top: 24px; padding: 16px;
    background: #fff; border: 1px solid var(--pir-hv-line); border-radius: 16px;
    box-shadow: 0 10px 30px rgba(148, 163, 184, .25);
}
.pir-hv-tipo {
    display: grid; grid-template-columns: 1fr 1fr;
    margin: 0; padding: 4px; border: 0; border-radius: 12px;
    background: #f1f5f9; font-size: .875rem; font-weight: 600;
}
.pir-hv-tipo label { cursor: pointer; margin: 0; }
.pir-hv-tipo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pir-hv-tipo span {
    display: block; padding: 8px 0; border-radius: 8px;
    text-align: center; color: var(--pir-hv-muted);
}
.pir-hv-tipo input:checked + span { background: var(--pir-hv-navy); color: #fff; }
.pir-hv-tipo input:focus-visible + span { outline: 2px solid var(--pir-hv-teal); outline-offset: 2px; }

.pir-hv-campos { display: grid; gap: 12px; margin-top: 12px; }
.pir-hv-campos select {
    width: 100%; height: auto; margin: 0;
    padding: 12px 36px 12px 12px;
    border: 1px solid var(--pir-hv-line); border-radius: 12px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: .9rem; color: #334155; cursor: pointer;
    -webkit-appearance: none; appearance: none;
}
.pir-hv-campos select:focus { border-color: var(--pir-hv-teal); outline: 2px solid rgba(13, 148, 136, .25); }

.pir-hv-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 12px; padding: 12px;
    border: 0; border-radius: 12px;
    background: var(--pir-hv-teal); color: #fff;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background .2s;
}
.pir-hv-btn:hover { background: var(--pir-hv-teal-d); }
.pir-hv-btn:focus-visible { outline: 2px solid var(--pir-hv-teal); outline-offset: 2px; }

.pir-hv-publicar {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    margin-top: 20px;
}
.pir-hv-publicar p { margin: 0; font-size: .875rem; color: var(--pir-hv-muted); }
.pir-hv-btn-sec {
    display: inline-flex; align-items: center; white-space: nowrap;
    padding: 10px 16px; border: 1px solid var(--pir-hv-navy); border-radius: 12px;
    font-size: .875rem; font-weight: 600; color: var(--pir-hv-navy); text-decoration: none;
}
.pir-hv-btn-sec:hover { background: var(--pir-hv-navy); color: #fff; }

/* ── Columna derecha: vitrina ──────────────────────────── */
.pir-hv-vitrina { margin-top: 40px; min-width: 0; }
.pir-hv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pir-hv-head h2 {
    margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--pir-hv-navy);
}
.pir-hv-label {
    padding: 2px 8px; border-radius: 6px;
    background: rgba(15, 23, 42, .05); color: var(--pir-hv-slate);
    font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.pir-hv-intro { margin: 4px 0 0; font-size: .875rem; color: var(--pir-hv-muted); }
/* ap_114: una línea sobre fondo claro; en navy le ganaba a las fotos. */
.pir-hv-nota {
    margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
    background: #f1f5f9; border: 1px solid var(--pir-hv-line);
    color: var(--pir-hv-slate); font-size: .875rem; line-height: 1.5;
}
.pir-hv-nota strong { color: var(--pir-hv-navy); }
.pir-hv-nota a { color: var(--pir-hv-teal); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pir-hv-nota a:hover { color: var(--pir-hv-teal-d); }

/* Móvil: carrusel horizontal con snap */
.pir-hv-grid {
    display: flex; gap: 16px;
    margin: 16px -16px 0; padding: 0 16px 8px;
    list-style: none;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.pir-hv-item { flex: 0 0 78%; scroll-snap-align: start; margin: 0; }
.pir-hv-item--franja { order: 99; }

.pir-hv-card {
    position: relative; display: flex; flex-direction: column; height: 100%;
    overflow: hidden; border: 1px solid var(--pir-hv-line); border-radius: 16px;
    background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    transition: transform .2s, box-shadow .2s;
}
.pir-hv-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, .1); }
.pir-hv-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e2e8f0; }
/* El tema pone height:auto en las img: sin !important la foto no llena la caja 4:3. */
.pir-hv .pir-hv-img img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
.pir-hv-badge, .pir-hv-tipo-op {
    position: absolute; top: 8px;
    padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; color: #fff;
}
.pir-hv-badge { left: 8px; background: #b45309; }
.pir-hv-tipo-op { right: 8px; background: var(--pir-hv-navy); }
.pir-hv-body { display: flex; flex: 1; flex-direction: column; padding: 12px; }
.pir-hv .pir-hv-body h3 {
    margin: 0; font-size: .875rem; font-weight: 600; line-height: 1.35;
    min-height: calc(2 * 1.35em);
}
/* Título en 2 líneas. El clamp va en el enlace: el tema lo pone en inline-block y así
   el clamp del H3 no recorta (medido 2026-10-30: 3 líneas con el clamp en el H3). */
.pir-hv .pir-hv-body h3 a {
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pir-hv-body h3 a { color: var(--pir-hv-navy); text-decoration: none; }
/* Toda la tarjeta es clicable sin anidar enlaces: el enlace del H3 la cubre. */
.pir-hv-body h3 a::after { content: ""; position: absolute; inset: 0; }
.pir-hv-body h3 a:focus-visible { outline: none; }
.pir-hv-card:focus-within { outline: 2px solid var(--pir-hv-teal); outline-offset: 2px; }
.pir-hv-loc { margin: 4px 0 0; font-size: .75rem; color: var(--pir-hv-muted); }
.pir-hv-precio { margin: 8px 0 0; font-size: 1.125rem; font-weight: 800; color: var(--pir-hv-teal-d); }
.pir-hv-meta { margin: auto 0 0; padding-top: 4px; font-size: .75rem; color: var(--pir-hv-slate); }

.pir-hv-franja {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px;
    height: 100%; padding: 20px;
    border: 2px dashed rgba(13, 148, 136, .4); border-radius: 16px;
    background: #fff; color: var(--pir-hv-navy); text-decoration: none;
    transition: border-color .2s, background .2s;
}
.pir-hv-franja:hover { border-color: var(--pir-hv-teal); background: rgba(13, 148, 136, .05); }
.pir-hv-franja strong { display: block; font-size: 1rem; font-weight: 700; }
.pir-hv-franja strong + span { display: block; margin-top: 4px; font-size: .875rem; color: var(--pir-hv-muted); }
.pir-hv-franja b { color: var(--pir-hv-navy); }
.pir-hv-franja-cta {
    flex-shrink: 0; padding: 10px 16px; border-radius: 12px;
    background: var(--pir-hv-teal); color: #fff; font-size: .875rem; font-weight: 600;
}

.pir-hv-pie { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.pir-hv-pager { display: none; gap: 8px; margin-right: auto; }
.pir-hv-pag {
    width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--pir-hv-line); border-radius: 999px;
    background: #fff; color: var(--pir-hv-navy);
    font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.pir-hv-pag:hover { border-color: var(--pir-hv-navy); }
.pir-hv-pag:focus-visible { outline: 2px solid var(--pir-hv-teal); outline-offset: 2px; }
.pir-hv-todas { margin: 0; text-align: right; }
.pir-hv-todas a { font-size: .875rem; font-weight: 600; color: var(--pir-hv-navy); text-decoration: none; }
.pir-hv-todas a:hover { text-decoration: underline; }

/* Selector de idioma (mu-plugin pir-auto-translate, fijo abajo a la izquierda): en portada
   tapaba el buscador; aparece cuando el hero ya pasó. */
html.pir-hv-portada:not(.pir-hv-pasado) #pir-lang-switcher { visibility: hidden; opacity: 0; }
#pir-lang-switcher { transition: opacity .2s; }

/* < 640px: el botón Buscar debe quedar sobre la barra inferior (755 px a 375x812) */
@media (max-width: 639px) {
    .pir-hv-wrap { padding-top: 20px; }
    .pir-hv-kicker, .pir-hv-badges { display: none; }
    .pir-hv-h1 { margin-top: 0; font-size: 1.625rem; }
    .pir-hv-sub {
        margin-top: 10px; font-size: .9375rem; line-height: 1.5;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .pir-hv-form { margin-top: 16px; padding: 14px; }
}

/* ── >= 640px: grid de 2, extras ocultas (las elige el script) ── */
@media (min-width: 640px) {
    .pir-hv-wrap { padding: 32px 24px; }
    .pir-hv-h1 { font-size: 2.25rem; }
    .pir-hv-sub { font-size: 1.125rem; }
    .pir-hv-form { padding: 20px; }
    .pir-hv-campos { grid-template-columns: 1fr 1fr; }
    .pir-hv-publicar { flex-direction: row; align-items: center; gap: 16px; }
    .pir-hv-head h2 { font-size: 1.5rem; }
    .pir-hv-grid {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 16px 0 0; padding: 0; overflow: visible;
    }
    .pir-hv-item--extra { display: none; }
    .pir-hv-pager { display: flex; }
    .pir-hv-item--franja { grid-column: 1 / -1; }
    .pir-hv-franja { flex-direction: row; align-items: center; }
}

/* ── >= 1024px: dos columnas, 5/12 y 7/12 ──────────────── */
@media (min-width: 1024px) {
    .pir-hv-wrap {
        display: grid; grid-template-columns: 5fr 7fr; gap: 40px;
        padding: 28px 24px 48px;
    }
    .pir-hv-wrap--solo { grid-template-columns: minmax(0, 640px); justify-content: center; }
    .pir-hv-sub { margin-top: 12px; line-height: 1.55; }
    .pir-hv-form { margin-top: 20px; }
    .pir-hv-vitrina { margin-top: 0; }
    .pir-hv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .pir-hv-h1 { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pir-hv-card, .pir-hv-btn, .pir-hv-franja { transition: none; }
    .pir-hv-card:hover { transform: none; }
}
