/**
 * URBAN.A — Ficha de Imóvel (single-imovel.php) — v3.0.0
 *
 * Reconstruído: este ficheiro tinha sido referenciado por functions.php
 * (wp_enqueue_style 'urbana-single-imovel') mas nunca foi entregue no
 * pacote original. Cobre apenas os selectores exclusivos desta template
 * (prefixo .ph-*, tira de miniaturas, ficha técnica, certificado, sidebar
 * de contacto); o layout genérico (.det-layout, .ficha-bar, .sidebar-card,
 * .map-ph, etc.) já existe em style.css e não é duplicado aqui.
 *
 * Usa as variáveis definidas em style.css (:root).
 */

/* ── 1. HERO ── */
.prop-hero { position: relative; min-height: clamp(460px, 62vw, 640px); overflow: hidden; display: flex; align-items: flex-end; }
.ph-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-color: var(--sand); }
.ph-bg--empty { background: linear-gradient(135deg, var(--ink), #0d262f); }
.ph-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(21,60,76,.92) 0%, rgba(21,60,76,.55) 42%, rgba(21,60,76,.12) 75%, rgba(21,60,76,.05) 100%); pointer-events: none; }

.ph-inner { position: relative; z-index: 2; width: 100%; display: grid; grid-template-columns: 1fr 380px; gap: clamp(24px, 3vw, 56px); align-items: end; padding: clamp(100px, 12vw, 160px) var(--sec-x) clamp(28px, 3vw, 44px); }

.ph-left { color: var(--white); min-width: 0; }
.ph-badges { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ph-badge { font-size: 9px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; padding: 7px 14px; border-radius: var(--r); display: inline-flex; align-items: center; }
.ph-badge--excl { background: var(--gold); color: var(--white); }
.ph-badge--res  { background: var(--white); color: var(--ink); }
.ph-badge--red  { background: #c0392b; color: var(--white); }

.ph-title { font-size: clamp(28px, 3.6vw, 46px); color: var(--white); line-height: 1.08; letter-spacing: -.6px; margin-bottom: 12px; }
.ph-loc { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 300; color: rgba(255,255,255,.8); margin-bottom: 22px; }
.ph-loc svg { flex-shrink: 0; color: var(--gold); }

.ph-specs { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 36px); margin-bottom: 22px; }
.ph-spec { display: flex; flex-direction: column; gap: 4px; }
.ph-spec-val { font-size: 18px; font-weight: 700; color: var(--white); letter-spacing: -.3px; line-height: 1; }
.ph-spec-lbl { font-size: 9px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.55); }
.ph-spec--cert { flex-direction: row; align-items: center; gap: 8px; }
.ph-spec--cert .ph-spec-lbl { align-self: center; }

.ph-gal-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-gal-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--white); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 10px 16px; border-radius: var(--r); cursor: pointer; transition: background .2s, border-color .2s; white-space: nowrap; }
.ph-gal-btn:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.4); }

/* ── Cartão de formulário do hero ── */
.ph-right { min-width: 0; }
.ph-form-card { background: var(--white); border-radius: var(--r); padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }

