/* =========================================
   Visitia Legal (Privacidad) — CSS limpio
   (Mismo sistema que Términos)
========================================= */

:root{
  --green: #2e7a69;
  --green2:#1d7a67;
  --ink: #1f3d32;
  --text:#3f5146;
  --bg: #ffffff;
  --soft: #f3f2f0;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 18px 45px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  width: min(1150px, 92vw);
  margin: 0 auto;
}

/* Header */
.legal-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 14px 0;
}

.back-link{
  text-decoration:none;
  font-weight:900;
  color: var(--green);
  background: var(--soft);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  transition: .25s ease;
}
.back-link:hover{
  background: var(--green);
  color:#fff;
  transform: translateY(-2px);
}

.header-title{
  display:flex;
  align-items:center;
  gap:10px;
}

.pill{
  display:inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green2), #3fc7ad);
  color:#fff;
  font-weight: 900;
  letter-spacing: 1px;
  font-size: 12px;
  box-shadow: 0 12px 26px rgba(29,122,103,.25);
}

.mini-title{
  font-weight: 900;
  color: var(--ink);
  opacity: .9;
}

/* Hero */
.legal-hero{ padding: 34px 0 12px; }

.hero-card{
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow:hidden;
}
.hero-card::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(circle at top left, rgba(143,227,214,0.28), transparent 65%);
  pointer-events:none;
}
.hero-card h1{
  margin:0 0 10px;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 1000;
  color: var(--green2);
  position:relative;
}
.hero-sub{
  margin: 0;
  line-height: 1.75;
  color: #203732;
  max-width: 920px;
  position:relative;
}

.hero-meta{
  margin-top: 16px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  position:relative;
}
.chip{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

/* Layout */
.legal-main{ padding: 24px 0 70px; }

.grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items:start;
}

