/* ==========================================================================
   Portal Noblejas - hoja de estilos
   Fiel al diseño de _design/Portal Noblejas.dc.html.
   Mecanismo responsive: container queries (container-type:inline-size + cqw)
   sobre el contenedor #pn-app. La adaptación es por ancho de contenedor.
   Paleta:
     #0581B5 primario (relleno, tipografía grande)   --pn-primary
     #04688F texto pequeño / hover                    --pn-primary-dark
     #343434 titulares                                --pn-ink
     #5B646C cuerpo                                   --pn-body
     #6B747C cuerpo tenue                             --pn-muted
     #E6EAEE líneas                                   --pn-line
     #E1E7EC líneas de campo                          --pn-line-strong
     #F4F7F9 superficies                              --pn-surface
     #F7F9FB superficie de campo                      --pn-field
     #E7F3FA distintivos                              --pn-accent
   Tipografías: Exo 2 (titulares) / Instrument Sans (cuerpo).
   Suelo táctil: 44px.
   ========================================================================== */

:root {
  --pn-primary: #0581b5;
  --pn-primary-dark: #04688f;
  --pn-ink: #343434;
  --pn-body: #5b646c;
  --pn-muted: #6b747c;
  --pn-line: #e6eaee;
  --pn-line-strong: #e1e7ec;
  --pn-surface: #f4f7f9;
  --pn-field: #f7f9fb;
  --pn-accent: #e7f3fa;
  --pn-maxw: 1240px;
  --pn-pad: clamp(14px, 4cqw, 34px);
  --pn-font-head: "Exo 2", system-ui, -apple-system, sans-serif;
  --pn-font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: #e9eef2;
  font-family: var(--pn-font-body);
  color: var(--pn-body);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

a { color: var(--pn-primary-dark); text-decoration: none; }
a:hover { color: var(--pn-primary); }
button { font: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--pn-primary); color: #fff; }

h1, h2, h3, h4, h5, h6 { font-family: var(--pn-font-head); }

/* Contenedor raíz de la app: base de las container queries.
   Reemplaza al #pn-frame del visor (que NO se reproduce). */
#pn-app {
  container-type: inline-size;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pn-container {
  max-width: var(--pn-maxw);
  margin-inline: auto;
  width: 100%;
}

/* Utilidades tipográficas fieles al diseño */
.pn-eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pn-primary-dark);
}
.pn-h1 {
  margin: 11px 0 0;
  font-family: var(--pn-font-head);
  font-weight: 700;
  font-size: clamp(24px, 5.6cqw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--pn-ink);
}
.pn-h2 {
  margin: 0;
  font-family: var(--pn-font-head);
  font-weight: 700;
  font-size: clamp(20px, 4cqw, 28px);
  letter-spacing: -0.015em;
  color: var(--pn-ink);
}
.pn-lead {
  margin: 13px 0 0;
  font-size: clamp(15px, 1.8cqw, 17px);
  line-height: 1.62;
  color: var(--pn-body);
  max-width: 40em;
}

/* --------------------------------------------------------------------------
   Skip link (accesibilidad)
   -------------------------------------------------------------------------- */
