/* ============================================================
   Mapa, filtro, barra inferior y hoja de perfil
   ============================================================ */
.map-app { position: fixed; inset: 0; overflow: hidden; }
.map-wrap { position: relative; flex: 1; }
#map { position: absolute; inset: 0; z-index: 1; }

/* Aviso amable (ubicación, etc.) */
.map-toast {
  position: absolute; top: 70px; left: 12px; right: 12px; z-index: 600;
  max-width: 440px; margin: 0 auto;
  background: rgba(15,15,15,.94); color: #fff;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: .85rem 1.1rem; border-radius: 14px; font-size: .86rem; line-height: 1.4;
  text-align: center; box-shadow: 0 12px 34px rgba(0,0,0,.32);
  opacity: 0; transform: translateY(-12px); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.map-toast.show { opacity: 1; transform: none; }

/* Banner superior (clickeable: abre la lista de cercanos) */
.map-banner {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 400;
  max-width: 456px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  background: var(--white); border: none; border-radius: 999px; padding: .8rem 1.25rem;
  box-shadow: 0 6px 22px rgba(0,0,0,.12);
  color: var(--ink); cursor: pointer;
  font-weight: 300; font-size: .88rem; letter-spacing: .005em; line-height: 1;
  transition: box-shadow .25s ease, transform .15s ease;
  animation: bannerPulse 3s ease-in-out infinite;
}
.map-banner:hover { box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.map-banner:active { transform: scale(.98); }
.map-banner__pin { width: 17px; height: 17px; flex: 0 0 auto; animation: pinBob 3s ease-in-out infinite; }
.map-banner__text { font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-banner__chev { width: 15px; height: 15px; flex: 0 0 auto; opacity: .45; }
@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,.12); }
  50% { box-shadow: 0 11px 34px rgba(0,0,0,.22); }
}
@keyframes pinBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Filtro de zona + botón ubicación */
.map-filter {
  position: absolute; left: 12px; right: 12px; z-index: 400;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 56px);   /* por encima del menú inferior */
  display: flex; gap: .6rem;
}
.map-filter__select {
  flex: 1; appearance: none; background: var(--white); border: none; border-radius: 999px;
  padding: .85rem 1.3rem; font-size: .9rem; font-weight: 300; letter-spacing: .005em;
  box-shadow: 0 6px 22px rgba(0,0,0,.12); color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8a8a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1.1rem center;
}
.map-filter__locate {
  width: 48px; height: 48px; border-radius: 50%; background: var(--white);
  box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); flex: 0 0 auto;
}

/* Marcadores personalizados (pin) */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2px solid var(--white);
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.pin--presencial { background: var(--presencial); }
.pin--domicilio  { background: var(--domicilio); }
.pin__inner { width: 8px; height: 8px; background: var(--white); border-radius: 50%; margin: 9px auto 0; }

/* Punto de ubicación del usuario */
.user-dot {
  width: 16px; height: 16px; background: #2a7fff; border: 3px solid var(--white);
  border-radius: 50%; box-shadow: 0 0 0 4px rgba(42,127,255,.25);
}

/* Barra inferior */
.bottom-nav {
  display: flex; justify-content: space-around; align-items: center;
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  padding-top: 8px;
  padding-bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) - 14px));
  z-index: 450;
}
.bottom-nav__item { padding: 4px 10px; color: var(--gray-500); }
.bottom-nav__item svg { width: 26px; height: 26px; }
.bottom-nav__item.is-active { color: var(--domicilio); }
.map-body[data-mode="presencial"] .bottom-nav__item.is-active { color: var(--black); }

/* ---------- Hoja de perfil (bottom sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 900;
  opacity: 1; transition: opacity .45s ease;
}
/* display:block !important vence al global .hidden{display:none} para poder animar */
.sheet-backdrop.hidden { display: block !important; opacity: 0; pointer-events: none; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  max-width: 480px; margin: 0 auto;
  background: var(--white); border-radius: 22px 22px 0 0;
  max-height: 88dvh; display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  transform: translateY(0); will-change: transform; backface-visibility: hidden;
  transition: transform .75s cubic-bezier(.16, 1, .3, 1);
}
/* Entrada elegante: se desliza desde abajo (no salto seco).
   display:flex !important vence al global .hidden{display:none} para que SÍ anime. */