/* Cards */
.card{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(47,82,72,.10);
}
.card.subtle{
  background: linear-gradient(180deg, #ffffff, #f7f6f4);
}

.card-title{
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 1.2px;
  color: var(--green2);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* TOC */
.toc{
  position: sticky;
  top: 86px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.toc-links{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.toc-links a{
  text-decoration:none;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: .2s ease;
}
.toc-links a:hover{
  background: #f2f7f7;
  color: var(--green2);
}

/* Doc */
.doc{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.section{
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.section:last-child{ border-bottom:none; }

.section-pill{
  display:inline-block;
  padding: 8px 16px;
  background: var(--green);
  color: #f5f3f0;
  border-radius: 999px;
  font-weight: 1000;
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.doc h2{
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 1000;
  color: var(--ink);
}

.doc h3{
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 1000;
  color: var(--green);
}

.doc h4{
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 1000;
  color: var(--green2);
}

.doc p{
  margin: 0 0 10px;
  line-height: 1.75;
}

.muted{
  opacity: .85;
  font-style: italic;
}

/* Lists */
.list, .ol{
  margin: 10px 0 10px 20px;
  padding: 0;
  line-height: 1.75;
}
.list li, .ol li{ margin-bottom: 6px; }

/* KV */
.kv{
  display:grid;
  gap: 10px;
  margin-top: 12px;
}
.kv div{
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.kv span{
  font-weight: 1000;
  color: var(--green2);
  margin-right: 6px;
}

/* Two cols */
.two-cols{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0;
}
.mini-card{
  background: linear-gradient(180deg, #ffffff, #f3f2f0);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}
.mini-card ul{
  margin: 0 0 0 18px;
  padding: 0;
  line-height: 1.75;
}

/* End + footer */
.end{
  margin-top: 18px;
  display:flex;
  justify-content:flex-end;
}
.top-btn{
  text-decoration:none;
  font-weight: 1000;
  color: var(--green);
  background: var(--soft);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  transition: .25s ease;
}
.top-btn:hover{
  background: var(--green);
  color:#fff;
  transform: translateY(-2px);
}

.legal-footer{
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}
.legal-footer a{
  color: var(--green2);
  font-weight: 900;
  text-decoration:none;
}
.legal-footer a:hover{ text-decoration: underline; }

/* Rights - Sección 8 */
.rights-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.right-card{
  background: linear-gradient(180deg, #ffffff, #f3f2f0);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

.right-card h4{
  margin: 0 0 10px;
}

.right-card p{
  margin: 0 0 10px;
  line-height: 1.75;
}

.right-card .list{
  margin: 10px 0 10px 20px;
}

@media (max-width: 640px){
  .rights-grid{ grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 1100px){
  .grid{ grid-template-columns: 1fr; }
  .toc{ position: relative; top:0; }
}

@media (max-width: 640px){
  .hero-card{ padding: 22px; border-radius: 22px; }
  .doc{ padding: 20px; border-radius: 22px; }
  .two-cols{ grid-template-columns: 1fr; }
}
































/* =========================================================
   RESPONSIVE 95% + SAFE AREA + LANDSCAPE (PRIVACIDAD)
========================================================= */

/* 1) Anti overflow lateral (sombras + grids) */
html, body { overflow-x: hidden; }

/* 2) Safe-area iPhone notch */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Layout tuning */
  --header-h: 64px;
  --toc-top: calc(var(--header-h) + 22px + var(--safe-top));
}

/* Header: respeta notch */
.legal-header{
  padding-top: var(--safe-top);
}

/* Container: consistente en anchos raros */
.container{
  width: min(1150px, calc(100% - 2.5rem));
}

/* Grid: TOC fluido (no fuerza 360px fijo) */
.grid{
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: clamp(16px, 2vw, 22px);
}

/* TOC sticky: considera safe-area */
.toc{
  top: var(--toc-top);
}

/* Tipografía/espaciados: clamps suaves */
.hero-card{ padding: clamp(20px, 3vw, 32px); }
.doc{ padding: clamp(18px, 3vw, 28px); }

.doc h2{ font-size: clamp(20px, 2.2vw, 22px); }
.doc p{ font-size: clamp(15px, 1.2vw, 16px); }
.toc-links a{ font-size: clamp(13px, 1.1vw, 14px); }

/* Chips: tamaño consistente */
.chip{
  padding: 10px 14px;
  font-size: 14px;
}

/* Rights: mejor balance en pantallas medianas */
.rights-grid{
  gap: clamp(12px, 2vw, 14px);
}

/* =========================================================
   BREAKPOINT <= 1024px (tablet pro)
========================================================= */
@media (max-width: 1024px){
  :root{ --header-h: 60px; }

  .container{
    width: min(1150px, calc(100% - 2rem));
  }

  .grid{
    grid-template-columns: minmax(260px, 320px) 1fr;
  }

  .toc{
    top: calc(var(--header-h) + 18px + var(--safe-top));
  }
}

/* =========================================================
   BREAKPOINT <= 768px (tablet)
========================================================= */
@media (max-width: 768px){
  :root{ --header-h: 58px; }

  .header-inner{
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .mini-title{
    font-size: 14px;
  }

  .grid{
    grid-template-columns: 1fr;
  }

  /* TOC: deja de ser sticky para no robar viewport */
  .toc{
    position: relative;
    top: 0;
  }

  /* TOC links: 2 columnas en tablet */
  .toc-links{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .toc-links a{
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(0,0,0,.05);
  }
}

/* =========================================================
   BREAKPOINT <= 600px (mobile grande)
========================================================= */
@media (max-width: 600px){
  .container{
    width: calc(100% - 1.5rem);
  }

  .hero-meta{ gap: 8px; }

  .chip{
    padding: 9px 12px;
    font-size: 13px;
  }

  .toc-links{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   BREAKPOINT <= 480px (mobile)
========================================================= */
@media (max-width: 480px){
  :root{ --header-h: 56px; }

  .header-inner{ gap: 10px; }

  .hero-card{ border-radius: 22px; }
  .doc{ border-radius: 22px; }

  .doc h3{ font-size: 15px; }
  .doc h4{ font-size: 13px; }

  .list, .ol{ margin-left: 18px; }

  .footer-inner{
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================
   LANDSCAPE MOBILE (height <= 430px)
========================================================= */
@media (max-height: 430px) and (orientation: landscape){
  :root{ --header-h: 54px; }

  .header-inner{
    padding: 10px 0;
  }

  .legal-hero{
    padding: 18px 0 8px;
  }

  .hero-card{
    padding: 18px;
  }

  .legal-main{
    padding: 16px 0 40px;
  }

  /* TOC nunca sticky aquí */
  .toc{
    position: relative;
    top: 0;
  }

  .hero-meta{
    margin-top: 10px;
  }
}