.pn-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.pn-skip:focus {
  left: 8px;
  top: 8px;
  background: var(--pn-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.pn-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pn-line);
}
.pn-header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px var(--pn-pad);
  max-width: var(--pn-maxw);
  margin-inline: auto;
}
.pn-brand {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}
.pn-brand__logo { height: clamp(27px, 4.8cqw, 34px); width: auto; flex: none; }
.pn-brand__name {
  font-family: var(--pn-font-head);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(17px, 3.4cqw, 23px);
  letter-spacing: -0.015em;
  color: var(--pn-ink);
  white-space: nowrap;
}
.pn-brand__tag {
  font-family: var(--pn-font-head);
  font-weight: 600;
  font-size: 9.5px;
  line-height: 1.18;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pn-primary-dark);
}
.pn-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.pn-nav__link {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--pn-body);
}
.pn-nav__link:hover,
.pn-nav__link[aria-current="page"] { background: #f1f5f8; color: var(--pn-primary); }
.pn-header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Elementos que solo aparecen en contenedor ancho / estrecho */
.pn-wide-only { display: none; }
@container (min-width: 720px) {
  .pn-wide-only { display: revert; }
  .pn-narrow-only { display: none !important; }
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.pn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s linear, border-color 0.15s linear, color 0.15s linear;
}
.pn-btn--primary { background: var(--pn-primary); color: #fff; }
.pn-btn--primary:hover { background: var(--pn-primary-dark); color: #fff; }
.pn-btn--ghost { border: 1px solid var(--pn-line-strong); background: #fff; color: var(--pn-body); }
.pn-btn--ghost:hover { border-color: var(--pn-primary); color: var(--pn-primary); }
.pn-btn--block { width: 100%; }
.pn-btn--lg { min-height: 48px; font-size: 15px; }

/* Controles del carrusel "Empresas en portada". Botones redondos prev/next. */
.pn-carousel-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--pn-line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--pn-body);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s linear, color 0.15s linear, background-color 0.15s linear;
}
.pn-carousel-btn:hover { border-color: var(--pn-primary); color: var(--pn-primary); }
.pn-carousel-btn:focus-visible {
  outline: 2px solid var(--pn-primary);
  outline-offset: 2px;
}
/* Ocultar la barra de scroll nativa de la pista (el desplazamiento se hace con
   los botones o gesto táctil). */
.pn-carousel-track { scrollbar-width: none; -ms-overflow-style: none; }
.pn-carousel-track::-webkit-scrollbar { width: 0; height: 0; display: none; }
@media (prefers-reduced-motion: reduce) {
  .pn-carousel-track { scroll-behavior: auto; }
}

.pn-iconbtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--pn-line-strong);
  background: #fff;
  border-radius: 11px;
  color: var(--pn-body);
}
.pn-iconbtn:hover { border-color: var(--pn-primary); color: var(--pn-primary); }
.pn-iconbtn--danger:hover { border-color: #b4453a; color: #b4453a; }

/* Sidebar de la ficha: en contenedor ancho sube a la altura del logo (que
   solapa la banda azul con margin-bottom:-38px). En estrecho, sin solape. */
.pn-ficha-aside { margin-top: 16px; }
@container (min-width: 780px) {
  .pn-ficha-aside { margin-top: -56px; }
}

/* --------------------------------------------------------------------------
   Campos de formulario
   -------------------------------------------------------------------------- */
.pn-label { display: block; font-size: 13px; font-weight: 600; color: var(--pn-ink); }
.pn-input, .pn-select, .pn-textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--pn-line-strong);
  border-radius: 10px;
  padding: 13px;
  font-size: 14.5px;
  font-weight: 400;
  outline: 0;
  background: var(--pn-field);
}
.pn-label > .pn-input,
.pn-label > .pn-select,
.pn-label > .pn-textarea { margin-top: 6px; }
.pn-input:focus, .pn-select:focus, .pn-textarea:focus {
  border-color: var(--pn-primary);
  background: #fff;
}
.pn-textarea { resize: vertical; line-height: 1.55; }

/* Selects: flecha propia y hueco para ella (evita que el texto la pise) */
.pn-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B646C' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

/* Grupo de campo con icono (icono + input/select). El resaltado de foco
   envuelve TODO el grupo (icono incluido), pegado al borde, en vez de dejar
   el outline flotando alrededor del input interno. */
.pn-field-group {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--pn-line-strong);
  border-radius: 10px;
  background: var(--pn-field);
  padding-left: 12px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.pn-field-group__icon { flex: none; display: grid; place-items: center; color: var(--pn-muted); }