.sheet.hidden { display: flex !important; transform: translateY(100%); pointer-events: none; }
.sheet__handle { width: 44px; height: 5px; border-radius: 999px; background: var(--gray-300); margin: 10px auto 4px; flex: 0 0 auto; }
.sheet__close {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%; background: var(--gray-100);
  display: grid; place-items: center; color: var(--gray-700);
}
.sheet__close:active { background: var(--gray-300); }
.sheet__content { overflow-y: auto; padding: 0 1.25rem calc(1.5rem + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }

/* ---------- Contenido del perfil ---------- */
.profile__head { display: flex; gap: 1rem; align-items: center; padding: .3rem 0 1.1rem; }
.profile__avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: var(--gray-100); box-shadow: 0 3px 14px rgba(0,0,0,.12);
  display: grid; place-items: center; color: var(--gray-500); font-size: 1.6rem; font-weight: 500;
}
.profile__headinfo { min-width: 0; }
.profile__name { font-size: 1.3rem; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.profile__tagline { color: var(--gray-500); font-size: .9rem; font-weight: 300; margin-top: .2rem; }
.profile__rating { margin-top: .4rem; font-size: .9rem; font-weight: 300; }
.profile__rating .star { color: var(--star); }

.profile__about { font-size: .96rem; font-weight: 300; line-height: 1.55; color: var(--gray-700); margin: .2rem 0 .9rem; }
.profile__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.4rem; }
.chip { background: var(--gray-100); color: var(--gray-700); font-size: .76rem; font-weight: 400;
  padding: .4rem .8rem; border-radius: 999px; }

/* "Cómo llegar" — apps de mapas (solo presenciales) */
.nav-apps { margin: -.1rem 0 1.4rem; }
.nav-apps__title { display: block; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gray-500); font-weight: 500; margin-bottom: .65rem; }
.nav-apps__row { display: flex; gap: 1.4rem; }
.nav-app { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; }
.nav-app__ic {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--gray-100); box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: transform .18s ease;
}
.nav-app__ic svg { width: 28px; height: 28px; }
.nav-app--waze .nav-app__ic { background: #33CCFF; border-color: transparent; }
/* Apple Maps y Google Maps: íconos a color que llenan el círculo */
.nav-app--apple .nav-app__ic { overflow: hidden; padding: 0; border-color: transparent; }
.nav-app--apple .nav-app__ic svg { width: 100%; height: 100%; }
.nav-app--gmaps .nav-app__ic { overflow: hidden; padding: 7px; }
.nav-app--gmaps .nav-app__ic svg { width: 100%; height: 100%; }
.nav-app:hover .nav-app__ic { transform: translateY(-3px); }
.nav-app:active .nav-app__ic { transform: scale(.92); }
.nav-app__lbl { font-size: .68rem; font-weight: 300; color: var(--gray-700); }

/* Redes sociales — abajo, con su título */
.social-foot { border-top: 1px solid var(--gray-100); padding-top: 1.2rem; margin-top: .3rem; }
.social-foot__title { display: block; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gray-500); font-weight: 500; margin-bottom: .8rem; }

