/* ==========================================================
   IslaMarket Legal Pages
   Diseño profesional para privacidad, cookies, aviso legal y términos.
   ========================================================== */

body:is(.im-legal-page, .legal-page, .privacy-page, .cookies-page),
body:has(.im-legal-document),
body:has(.legal),
body:has(.privacy-policy),
body:has(.cookies-policy) {
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 86, 48, .08), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(15, 187, 181, .10), transparent 32%),
    #f5f6f7 !important;
  color: #101828 !important;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Fallback cuando el body no tiene clase específica pero el contenido legal sale plano */
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main:has(h1):has(h2),
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main:has(h1):has(hr) {
  width: min(100% - 32px, 1060px) !important;
  margin: 34px auto 110px !important;
  padding: 0 !important;
}

/* Shell legal visual */
.im-legal-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 86, 48, .08), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(15, 187, 181, .10), transparent 32%),
    #f5f6f7;
}

.im-legal-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 76px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(15,23,42,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.im-legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #101828;
  font-size: 16px;
  font-weight: 950;
  text-decoration: none;
}

.im-legal-brand__icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e9fbfa;
  color: #0f766e;
}

.im-legal-toplinks {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.im-legal-toplinks a {
  color: #101828;
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

.im-legal-wrap {
  width: min(100% - 32px, 1060px);
  margin: 34px auto 120px;
}

.im-legal-hero {
  margin-bottom: 22px;
  padding: 34px 34px 30px;
  border: 1px solid rgba(255, 86, 48, .18);
  border-radius: 28px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 24px 60px rgba(15,23,42,.07);
}

.im-legal-kicker {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 86, 48, .10);
  color: #ff5630;
  font-size: 13px;
  font-weight: 950;
}

.im-legal-hero h1 {
  margin: 0 0 14px;
  color: #070b1a;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .94;
  letter-spacing: -.065em;
  font-weight: 950;
}

.im-legal-hero p {
  max-width: 760px;
  margin: 0;
  color: #344054;
  font-size: 18px;
  line-height: 1.65;
  font-weight: 550;
}

.im-legal-card,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main:has(h1):has(h2) {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  border-radius: 28px !important;
  box-shadow: 0 24px 60px rgba(15,23,42,.07) !important;
  padding: 34px !important;
}

.im-legal-card h1,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main h1 {
  margin: 0 0 18px !important;
  color: #070b1a !important;
  font-size: clamp(34px, 4vw, 54px) !important;
  line-height: 1 !important;
  letter-spacing: -.045em !important;
  font-weight: 950 !important;
}

.im-legal-card h2,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main h2 {
  margin: 34px 0 14px !important;
  padding-top: 24px !important;
  border-top: 1px solid rgba(15,23,42,.10) !important;
  color: #101828 !important;
  font-size: 25px !important;
  line-height: 1.15 !important;
  font-weight: 950 !important;
  letter-spacing: -.025em !important;
}

.im-legal-card h3,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main h3 {
  margin: 24px 0 10px !important;
  color: #101828 !important;
  font-size: 20px !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
}

.im-legal-card p,
.im-legal-card li,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main p,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main li {
  color: #1d2939 !important;
  font-size: 16px !important;
  line-height: 1.72 !important;
  font-weight: 520 !important;
}

.im-legal-card p,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main p {
  margin: 0 0 14px !important;
}

.im-legal-card ul,
.im-legal-card ol,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main ul,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main ol {
  margin: 10px 0 18px !important;
  padding-left: 24px !important;
}

.im-legal-card li,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main li {
  margin: 7px 0 !important;
}

.im-legal-card strong,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main strong {
  color: #101828 !important;
  font-weight: 950 !important;
}

.im-legal-card a,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main a {
  color: #0f766e !important;
  font-weight: 900 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
}

.im-legal-card hr,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main hr {
  margin: 28px 0 !important;
  border: 0 !important;
  border-top: 1px solid rgba(15,23,42,.10) !important;
}

/* Alertas tipo sesión cerrada */
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .alert,
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main [class*="alert"],
body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main [class*="flash"] {
  margin: 0 0 22px !important;
  padding: 14px 18px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(220, 38, 38, .22) !important;
  background: rgba(254, 242, 242, .95) !important;
  color: #7f1d1d !important;
  font-weight: 800 !important;
}

.im-legal-footer {
  border-top: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.96);
}

.im-legal-footer__inner {
  width: min(100% - 32px, 1060px);
  min-height: 82px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}