/* El control interno pierde su marco: lo aporta el grupo */
.pn-field-group > .pn-input,
.pn-field-group > .pn-select,
.pn-field-group > .pn-textarea {
  border: 0;
  background: transparent;
  padding-left: 0;
  border-radius: 0;
}
/* Resaltado unificado al enfocar cualquier control del grupo */
.pn-field-group:focus-within {
  border-color: var(--pn-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(5, 129, 181, 0.18);
}
.pn-field-group:focus-within .pn-field-group__icon { color: var(--pn-primary); }
/* Dentro del grupo, el control no dibuja su propio outline (lo hace el grupo) */
.pn-field-group > :focus-visible { outline: 0; }

/* Foco visible accesible (controles sueltos). Offset pequeño y radio acorde. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--pn-primary);
  outline-offset: 1px;
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Cards / superficies genéricas
   -------------------------------------------------------------------------- */
.pn-card {
  background: #fff;
  border: 1px solid var(--pn-line);
  border-radius: 16px;
  padding: clamp(16px, 3cqw, 22px);
}
.pn-surface-card {
  border: 1px solid var(--pn-line);
  border-radius: 14px;
  background: #fff;
  padding: 16px 18px;
}

/* Grids auto-fill reutilizables */
.pn-grid { display: grid; gap: 10px; }
.pn-grid--cats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); }
.pn-grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 318px), 1fr)); gap: 12px; }
.pn-grid--plans { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }

/* Logo/avatar de empresa */
.pn-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  grid-area: 1 / 1;      /* llena la celda del grid aunque haya place-items:center */
  align-self: stretch;
  justify-self: stretch;
}
.pn-logo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--pn-font-head);
  font-weight: 700;
  color: var(--pn-primary);
  background: var(--pn-accent);
}

/* Distintivo "Destacada" */
.pn-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--pn-accent);
  font-size: 11px;
  font-weight: 600;
  color: var(--pn-primary-dark);
}
/* Distintivo Premium: tono dorado, para diferenciarlo del azul de "Destacada". */
.pn-badge--premium {
  background: #fbf0d6;
  color: #8a5a12;
}

/* Distintivo Premium de la ficha: pill dorado compacto que NO se estira aunque
   viva en una columna flex (align-self). Borde y degradado sutil para que se
   lea como sello de calidad sin ocupar todo el ancho. */
.pn-premium-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  border-radius: 99px;
  background: linear-gradient(180deg, #fcf3dc, #f6e6bd);
  border: 1px solid #e8d191;
  color: #8a5a12;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(138, 90, 18, .12);
}
.pn-premium-pill svg { color: #c8992f; flex: none; }

/* Marco del logo en la ficha: blanco por defecto; dorado para Premium (a juego
   con el distintivo), reforzando el sello de calidad. */
.pn-ficha-logo { border: 4px solid #fff; }
.pn-ficha-logo--premium {
  border: 3px solid #e3b84e;
  box-shadow: 0 10px 30px -14px rgba(21, 32, 43, .5),
              0 0 0 1px rgba(200, 153, 47, .5);
}

/* Fondo de partículas conectadas (canvas) para la cabecera Premium. Discreto,
   detrás del contenido. Se dibuja con partliculas.js; respeta reduced-motion. */
.pn-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .pn-particles { display: none; }
}

/* Sugerencias de empresas Premium (en fichas no Premium): gancho comercial. */
.pn-suggest { border: 1px solid #ecdcae; background: linear-gradient(180deg, #fffdf8, #fdf6e7); }
.pn-suggest__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  font-family: var(--pn-font-head);
  font-weight: 700;
  font-size: 14px;
  color: #8a5a12;
  text-wrap: balance;
}
.pn-suggest__title svg { color: #c8992f; flex: none; }
.pn-suggest__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pn-suggest__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--pn-ink);
  transition: background-color .15s ease;
}
.pn-suggest__item:hover { background: rgba(200, 153, 47, .12); }
.pn-suggest__logo {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ecdcae;
  display: grid;
  place-items: center;
}
.pn-suggest__logo img { width: 100%; height: 100%; object-fit: cover; }
.pn-suggest__initials { font-family: var(--pn-font-head); font-weight: 700; font-size: 13px; color: #8a5a12; }
.pn-suggest__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pn-suggest__chev { flex: none; color: var(--pn-muted); }
@media (prefers-reduced-motion: reduce) {
  .pn-suggest__item { transition: none; }
}

/* Horario de la ficha: lista limpia día a día, con el día de hoy resaltado. */
.pn-hours-list { margin: 0; display: flex; flex-direction: column; }
.pn-hours-list__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13.5px;
  border-top: 1px solid var(--pn-line);
}
.pn-hours-list__row:first-child { border-top: 0; }
.pn-hours-list__row dt { color: var(--pn-body); display: flex; align-items: center; gap: 7px; }
.pn-hours-list__row dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--pn-ink);
  white-space: nowrap;
}
.pn-hours-list__row dd.is-closed { color: var(--pn-muted); }
/* Día de hoy: pill discreto + texto en negrita para localizarlo de un vistazo. */
.pn-hours-list__row.is-today {
  margin: 0 -10px;
  padding: 7px 10px;
  border-top: 0;
  background: var(--pn-accent);
  border-radius: 10px;
}
.pn-hours-list__row.is-today + .pn-hours-list__row { border-top: 0; }
.pn-hours-list__row.is-today dt,
.pn-hours-list__row.is-today dd { color: var(--pn-primary-dark); font-weight: 600; }
.pn-hours-list__today {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--pn-primary);
  color: #fff;
  border-radius: 99px;
  padding: 1px 7px;
}