/* Redes sociales — pequeñas, en una sola línea */
.social-row { display: flex; gap: .85rem; justify-content: center; margin-bottom: 1.5rem; }
.social-ic {
  width: 50px; height: 50px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.social-ic svg { width: 24px; height: 24px; }
.social-ic:hover { transform: translateY(-3px); }
.social-ic:active { transform: scale(.92); }
.social-ic--instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.social-ic--facebook { background: #1877F2; }
.social-ic--tiktok { background: #111; }
.social-ic--whatsapp { background: #25D366; }

/* Secciones colapsables (acordeón con animación elegante) */
.acc { border-top: 1px solid var(--gray-100); }
.acc__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 1.05rem 0; font-size: 1.02rem; font-weight: 500; letter-spacing: .01em; color: var(--ink);
}
.acc__head .chev { transition: transform .35s cubic-bezier(.16,1,.3,1); color: var(--gray-500); }
.acc.open .acc__head .chev { transform: rotate(180deg); }
.acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s cubic-bezier(.16,1,.3,1); }
.acc.open .acc__body { grid-template-rows: 1fr; }
.acc__inner { overflow: hidden; }
.acc.open .acc__inner { padding-bottom: 1.1rem; }

/* Servicios */
.svc-item { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--gray-300); }
.svc-item__name { font-weight: 500; }
.svc-item__desc { font-size: .82rem; font-weight: 300; color: var(--gray-500); margin-top: .1rem; }
.svc-item__price { font-weight: 600; white-space: nowrap; }

/* Reseñas — marquee horizontal que va pasando */
.rev-marquee { overflow: hidden; margin: .2rem -1.25rem 0; }
.rev-track { display: flex; gap: .8rem; width: max-content; padding: .3rem 1.25rem;
  animation: revScroll linear infinite; }
.rev-marquee:hover .rev-track, .rev-marquee:active .rev-track { animation-play-state: paused; }
.rev-card {
  flex: 0 0 230px; background: var(--gray-100); border-radius: 14px; padding: .85rem 1rem;
}
.rev-card__top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.rev-card__name { font-weight: 500; font-size: .9rem; }
.rev-card__comment { font-size: .84rem; font-weight: 300; color: var(--gray-700); line-height: 1.4; margin-top: .4rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes revScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Certificados */
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.cert-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line, #e7e7e7); border-radius: 14px; background: #fff; cursor: pointer; overflow: hidden; font-family: inherit; transition: border-color .15s, transform .12s; }
.cert-card:hover { border-color: #cfcfcf; }
.cert-card:active { transform: scale(.985); }
.cert-card__thumb { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; background: #f3f3f3; overflow: hidden; color: #c4c4c4; }
.cert-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cert-card__thumb svg { width: 34px; height: 34px; }
.cert-card__info { display: flex; flex-direction: column; gap: .12rem; padding: .55rem .7rem .7rem; }
.cert-card__title { font-size: .9rem; font-weight: 500; color: var(--ink, #111); line-height: 1.25; }
.cert-card__view { margin-top: .25rem; font-size: .7rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--gray-500, #888); }
.cert-badge { font-size: .8rem; font-weight: 300; color: var(--gray-500); }
.muted { font-weight: 300; }

/* Lightbox del certificado */
.cert-lb { position: fixed; inset: 0; z-index: 9000; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(10,10,10,.92); }
.cert-lb.open { display: flex; animation: certFade .2s ease; }
@keyframes certFade { from { opacity: 0 } to { opacity: 1 } }
.cert-lb__fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cert-lb__fig img { max-width: 100%; max-height: 82vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); object-fit: contain; }
.cert-lb__fig figcaption { color: #fff; font-size: .95rem; text-align: center; }
.cert-lb__close { position: absolute; top: 16px; right: 18px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.cert-lb__close:hover { background: rgba(255,255,255,.25); }

.profile__loading { text-align: center; padding: 3rem 0; font-weight: 300; color: var(--gray-500); }

/* ---------- Centro de notificaciones (campanita) ---------- */
.topbar__user { position: relative; }
.notif-dot {
  position: absolute; top: 5px; right: 5px; width: 9px; height: 9px;
  background: var(--domicilio); border-radius: 50%; border: 2px solid var(--white);
}
.notif-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.25); }
.notif-backdrop.hidden { display: none; }
.notif-panel {
  position: fixed; top: 58px; left: 10px; right: 10px; z-index: 950;
  max-width: 380px; margin-left: auto;
  background: var(--white); border-radius: 16px; box-shadow: 0 14px 44px rgba(0,0,0,.24);
  max-height: 72dvh; display: flex; flex-direction: column; overflow: hidden;
}
.notif-panel.hidden { display: none; }
.notif-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-weight: 700;
}
.notif-panel__close { width: 30px; height: 30px; border-radius: 50%; background: var(--gray-100); display: grid; place-items: center; color: var(--gray-700); }
.notif-panel__list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.notif-item.is-unread { background: #fbf6ec; }
.notif-item__title { font-weight: 600; font-size: .95rem; }
.notif-item__body { font-size: .88rem; color: var(--gray-700); margin-top: 3px; line-height: 1.35; }
.notif-item__time { font-size: .72rem; color: var(--gray-500); margin-top: 5px; }
.notif-empty { padding: 2.5rem 1rem; text-align: center; color: var(--gray-500); font-size: .9rem; }

/* Estrellas con relleno proporcional al puntaje */
.rating5 { position: relative; display: inline-block; vertical-align: middle; white-space: nowrap; line-height: 1; }
.rating5__bg { color: var(--gray-300); }
.rating5__fill { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: #F5B301; }

/* ---------- Lista "Cerca de ti" ---------- */
.near__head { padding: .25rem 0 1.1rem; }
.near__eyebrow { display: block; font-size: .62rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gray-500); font-weight: 500; margin-bottom: .35rem; }
.near__title { display: block; font-size: 1.6rem; font-weight: 300; letter-spacing: -.01em; color: var(--ink); }
.near__list { display: flex; flex-direction: column; }
.near-item {
  display: flex; align-items: center; gap: .85rem;
  width: 100%; text-align: left; padding: .7rem .25rem; border-bottom: 1px solid var(--gray-100);
  background: none; cursor: pointer;
  animation: nearItemIn .55s cubic-bezier(.16, 1, .3, 1) both;
}
.near-item:active { background: var(--gray-100); }
.near-item__thumb {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px; overflow: hidden;
  background: var(--gray-100); display: grid; place-items: center;
  color: var(--gray-500); font-weight: 500; font-size: 1.2rem;
}
.near-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.near-item__main { flex: 1; min-width: 0; }
.near-item__name { display: block; font-weight: 500; font-size: .96rem; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-item__sub { display: block; font-weight: 300; font-size: .8rem; color: var(--gray-500); margin-top: .15rem; }
.near-item__dist {
  flex: 0 0 auto; font-weight: 500; font-size: .82rem; color: var(--ink);
  background: var(--gray-100); padding: .34rem .65rem; border-radius: 999px; white-space: nowrap;
}
.near-empty { padding: 2.5rem 1rem; text-align: center; color: var(--gray-500); font-size: .92rem; }
@keyframes nearItemIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.notif-panel__foot { padding: 12px 16px; border-top: 1px solid var(--gray-100); }
.notif-panel__foot .btn { padding: .7rem 1rem; font-size: .92rem; }

/* ============================================================
   DESKTOP / TABLET ANCHO — el mapa usa todo el ancho,
   la barra inferior pasa a riel lateral y el perfil a panel derecho.
   ============================================================ */
@media (min-width: 1024px) {
  .map-app {
    max-width: none;
    display: grid;
    grid-template-columns: 84px 1fr;
    grid-template-rows: auto 1fr;
    height: 100dvh;
  }
  .map-app .topbar { grid-column: 1 / -1; position: static; padding: 1rem 1.5rem; }
  .map-app .topbar__logo { height: 34px; }

  /* Barra inferior -> riel vertical a la izquierda */
  .map-app .bottom-nav {
    grid-column: 1; grid-row: 2;
    position: static; left: auto; right: auto; bottom: auto;
    max-width: none; margin: 0; height: auto;
    border-radius: 0; border: none; box-shadow: none;
    background: var(--white); -webkit-backdrop-filter: none; backdrop-filter: none;
    flex-direction: column; justify-content: flex-start; gap: .4rem;
    padding: 1.2rem 0; border-right: 1px solid var(--gray-100);
  }
  .map-app .map-filter { bottom: 24px; }
  .map-app .bottom-nav__item { padding: .7rem; border-radius: 12px; }
  .map-app .bottom-nav__item:hover { background: var(--gray-100); }

  .map-app .map-wrap { grid-column: 2; grid-row: 2; }

  /* Banner y filtro centrados dentro del área del mapa (left/right + margin auto) */
  .map-app .map-banner { left: 16px; right: 16px; transform: none; max-width: 520px; margin: 0 auto; }
  .map-app .map-filter { left: 16px; right: 16px; transform: none; max-width: 560px; margin: 0 auto; bottom: 24px; }

  /* Perfil como panel lateral derecho (no hoja inferior) */
  .map-app .sheet {
    left: auto; right: 0; top: 0; bottom: 0; margin: 0;
    width: 420px; max-width: 420px; max-height: none;
    border-radius: 0; box-shadow: -12px 0 40px rgba(0,0,0,.16);
    transform: translateX(0);
  }
  .map-app .sheet.hidden { transform: translateX(100%); }
  .map-app .sheet__handle { display: none; }
  .map-app .sheet__content { padding-top: 3.5rem; }
  /* En desktop no oscurecemos el mapa: el panel convive con él */
  .map-app .sheet-backdrop { display: none !important; }
}

/* Pantallas muy anchas: panel un poco más amplio */
@media (min-width: 1500px) {
  .map-app .sheet { width: 460px; max-width: 460px; }
}

/* Hover de pines solo donde hay puntero fino (desktop) */
@media (hover: hover) {
  .pin { transition: transform .12s ease; }
  .leaflet-marker-icon:hover .pin { transform: rotate(-45deg) scale(1.12); }
}