.im-legal-footer__links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.im-legal-footer__links a {
  color: #101828;
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

/* Footer fijo si la página legal es corta */
@media (min-width: 901px) {
  body:has(.im-legal-shell) {
    overflow: hidden !important;
  }

  .im-legal-shell {
    height: 100vh;
    display: grid;
    grid-template-rows: 76px minmax(0, 1fr) 82px;
    overflow: hidden;
  }

  .im-legal-wrap {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 42px;
  }

  .im-legal-footer {
    min-height: 82px;
  }
}

@media (max-width: 900px) {
  .im-legal-topbar {
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .im-legal-toplinks {
    gap: 14px;
  }

  .im-legal-toplinks a {
    font-size: 13px;
  }

  .im-legal-wrap {
    width: min(100% - 28px, 760px);
    margin: 20px auto 92px;
  }

  .im-legal-hero,
  .im-legal-card,
  body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main:has(h1):has(h2) {
    border-radius: 22px !important;
    padding: 24px !important;
  }

  .im-legal-hero h1,
  .im-legal-card h1,
  body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main h1 {
    font-size: clamp(34px, 11vw, 46px) !important;
  }

  .im-legal-card h2,
  body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main h2 {
    font-size: 22px !important;
  }

  .im-legal-footer__inner {
    width: min(100% - 28px, 760px);
    min-height: 78px;
    padding: 18px 0;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .im-legal-footer__links {
    justify-content: center;
  }
}


/* ==========================================================
   IslaMarket Home Hero Text Fix
   Corrige título del banner home tras CSS legal global.
   Fondo claro: texto principal oscuro y acento naranja.
   ========================================================== */

body[data-home-like="1"] :is(
  .hero h1,
  .home-hero h1,
  .im-home-hero h1,
  .im-hero h1,
  .home-banner h1,
  .hero-title,
  .home-title
) {
  color: #070b1a !important;
  text-shadow: none !important;
}

body[data-home-like="1"] :is(
  .hero h1 span,
  .home-hero h1 span,
  .im-home-hero h1 span,
  .im-hero h1 span,
  .home-banner h1 span,
  .hero-title span,
  .home-title span
).accent,
body[data-home-like="1"] :is(
  .hero h1 .accent,
  .hero h1 .orange,
  .hero h1 .highlight,
  .home-hero h1 .accent,
  .home-hero h1 .orange,
  .home-hero h1 .highlight,
  .im-home-hero h1 .accent,
  .im-home-hero h1 .orange,
  .im-home-hero h1 .highlight,
  .hero-title .accent,
  .hero-title .orange,
  .hero-title .highlight
) {
  color: #ff5630 !important;
}

body[data-home-like="1"] :is(
  .hero p,
  .home-hero p,
  .im-home-hero p,
  .im-hero p,
  .home-banner p
) {
  color: #344054 !important;
  text-shadow: none !important;
}


/* =========================================================
   ACERCA DE - contraste tarjeta oscura seguridad
   ========================================================= */
.im-about-security-text {
    color: rgba(255, 255, 255, .86) !important;
    opacity: 1 !important;
    text-shadow: none !important;
    font-weight: 600;
    line-height: 1.65;
}

.im-about-security-text strong,
.im-about-security-text b,
.im-about-security-text span,
.im-about-security-text a {
    color: #ffffff !important;
    opacity: 1 !important;
}

.im-about-security-text a {
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* =========================================================
   FIX /acerca-de · texto blanco dentro de tarjeta oscura
   Debe ir al final de legal-pages.css porque este archivo tiene
   reglas globales main h2/p/li con !important.
   ========================================================= */

html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust * {
  opacity: 1 !important;
}

html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust h1,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust h2,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust h3,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust p,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust li,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust span,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust p,
html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust li {
  color: rgba(255,255,255,.94) !important;
  -webkit-text-fill-color: rgba(255,255,255,.94) !important;
  font-weight: 650 !important;
}

html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust a {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body:not([data-home-like="1"]):not(:has(.im-help-topic-page)):not(.im-help-body):not(:has(.pm-wrap)):not([class*="pm-panel-"]) main .im-about .im-about__trust a:hover {
  color: #ff6b00 !important;
  -webkit-text-fill-color: #ff6b00 !important;
}

/* IM_TERMINOS_LEGAL_UPGRADE_V1_START */

.im-legal-terms-page .im-legal-updated {
  margin-top: 12px;
  color: rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 700;
}

.im-legal-terms-page .im-legal-notice,
.im-legal-terms-page .im-legal-final-note {
  margin: 0 0 24px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255,107,95,.24);
  background:
    radial-gradient(circle at 0% 0%, rgba(255,107,95,.12), transparent 32%),
    rgba(255,255,255,.045);
}

.im-legal-terms-page .im-legal-index {
  margin: 0 0 28px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(15,23,42,.32);
}

.im-legal-terms-page .im-legal-index strong {
  display: block;
  margin-bottom: 12px;
}

.im-legal-terms-page .im-legal-index ol {
  columns: 2;
  column-gap: 34px;
  margin: 0;
  padding-left: 20px;
}

.im-legal-terms-page .im-legal-index li {
  break-inside: avoid;
  margin: 0 0 8px;
}

.im-legal-terms-page .im-legal-index a {
  text-decoration: none;
}

.im-legal-terms-page h2 {
  scroll-margin-top: 110px;
}

.im-legal-terms-page h3 {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .im-legal-terms-page .im-legal-index ol {
    columns: 1;
  }
}

/* IM_TERMINOS_LEGAL_UPGRADE_V1_END */