/* --------------------------------------------------------------------------
   Editor de horario compacto (Mi cuenta)
   -------------------------------------------------------------------------- */
.pn-hours { display: flex; flex-direction: column; }
.pn-day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  min-height: 46px;
  flex-wrap: wrap;
}
.pn-day-row + .pn-day-row { border-top: 1px solid var(--pn-line); }
.pn-day-row__name {
  flex: 0 0 78px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pn-ink);
}
.pn-day-row__slots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Control segmentado (Cerrado / 24 h / Horario) */
.pn-seg {
  display: inline-flex;
  flex: none;
  padding: 3px;
  border-radius: 10px;
  background: var(--pn-field);
  border: 1px solid var(--pn-line-strong);
}
.pn-seg__btn {
  border: 0;
  background: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pn-body);
  min-height: 34px;
  transition: background-color 0.12s, color 0.12s;
}
.pn-seg__btn:hover { color: var(--pn-primary); }
.pn-seg__btn.is-on { background: #fff; color: var(--pn-primary-dark); box-shadow: 0 1px 2px rgba(21,32,43,.12); }

/* Tramos horarios */
.pn-slot { display: inline-flex; align-items: center; gap: 6px; }
.pn-slot__sep { color: var(--pn-muted); }
.pn-slot__and { color: var(--pn-muted); font-size: 12px; margin-right: 2px; }
.pn-time {
  border: 1px solid var(--pn-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--pn-ink);
  padding: 7px 9px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.pn-time:focus { border-color: var(--pn-primary); outline: 0; }
.pn-slot__x {
  border: 0;
  background: none;
  color: var(--pn-muted);
  font-size: 18px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.pn-slot__x:hover { color: #b4453a; background: #fdf4f3; }

/* Botón-enlace discreto (atajos, + tramo) */
.pn-linkbtn {
  border: 0;
  background: none;
  padding: 4px 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pn-primary-dark);
  min-height: 32px;
}
.pn-linkbtn:hover { color: var(--pn-primary); text-decoration: underline; }

/* En contenedor estrecho, los controles caen bajo el nombre del día */
@container (max-width: 560px) {
  .pn-day-row__name { flex: 0 0 100%; }
}

/* Etiqueta "Premium" pequeña para secciones bloqueadas en Mi cuenta */
.pn-lock-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: #fbf0d6;
  color: #8a5a12;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Tarjeta de empresa del directorio: acento visual según plan.
   - base (gratuita): borde neutro.
   - .is-premium: borde con tinte de marca + sombra algo más presente.
   - .is-featured: acento dorado y barra superior, la más destacada. */
.pn-card-company {
  border: 1px solid #edf1f4;
  box-shadow: 0 1px 2px rgba(21, 32, 43, 0.04), 0 14px 30px -22px rgba(21, 32, 43, 0.35);
}
.pn-card-company.is-premium {
  border-color: #bfe0ef;
  box-shadow: 0 1px 2px rgba(21, 32, 43, 0.04), 0 16px 34px -20px rgba(5, 129, 181, 0.35);
}
.pn-card-company.is-featured {
  border-color: #ead9ac;
  box-shadow: 0 1px 2px rgba(21, 32, 43, 0.04), 0 16px 34px -18px rgba(180, 140, 40, 0.4);
}
/* Barra superior sutil en las destacadas (refuerza el addon de portada). */
.pn-card-company.is-featured {
  position: relative;
  overflow: hidden;
}
.pn-card-company.is-featured::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #e9c877, #caa23f);
}
.pn-cat-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pn-muted);
}