.ph-price-block { text-align: center; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.ph-price-ant { font-size: 13px; font-weight: 400; color: var(--muted); text-decoration: line-through; margin-bottom: 2px; }
.ph-price { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -.8px; line-height: 1.1; }
.ph-price span { font-size: 18px; font-weight: 600; color: var(--gold); }
.ph-price-sub { font-size: 10.5px; font-weight: 500; letter-spacing: 1px; color: var(--muted); margin-top: 6px; text-transform: uppercase; }

.ph-reservado-msg { text-align: center; padding: 20px 8px; background: var(--sand); border-radius: var(--r); margin-bottom: 18px; }
.ph-reservado-msg strong { display: block; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.ph-reservado-msg p { font-size: 12px; font-weight: 300; color: var(--muted); margin: 0; line-height: 1.6; }

.ph-success { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px 8px; color: #2e7d32; font-size: 13px; font-weight: 600; margin-bottom: 18px; }

/* Formulário de fallback (só aparece se o plugin urbana-imoveis não estiver activo) */
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-field { margin-bottom: 10px; }
.pf-row .pf-field { margin-bottom: 0; }
.ph-form-card input, .ph-form-card textarea { width: 100%; border: 1px solid rgba(21,60,76,.1); padding: 12px 14px; font-size: 16px; font-weight: 300; color: var(--ink); background: var(--white); outline: none; border-radius: var(--r); transition: border-color .2s; }
.ph-form-card input:focus, .ph-form-card textarea:focus { border-color: var(--gold); }
.pf-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; font-weight: 300; color: var(--muted); line-height: 1.6; margin: 8px 0 14px; }
.pf-consent input { width: auto; margin-top: 3px; flex-shrink: 0; }
.pf-consent a { color: var(--ink); text-decoration: underline; }
.pf-error { font-size: 11.5px; color: #c0392b; margin: 0 0 12px; }
.pf-submit { width: 100%; justify-content: center; padding: 13px; background: var(--ink); color: var(--white); border: none; border-radius: var(--r); font-size: 10.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.pf-submit:hover { background: var(--gold); }

/* Botão que substitui o formulário completo do hero em mobile — ver
   .ph-form-wrap / media query 680px mais abaixo. Escondido por omissão
   (desktop mostra sempre o formulário completo). */
.ph-form-mobile-btn { display: none; width: 100%; justify-content: center; padding: 13px; background: var(--ink); color: var(--white); border: none; border-radius: var(--r); font-size: 10.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.ph-form-mobile-btn:hover { background: var(--gold); }

/* Integração do formulário do plugin (urbana_render_lead_form) dentro do cartão */
.ph-form-card .urbana-lead-form__heading { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.ph-form-card .urbana-lead-form__form button[type="submit"] { width: 100%; justify-content: center; padding: 13px; background: var(--ink); color: var(--white); border: none; border-radius: var(--r); font-size: 10.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.ph-form-card .urbana-lead-form__form button[type="submit"]:hover { background: var(--gold); }

.ph-cta-row { display: flex; gap: 8px; margin-top: 16px; }
.ph-cta-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink); background: var(--sand); border: 1px solid var(--rule); padding: 11px 8px; border-radius: var(--r); cursor: pointer; transition: all .2s; white-space: nowrap; }
.ph-cta-btn:hover { border-color: var(--ink); }
.ph-cta-btn.is-fav, .sq-btn.is-fav { color: var(--gold); border-color: var(--gold); }

.ph-agent-mini { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.ph-agent-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--sand); border: 2px solid var(--rule); }
.ph-agent-name { font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ph-agent-role { font-size: 9.5px; font-weight: 400; color: var(--muted); }
.ph-resp-note { margin-left: auto; font-size: 9px; font-weight: 500; color: var(--gold); text-align: right; max-width: 90px; line-height: 1.4; }

/* ── 2. TIRA DE MINIATURAS ── */
.thumb-strip-wrap { position: relative; display: flex; align-items: center; gap: 8px; padding: 16px var(--sec-x); background: var(--sand); border-bottom: 1px solid var(--rule); }
.thumb-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; flex: 1; }
.thumb-strip::-webkit-scrollbar { display: none; }
.ts-thumb { flex-shrink: 0; width: 96px; height: 72px; border-radius: var(--r); overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; scroll-snap-align: start; background: none; opacity: .6; transition: opacity .2s, border-color .2s; }
.ts-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ts-thumb.on, .ts-thumb:hover { opacity: 1; border-color: var(--gold); }
.ts-arrow { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--ink); cursor: pointer; transition: border-color .2s; }
.ts-arrow:hover { border-color: var(--ink); }

/* ── 3. CARACTERÍSTICAS / FICHA TÉCNICA ── */
.det-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 36px; }
.det-table tr { border-bottom: 1px solid var(--rule); }
.det-table tr:last-child { border-bottom: none; }
.det-table td { padding: 12px 4px; vertical-align: top; }
.det-table td:first-child { color: var(--muted); font-weight: 400; width: 42%; }
.det-table td:last-child { color: var(--ink); font-weight: 500; text-align: right; }

/* ── 4. CERTIFICAÇÃO ENERGÉTICA ── */
.cert-block { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--sand); border-radius: var(--r); margin-bottom: 36px; flex-wrap: wrap; }
.cert-block-info { display: flex; flex-direction: column; gap: 4px; }
.cert-block-classe { font-size: 14px; font-weight: 700; color: var(--ink); }
.cert-block-val { font-size: 12px; font-weight: 400; color: var(--muted); }
.cert-block-em { font-size: 11px; font-weight: 300; color: var(--muted); }

/* ── 4b. VÍDEO (YouTube) ── */
.video-embed-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--r); overflow: hidden; margin-bottom: 36px; background: var(--sand); }
.video-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── 5. TOUR VIRTUAL ── */
.tour-btn { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--ink); color: var(--white); border-radius: var(--r); font-size: 11.5px; font-weight: 600; letter-spacing: .5px; margin-bottom: 36px; transition: background .2s; }
.tour-btn:hover { background: var(--gold); }

/* ── 6. CERTIFICADO NO CARD DE IMÓVEL RELACIONADO ── */
.pc-cert { position: absolute; top: 16px; left: 16px; z-index: 2; }

/* ── 7. RESPONSIVO ── */
@media (max-width: 1080px) {
  .ph-inner { grid-template-columns: 1fr; }
  .ph-right { max-width: 420px; }

  /* Cabeçalho mais compacto em mobile/tablet: a partir daqui o layout do
     hero já empilha a coluna do formulário por baixo do texto (ver regra
     acima), o que tornava o cabeçalho demasiado alto. Mostra-se preço +
     1 botão em vez do formulário completo (que já existe, igual, na
     sidebar mais abaixo). Tem de coincidir com o breakpoint que empilha
     o grid — não com o breakpoint de telemóvel — senão o formulário
     completo ainda aparece em tablet. */
  .ph-form-wrap { display: none; }
  .ph-form-mobile-btn { display: flex; }
}

@media (max-width: 680px) {
  .prop-hero { min-height: auto; }
  .ph-inner { padding: 100px 20px 24px; }
  .ph-right { max-width: none; }
  .ph-specs { gap: 18px; }
  .ph-form-card { padding: 20px; }
  .thumb-strip-wrap { padding: 12px 20px; }
  .ts-thumb { width: 76px; height: 58px; }
  .det-table td:first-child { width: 50%; }
  .cert-block { flex-direction: column; align-items: flex-start; text-align: left; }
}
