/* ==========================================================================
   Catalogo Wha · catalog.css
   Tarjetas del catálogo optimizadas según el tipo (producto / servicio).
   Solo lo carga catalogo.html.
   ========================================================================== */

.pc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.pc:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pc--service { border-color: #e4d6f6; }
.pc--service:hover { border-color: var(--brand); }

/* --- Media --- */
.pc-media { position: relative; aspect-ratio: 6 / 5; background: var(--line); cursor: pointer; overflow: hidden; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.pc:hover .pc-media img { transform: scale(1.04); }
.pc-media .ph-img { width: 100%; height: 100%; display: grid; place-items: center; font-size: 2rem; color: var(--muted); }

.pc-kind {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: var(--brand); color: #fff; border-radius: 999px;
  padding: 4px 11px; font-size: .71rem; font-weight: 800; letter-spacing: .02em;
}
.pc-cat {
  position: absolute; bottom: 10px; inset-inline-start: 10px;
  background: rgba(255,255,255,.95); color: var(--ink); border-radius: 999px;
  padding: 4px 11px; font-size: .71rem; font-weight: 700;
}
.pc-off {
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: #e11d48; color: #fff; border-radius: 999px;
  padding: 4px 11px; font-size: .71rem; font-weight: 800;
}
.pc-incart {
  position: absolute; bottom: 10px; inset-inline-end: 10px;
  background: #14804a; color: #fff; border-radius: 999px;
  padding: 4px 11px; font-size: .71rem; font-weight: 800;
}

/* --- Cuerpo --- */
.pc-body { padding: 15px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.pc-name { font-size: 1.02rem; margin: 0 0 9px; line-height: 1.25; }
.pc-desc { font-size: .84rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 10px; }
.pc--service .pc-desc { color: var(--ink-2); }

.pc-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.pc-price b { font-size: 1.2rem; letter-spacing: -.01em; }
.pc-price s { color: var(--muted); font-size: .84rem; }
.pc-price.consult b { color: var(--brand); font-size: 1rem; }
.pc--service .pc-price b { color: var(--brand); }

.pc-specs { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 13px; }
.pc-specs span { font-size: .8rem; color: var(--ink-2); }
.pc-specs .ok { color: #14804a; font-weight: 700; }
.pc-specs .save { color: var(--brand); font-weight: 700; }

.pc-actions { display: flex; gap: 8px; margin-top: auto; align-items: stretch; }
.pc-actions .btn { flex: 1 1 0; min-width: 0; }
/* Texto largo (p. ej. «Ver detalles» en francés) se recorta en vez de desbordar */
.pc-actions .btn:not(.pc-share) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Distintivo sutil para servicios */
.pc--service .pc-name { position: relative; }

/* ==========================================================================
   Tarjeta de SERVICIO: disposición propia (duración, modalidad, reserva)
   ========================================================================== */
.pc--service { border-color: #e2d4f5; }
.pc--service .pc-body { background: linear-gradient(180deg, #faf7fe, #fff 42%); }
.pc--service .pc-name { font-size: 1.06rem; margin-bottom: 10px; }

.pc-specs-list { display: flex; flex-direction: column; gap: 7px; margin: 0 0 14px; }
.pc-spec { display: flex; align-items: center; gap: 9px; font-size: .86rem; color: var(--ink-2); }
.pc-spec i {
  font-style: normal; width: 24px; height: 24px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: .78rem; flex: 0 0 auto;
}

.pc-service-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 11px; margin: 0 0 13px; border-top: 1px dashed var(--line-2);
}
.pc-service-foot .pc-price { margin: 0; }
.pc-service-foot .pc-price b { font-size: 1.05rem; color: var(--brand); }
.pc-service-foot .pc-price b.consult { font-size: .92rem; }
.pc-avail {
  font-size: .74rem; font-weight: 800; color: #14804a;
  background: #e7f8ef; border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.pc--service .pc-actions .btn.soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pc--service .pc-actions .btn.soft:hover { background: #e9dcf8; }

/* En pantallas muy pequeñas, acciones apiladas */
@media (max-width: 380px) {
  .pc-actions { flex-direction: column; }
}

/* Botón de compartir en la tarjeta */
.pc-share {
  flex: 0 0 40px !important; width: 40px; min-width: 40px;
  padding: 0 !important; display: inline-grid; place-items: center;
  font-size: 1rem; line-height: 1;
}

/* ==========================================================================
   Ficha de detalle (arreglo del solapamiento de texto)
   ========================================================================== */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-info { min-width: 0; }

/* Antes se reutilizaba .card-chip, que es position:absolute y tapaba el texto. */
.detail-type {
  display: inline-block;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 999px; padding: 5px 12px;
  font-size: .74rem; font-weight: 800; letter-spacing: .02em;
  margin-bottom: 10px; position: static;
}
.detail-info h2 { margin: 0 0 8px; font-size: 1.35rem; line-height: 1.2; }
.detail-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.detail-price b { font-size: 1.4rem; }
.detail-price s { color: var(--muted); font-size: .95rem; }
.detail-rows { list-style: none; padding: 0; margin: 12px 0; }
.detail-rows li { padding: 7px 0; font-size: .92rem; border-bottom: 1px solid var(--line); }
.detail-rows li:last-child { border-bottom: 0; }
.detail-desc { color: var(--ink-2); font-size: .93rem; line-height: 1.65; margin: 12px 0 0; white-space: pre-line; }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 150px; }

.dg-main { border-radius: 14px; overflow: hidden; background: var(--line); aspect-ratio: 4/3; }
.dg-main img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* En móvil la ficha se convierte en hoja inferior */
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; gap: 18px; }
  .cw-modal-overlay:has(.detail-modal) { align-items: end; padding: 0; }
  .detail-modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .detail-modal .cw-modal-body { padding: 18px 16px; }
  .detail-actions .btn { min-width: 0; }
}

/* Politicas en el pie del catalogo */
.cat-policies { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 10px; }
.cat-policies a { color: var(--muted); font-size: .84rem; }
.cat-policies a:hover { color: var(--brand); text-decoration: underline; }

/* Menú del catálogo: en móvil se despliega con el botón, y los campos ocupan
   todo el ancho como una lista de menú. */
.filter-toggle { display: none; }
.filter-fields { display: contents; }

@media (max-width: 720px) {
  .filter-bar-cat { top: 62px; }
  .filter-inner { padding: 8px 0; gap: 8px; }
  .filter-toggle { display: inline-flex; width: 100%; justify-content: center; gap: 8px; }
  .filter-fields { display: none; width: 100%; flex-direction: column; gap: 8px; }
  .filter-fields.open { display: flex; }
  .filter-fields select, .filter-fields .search, .filter-fields .segmented, .filter-fields .btn { width: 100%; min-width: 0; }
  .filter-fields select { padding: 12px 38px 12px 40px; }
  .filter-fields .search { padding: 12px 14px 12px 40px; }
  [dir="rtl"] .filter-fields .search { padding: 12px 40px 12px 14px; }
}


/* ==========================================================================
   Formulario de reserva de servicios (una sola pantalla)
   ========================================================================== */
.bk-modal { width: min(560px, 100%); }
.bk-modal .cw-modal-body { padding: 18px 20px 20px; }
.bk-field { margin-bottom: 14px; }
.bk-label { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 650; margin-bottom: 7px; color: var(--ink); }
.bk-label .req { color: var(--bad); }
.bk-num {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: .72rem; font-weight: 800;
}
.bk-field input, .bk-field select, .bk-field textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px 14px; font: inherit; background: #fff; color: var(--ink);
}
.bk-field input:focus, .bk-field select:focus, .bk-field textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.bk-field textarea { resize: vertical; min-height: 62px; }
.bk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-hint {
  margin: -4px 0 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--warn-soft); color: #8a5a12; font-size: .84rem; line-height: 1.5;
}
.bk-hint[hidden] { display: none; }
.bk-submit {
  width: 100%; margin-top: 6px; border: 0; border-radius: 14px;
  background: #25D366; color: #fff; font: inherit; font-weight: 800; font-size: .98rem;
  padding: 15px 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, transform .15s;
}
.bk-submit:hover { filter: brightness(1.05); }
.bk-submit:active { transform: translateY(1px); }
.bk-submit:disabled { opacity: .6; pointer-events: none; }
.bk-field.req .bk-label::after { content: ' *'; color: var(--bad); }

/* Numeración automática: 1, 2, 3… según el orden real de los campos */
.bk-modal .cw-modal-body { counter-reset: bkfield; }
.bk-num:empty {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: .72rem; font-weight: 800;
}
.bk-num:empty::before { counter-increment: bkfield; content: counter(bkfield); }

/* Confirmación de la cita */
.bk-done { width: min(480px, 100%); }
.bk-done-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.bk-done-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; font-size: .9rem; border-bottom: 1px solid var(--line); }
.bk-done-row:last-child { border-bottom: 0; }
.bk-done-row span { color: var(--muted); }
.bk-done-row b { text-align: end; }
.bk-done-hint { font-size: .85rem; margin: 0 0 12px; }
.bk-done .btn { margin-top: 8px; text-align: center; justify-content: center; }

/* Móvil: el formulario no se solapa y el botón queda siempre a la vista */
@media (max-width: 560px) {
  .bk-modal { width: 100%; max-height: 92vh; }
  .bk-modal .cw-modal-body { padding: 12px 14px 12px; max-height: calc(92vh - 64px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .bk-field { margin-bottom: 12px; }
  .bk-field input, .bk-field select, .bk-field textarea { font-size: 16px; padding: 13px 14px; }
  .bk-field select { min-height: 48px; }
  .bk-submit {
    position: sticky; bottom: 0; margin: 6px -2px 0; padding: 16px 18px;
    box-shadow: 0 -8px 20px rgba(255,255,255,.9);
  }
  .bk-done .btn { padding: 14px; }
}


@media (max-width: 560px) {
  .bk-two { grid-template-columns: 1fr; gap: 0; }
  .bk-modal .cw-modal-body { padding: 14px 16px 16px; }
}