/* Pestañas verticales de categorías (directorio) */
.pn-vtab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--pn-body);
}
.pn-vtab:hover { background: #f1f5f8; color: var(--pn-primary); }
.pn-vtab.is-active {
  background: var(--pn-accent);
  color: var(--pn-primary-dark);
  font-weight: 600;
}
.pn-vtab__count {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--pn-muted);
  font-variant-numeric: tabular-nums;
}
.pn-vtab.is-active .pn-vtab__count { color: var(--pn-primary-dark); }
/* En pantallas estrechas la navegación vertical pasa a ocupar todo el ancho */
@container (max-width: 719px) {
  .pn-vtab { min-height: 44px; }
}

/* Scrollbar discreta para la lista de categorías (Firefox + WebKit/Blink) */
.pn-vtabs {
  scrollbar-width: thin;
  scrollbar-color: var(--pn-line-strong) transparent;
}
.pn-vtabs::-webkit-scrollbar { width: 8px; }
.pn-vtabs::-webkit-scrollbar-track { background: transparent; }
.pn-vtabs::-webkit-scrollbar-thumb {
  background: #d3dbe1;
  border-radius: 99px;
  border: 2px solid #fff;
}
.pn-vtabs::-webkit-scrollbar-thumb:hover { background: var(--pn-primary); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.pn-footer {
  background: var(--pn-surface);
  border-top: 1px solid var(--pn-line);
  padding: clamp(24px, 4cqw, 40px) var(--pn-pad) clamp(18px, 3cqw, 28px);
  margin-top: auto;
}
.pn-social {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--pn-line-strong);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--pn-body);
}
.pn-social:hover { border-color: var(--pn-primary); color: var(--pn-primary); }

/* --------------------------------------------------------------------------
   Bottom nav (solo contenedor estrecho)
   -------------------------------------------------------------------------- */
.pn-bottomnav {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--pn-line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.pn-bottomnav__item {
  flex: 1;
  min-height: 52px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--pn-muted);
  font-size: 11px;
  font-weight: 600;
}
.pn-bottomnav__item[aria-current="page"] { color: var(--pn-primary); }

/* --------------------------------------------------------------------------
   Skeletons (carga de búsqueda)
   -------------------------------------------------------------------------- */
.skeleton { position: relative; overflow: hidden; background: #e9edf1; border-radius: 8px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
  animation: pn-shimmer 1.2s infinite;
}
@keyframes pn-shimmer { 100% { transform: translateX(100%); } }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: grid; }
.htmx-request #search-results { opacity: 0.35; transition: opacity 0.15s linear; }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
  * { transition-duration: 0.001ms !important; }
}

[x-cloak] { display: none !important; }

/* --------------------------------------------------------------------------
   Tarjeta con efecto flip 3D (acceso / recuperar contraseña)
   -------------------------------------------------------------------------- */
/* La columna del flip se estira a la altura de la fila (flex del padre) y el
   inner ocupa todo el alto, de modo que ambas caras miden lo mismo que la
   tarjeta más alta de al lado. */
.pn-flip { perspective: 1400px; display: flex; }
.pn-flip__inner {
  position: relative;
  flex: 1;
  min-height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.pn-flip.is-flipped .pn-flip__inner { transform: rotateY(180deg); }
.pn-flip__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.pn-flip__face--back { transform: rotateY(180deg); }
.pn-flip.is-flipped .pn-flip__face--front,
.pn-flip:not(.is-flipped) .pn-flip__face--back { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .pn-flip__inner { transition: none; }
}

/* --------------------------------------------------------------------------
   Popup del mapa (InfoWindow de Google): domar estilos por defecto
   -------------------------------------------------------------------------- */
/* Quitar el padding interno del InfoWindow (dejamos que mida su contenido) */
.gm-style-iw.gm-style-iw-c {
  padding: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 30px -8px rgba(21, 32, 43, 0.35) !important;
  max-height: none !important;
  max-width: none !important;
}
.gm-style-iw-d {
  overflow: visible !important;
  padding: 0 !important;
  max-height: none !important;
}
/* Barra superior de la cruz: superponer sobre la tarjeta sin reservar alto */
.gm-style-iw-chr {
  position: absolute;
  top: 0;
  right: 0;
  height: 0;
  min-height: 0 !important;
  z-index: 2;
}
.gm-style-iw-ch { padding: 0 !important; height: 0 !important; }
/* Botón de cerrar: más pequeño y sobre la tarjeta */
.gm-style-iw button.gm-ui-hover-effect {
  width: 30px !important;
  height: 30px !important;
  top: 4px !important;
  right: 4px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  border-radius: 50% !important;
  opacity: 1;
}
.gm-style-iw button.gm-ui-hover-effect > span {
  width: 16px !important;
  height: 16px !important;
  margin: 7px !important;
}

/* Tarjeta de contenido del popup */
.pn-pop {
  width: 236px;
  font-family: var(--pn-font-body), system-ui, sans-serif;
  border-radius: 16px;
  overflow: hidden;
}
/* La banda del logo hereda el redondeo superior de la tarjeta */
.pn-pop__media { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.pn-pop__media {
  height: 108px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid var(--pn-line);
  overflow: hidden;
}
/* Logo CONTENIDO: se limita a la caja disponible y nunca se recorta */
.pn-pop__media img {
  display: block;
  max-width: 100%;
  max-height: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Fallback sin imagen: iniciales sobre fondo distintivo a todo el ancho */
.pn-pop__media--empty { background: var(--pn-accent); }
.pn-pop__initials {
  font-family: var(--pn-font-head);
  font-weight: 700;
  font-size: 36px;
  color: var(--pn-primary);
}
.pn-pop__body { padding: 12px 14px 18px; }
.pn-pop__media--empty { padding: 0; }
.pn-pop__cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pn-muted);
}
.pn-pop__name {
  margin: 3px 0 12px;
  font-family: var(--pn-font-head);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  color: var(--pn-ink);
}
.pn-pop__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border-radius: 10px;
  background: var(--pn-primary);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
}
.pn-pop__btn:hover { background: var(--pn-primary-dark); }

/* Pin de logotipo para empresas Premium en el mapa (OverlayView HTML).
   Burbuja redonda con el logo dentro + punta inferior, como un marcador real.
   El punto de anclaje (la punta) apunta a la coordenada. */
.pn-map-pin {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -100%);   /* ancla en la punta inferior */
  cursor: pointer;
  filter: drop-shadow(0 3px 4px rgba(20, 28, 36, .35));
}
.pn-map-pin__bubble {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2.5px solid #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 28, 36, .12);
}
.pn-map-pin__bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Punta del pin: triángulo blanco bajo la burbuja. */
.pn-map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 3px 0;
  box-shadow: 2px 2px 0 -1px rgba(20, 28, 36, .06);
  z-index: -1;
}
.pn-map-pin:hover { z-index: 10000; }

/* --------------------------------------------------------------------------
   Gestor de galería y documentos (Mi cuenta)
   -------------------------------------------------------------------------- */
.pn-media-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.pn-media-head__title {
  margin: 0;
  font-family: var(--pn-font-head);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--pn-ink);
}
.pn-media-head__count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pn-muted);
  font-variant-numeric: tabular-nums;
  background: var(--pn-surface);
  border-radius: 99px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pn-media-empty {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--pn-muted);
  line-height: 1.55;
}

/* Rejilla de miniaturas */
.pn-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.pn-thumb {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--pn-line);
  background: var(--pn-surface);
}
.pn-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pn-thumb__del { position: absolute; top: 6px; right: 6px; margin: 0; }
.pn-thumb__delbtn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: rgba(20, 28, 36, .68);
  color: #fff;
  cursor: pointer;
  opacity: .92;                 /* siempre visible (también en móvil) */
  transition: opacity .15s ease, background-color .15s ease;
}
.pn-thumb:hover .pn-thumb__delbtn,
.pn-thumb:focus-within .pn-thumb__delbtn { opacity: 1; }
.pn-thumb__delbtn:hover { background: #b4453a; }
.pn-thumb__delbtn:focus-visible {
  opacity: 1;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Dropzone para añadir imagen (encaja como una celda más de la rejilla) */
.pn-dropzone {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  min-height: 110px;
}
.pn-dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.pn-dropzone__input:disabled { cursor: not-allowed; }
.pn-dropzone__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 100%;
  padding: 10px;
  text-align: center;
  border: 1.5px dashed #b9c6d0;
  border-radius: 12px;
  background: var(--pn-surface);
  color: var(--pn-primary-dark);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.pn-dropzone:hover .pn-dropzone__label,
.pn-dropzone__input:focus-visible + .pn-dropzone__label {
  border-color: var(--pn-primary);
  background: #eef6fb;
}
.pn-dropzone__text { font-size: 13px; font-weight: 600; }
.pn-dropzone__hint {
  font-size: 11px;
  color: var(--pn-muted);
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.pn-dropzone__go {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 34px;
  padding: 0 10px;
}

/* Lista de documentos */
.pn-doclist { display: flex; flex-direction: column; gap: 8px; }
.pn-docrow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--pn-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pn-docrow:hover {
  border-color: #cdd8e0;
  box-shadow: 0 1px 4px rgba(20, 28, 36, .06);
}
.pn-docrow__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #eef6fb;
  color: var(--pn-primary-dark);
}
.pn-docrow__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--pn-ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pn-docrow__name:hover { color: var(--pn-primary); text-decoration: underline; }
.pn-docrow__del { margin: 0; flex: none; }

/* Botón "Subir documento": file picker con estilo + nombre + nombre visible */
.pn-docupload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--pn-line);
}
.pn-docupload__file { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.pn-docupload__pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  cursor: pointer;
  flex: none;
}
.pn-docupload__input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.pn-docupload__input:focus-visible + .pn-docupload__fname { text-decoration: underline; }
.pn-docupload__fname {
  font-size: 12.5px;
  color: var(--pn-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pn-docupload__name { flex: 1 1 180px; min-width: 140px; }

/* Botón de acción destructiva suave (Eliminar documento) */
.pn-btn--danger-soft {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #f0c2bd;
  background: #fdf4f3;
  color: #b4453a;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.pn-btn--danger-soft:hover { background: #fbe7e4; border-color: #e6a9a2; }
.pn-btn--danger-soft:disabled { opacity: .5; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .pn-thumb__delbtn,
  .pn-dropzone__label,
  .pn-docrow,
  .pn-btn--danger-soft { transition: none; }
}

/* --------------------------------------------------------------------------
   Cabecera fija de Mi cuenta (sigue visible al hacer scroll)
   -------------------------------------------------------------------------- */
/* El nav global (.pn-header) es sticky en top:0 y mide ~64px; la cabecera de
   Mi cuenta se pega justo debajo. Compensamos el padding-top del contenedor
   con margen negativo para que no quede un hueco por encima al pegarse. */
.pn-account { --pn-nav-h: 63px; }
.pn-account-header {
  position: sticky;
  top: var(--pn-nav-h);
  z-index: 15;
  margin: calc(-1 * clamp(20px, 4cqw, 40px)) calc(-1 * var(--pn-pad)) 8px;
  padding: 12px var(--pn-pad);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--pn-line);
}
@supports not (backdrop-filter: blur(1px)) {
  .pn-account-header { background: #fff; }
}
/* Durante una impersonación, acento marrón para dejar claro que el admin está
   viendo/editando la cuenta de otra persona (coincide con el banner superior). */
.pn-account-header--imp {
  border-bottom: 2px solid #8a5a12;
  box-shadow: 0 2px 0 0 rgba(138, 90, 18, .12);
}
.pn-account-header--imp .pn-eyebrow { color: #8a5a12; }

/* Miniaturas arrastrables (SortableJS) */
.pn-thumb { cursor: grab; }
.pn-thumb:active { cursor: grabbing; }
.pn-dropzone { cursor: default; }
.sortable-ghost { opacity: .4; }
.sortable-chosen { box-shadow: 0 6px 18px rgba(20, 28, 36, .18); }
.pn-gallery-grid [aria-busy="true"] { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .pn-account-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* --------------------------------------------------------------------------
   Rejilla de Mi cuenta: dos columnas (principal + lateral) y, debajo,
   galería bajo la columna principal y descripción a ancho completo.
   El <form> es display:contents, así que sus hijos (.pn-acc-main y
   .pn-acc-side) participan directamente de esta rejilla.
   -------------------------------------------------------------------------- */
/* Dos columnas de ALTURA INDEPENDIENTE (no un grid por filas, que dejaba
   huecos). Cada columna es un contenedor flex que apila sus tarjetas pegadas:
   - Izquierda (.pn-acc-left): ficha (Mi usuario + Datos del sitio) + galería.
   - Derecha (.pn-acc-right): aside (redes/horario/SEO/actividad/suscripción)
     + descripción, justo debajo sin dejar espacio. */
.pn-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: clamp(14px, 2.5cqw, 22px);
  margin-top: clamp(18px, 3cqw, 28px);
  align-items: start;
}
.pn-acc-left,
.pn-acc-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2cqw, 18px);
}

/* En estrecho: una sola columna. */
@container (max-width: 720px) {
  .pn-account-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Comparativa de planes (página de servicios): Gratuita vs Premium
   -------------------------------------------------------------------------- */
.pn-compare {
  margin-top: clamp(16px, 3cqw, 24px);
  border: 1px solid var(--pn-line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.pn-compare__head,
.pn-compare__row {
  display: grid;
  grid-template-columns: 1fr 96px 96px;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}
.pn-compare__head {
  background: var(--pn-surface);
  border-bottom: 1px solid var(--pn-line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pn-body);
}
.pn-compare__head span:not(:first-child) { text-align: center; }
.pn-compare__row { border-top: 1px solid var(--pn-line); font-size: 14px; }
.pn-compare__row:first-of-type { border-top: 0; }
.pn-compare__label { color: var(--pn-body); line-height: 1.4; }
.pn-compare__cell { display: grid; place-items: center; }
.pn-compare__no { color: var(--pn-line-strong, #c7d0d8); font-weight: 700; }
/* Columna Premium resaltada en dorado a lo largo de toda la tabla. */
.pn-compare__prem {
  background: linear-gradient(180deg, #fffaf0, #fdf4e2);
  color: #8a5a12;
}
.pn-compare__head .pn-compare__prem { border-radius: 8px 8px 0 0; }

@container (max-width: 560px) {
  .pn-compare__head,
  .pn-compare__row { grid-template-columns: 1fr 64px 64px; padding: 11px 12px; }
  .pn-compare__label { font-size: 13px; }
}
