/* ============================================================
   legal-utils.css — capa de utilidades para las páginas legales,
   de agradecimiento y de herramientas.
   ------------------------------------------------------------
   REQUISITO: debe cargarse DESPUÉS de styles-site.css, del que
   hereda TODOS los tokens de color y la tipografía. Este fichero
   no define ni un solo color propio: cada utilidad apunta a una
   variable del sistema, de modo que existe una única paleta en
   todo el sitio.

   Sustituye a https://cdn.tailwindcss.com (uso exclusivo de
   desarrollo según su documentación oficial) implementando solo
   las clases que estas páginas usan realmente.
   ============================================================ */

/* ---------- Reset base ----------
   Equivalente mínimo al Preflight de Tailwind, que se perdió al retirar el
   CDN. Sin esto todos los enlaces de estas páginas salen subrayados y los
   encabezados recuperan los márgenes por defecto del navegador. */
*, *::before, *::after { box-sizing: border-box; }
a { text-decoration: none; }
a:hover { text-decoration: none; }
.legal-doc a, .legal-doc a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: 100%; background: none; border: none; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; margin-right: auto; margin-left: auto; padding: 0 28px; }
@media (min-width: 640px)  { .container { max-width: 680px; } }
@media (min-width: 768px)  { .container { max-width: 800px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1180px; } }

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-4xl { max-width: 56rem; }
.max-w-xl  { max-width: 36rem; }
.min-w-full { min-width: 100%; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.overflow-x-auto { overflow-x: auto; }

/* ---------- Espaciado ---------- */
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.ml-6 { margin-left: 1.5rem; }
.mx-3 { margin-left: .75rem; margin-right: .75rem; }

@media (min-width: 640px)  { .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 768px)  { .md\:p-10 { padding: 2.5rem; } .md\:p-12 { padding: 3rem; } }
@media (min-width: 1024px) { .lg\:p-12 { padding: 3rem; } .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; } }

/* ---------- Tipografía (hereda las familias de styles-site.css) ---------- */
.text-sm  { font-size: .875rem; line-height: 1.5; }
.text-md  { font-size: 1rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; line-height: 1.3; }
.text-3xl { font-size: 1.875rem; line-height: 1.25; }
.text-4xl { font-size: 2.25rem; line-height: 1.2; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
@media (min-width: 640px) { .sm\:text-3xl { font-size: 1.875rem; } }
@media (min-width: 768px) { .md\:text-4xl { font-size: 2.25rem; } .md\:text-base { font-size: 1rem; } }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: .05em; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }

/* Encabezados de contenido legal: misma jerarquía visual que el resto del sitio */
.legal-doc h2 { color: var(--accent-deep); font-size: 1.55rem; margin-top: 2.2rem; margin-bottom: .9rem; }
.legal-doc h3 { color: var(--ink); font-size: 1.18rem; margin-top: 1.6rem; margin-bottom: .7rem; }
.legal-doc p, .legal-doc li { color: var(--ink-soft); }
.legal-doc ul { list-style: disc; margin-left: 1.5rem; margin-bottom: 1rem; }
.legal-doc ul li { margin-bottom: .5rem; }
.legal-doc strong { color: var(--ink); font-weight: 600; }

/* ---------- Color de texto — TODO mapeado a los tokens del sistema ---------- */
.text-white     { color: var(--paper); }
.text-gray-300  { color: var(--muted-on-dark); }
.text-gray-400  { color: var(--muted-on-dark); }
.text-gray-500  { color: var(--muted); }
.text-gray-600  { color: var(--muted); }
.text-gray-700  { color: var(--ink-soft); }
.text-gray-800  { color: var(--ink); }
.text-gray-900  { color: var(--ink); }
.text-blue-400  { color: var(--accent-bright); }
.text-blue-600  { color: var(--accent); }
.text-green-500 { color: var(--accent); }
.text-green-600 { color: var(--accent-deep); }
.text-yellow-500 { color: var(--accent); }

/* ---------- Fondos ---------- */
.bg-white    { background-color: var(--paper-raised); }
.bg-gray-50  { background-color: var(--paper); }
.bg-gray-100 { background-color: var(--paper-dim); }
.bg-gray-900 { background-color: var(--ink); }
.bg-blue-600 { background-color: var(--accent); }
.bg-green-500 { background-color: var(--accent); }

/* ---------- Bordes y sombras ---------- */
.rounded-lg { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.border-b { border-bottom: 1px solid var(--line); }
.border-gray-200 { border-color: var(--line); }
.shadow-md { box-shadow: var(--shadow-soft); }
.shadow-lg { box-shadow: var(--shadow-soft); }

/* ---------- Transiciones y estados ---------- */
.transform { transform: translate(0,0); }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(.4,0,.2,1); }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(.4,0,.2,1); }
.duration-200 { transition-duration: .2s; }
.duration-300 { transition-duration: .3s; }
.ease-in-out { transition-timing-function: cubic-bezier(.4,0,.2,1); }

.hover\:bg-blue-700:hover  { background-color: var(--accent-deep); }
.hover\:bg-green-600:hover { background-color: var(--accent-deep); }
.hover\:text-white:hover   { color: var(--paper); }
.hover\:underline:hover    { text-decoration: underline; }
.hover\:scale-105:hover    { transform: scale(1.05); }

/* ---------- Tablas ---------- */
.legal-doc table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.legal-doc th, .legal-doc td { border: 1px solid var(--line); padding: .75rem; text-align: left; vertical-align: top; }
.legal-doc th { background-color: var(--accent-wash); color: var(--accent-deep); font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; }

/* ---------- Icono de WhatsApp (sustituye a Font Awesome 5) ---------- */
.fab, .fa-whatsapp { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; }
.fa-whatsapp::before {
  content: "";
  display: block; width: 100%; height: 100%;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M17.5 14.4c-.3-.2-1.7-.9-2-1-.3-.1-.5-.1-.7.1-.2.3-.7 1-.9 1.2-.2.2-.3.2-.6.1-.3-.2-1.2-.5-2.3-1.4-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6l.5-.5c.1-.2.2-.3.3-.5 0-.2 0-.4 0-.5 0-.2-.7-1.6-.9-2.2-.2-.6-.5-.5-.7-.5h-.6c-.2 0-.5.1-.8.4-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.1 3.2 5.1 4.5.7.3 1.3.5 1.7.6.7.2 1.4.2 1.9.1.6-.1 1.7-.7 2-1.4.2-.7.2-1.3.2-1.4-.1-.2-.3-.2-.6-.4z'/><path d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2c-1.5 0-3-.4-4.3-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2z'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M17.5 14.4c-.3-.2-1.7-.9-2-1-.3-.1-.5-.1-.7.1-.2.3-.7 1-.9 1.2-.2.2-.3.2-.6.1-.3-.2-1.2-.5-2.3-1.4-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6l.5-.5c.1-.2.2-.3.3-.5 0-.2 0-.4 0-.5 0-.2-.7-1.6-.9-2.2-.2-.6-.5-.5-.7-.5h-.6c-.2 0-.5.1-.8.4-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.1 3.2 5.1 4.5.7.3 1.3.5 1.7.6.7.2 1.4.2 1.9.1.6-.1 1.7-.7 2-1.4.2-.7.2-1.3.2-1.4-.1-.2-.3-.2-.6-.4z'/><path d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2c-1.5 0-3-.4-4.3-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2z'/></svg>") center/contain no-repeat;
}

/* ============================================================
   Utilidades adicionales usadas por la calculadora y las
   herramientas de dosificación. Se añadieron tras detectar en QA
   visual que esas dos páginas usaban unas 50 clases de maquetación
   que no estaban cubiertas (fixed, hidden, flex-col, inset-x-0,
   lg:flex, pt-28...), lo que dejaba la cabecera colapsada y el
   título del hero en blanco sobre blanco.
   ============================================================ */

/* ---------- Posicionamiento ---------- */
.fixed { position: fixed; }
.top-0 { top: 0; }
.inset-x-0 { left: 0; right: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.inline-flex { display: inline-flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.overflow-y-auto { overflow-y: auto; }
.h-full { height: 100%; }
.h-16 { height: 4rem; }
.h-9 { height: 2.25rem; }
.w-16 { width: 4rem; }
.w-9 { width: 2.25rem; }
.max-w-2xl { max-width: 42rem; }
.gap-1 { gap: .25rem; }

@media (min-width: 1024px) { .lg\:flex { display: flex; } .lg\:hidden { display: none; } }

/* ---------- Espaciado adicional ---------- */
.p-2 { padding: .5rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-10 { padding-bottom: 2.5rem; }
.pt-28 { padding-top: 7rem; }
.mx-2 { margin-left: .5rem; margin-right: .5rem; }
.space-x-2 > * + * { margin-left: .5rem; }
.space-x-5 > * + * { margin-left: 1.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }
@media (min-width: 1280px) { .xl\:space-x-6 > * + * { margin-left: 1.5rem; } }

/* ---------- Tipografía adicional ---------- */
.text-base { font-size: 1rem; }
.font-medium { font-weight: 500; }
.font-extrabold { font-weight: 800; }
@media (min-width: 640px) { .sm\:text-2xl { font-size: 1.5rem; } }
@media (min-width: 768px) { .md\:text-lg { font-size: 1.125rem; } }

/* ---------- Color adicional, siempre sobre tokens del sistema ---------- */
.text-blue-100 { color: var(--accent-wash); }
.text-blue-700 { color: var(--accent-deep); }
.text-blue-800 { color: var(--accent-deep); }
.bg-green-600 { background-color: var(--accent-deep); }
.bg-opacity-20 { --tw-bg-opacity: .2; }
.opacity-60 { opacity: .6; }
.opacity-80 { opacity: .8; }
.drop-shadow-md { filter: drop-shadow(0 3px 3px rgba(11,58,92,.14)); }
.shadow-2xl { box-shadow: var(--shadow-dark); }
.rounded-md { border-radius: var(--radius); }

.hover\:bg-blue-50:hover   { background-color: var(--accent-wash); }
.hover\:bg-gray-50:hover   { background-color: var(--paper); }
.hover\:bg-gray-100:hover  { background-color: var(--paper-dim); }
.hover\:bg-green-700:hover { background-color: var(--accent-deep); }
.hover\:text-blue-600:hover { color: var(--accent); }
.hover\:text-blue-800:hover { color: var(--accent-deep); }

.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--accent-bright); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 2px var(--accent); }

/* Degradado del hero de las herramientas: antes usaba from-blue-700/to-green-600
   de Tailwind; ahora es el azul del sistema, y garantiza contraste con el
   texto en blanco que lleva encima. */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--accent-deep), var(--accent)); }
.from-blue-700, .to-green-600 { /* absorbidos por el degradado de arriba */ }

.animate-in { animation: fade-in-up .5s ease both; }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Cabecera fija y menú móvil de las herramientas ---------- */
header.fixed { background: var(--paper-raised); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-soft); }
header.fixed .container { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }
header.fixed nav a { text-decoration: none; }
.menu-item { display: block; padding: .75rem 0; text-decoration: none; }
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: var(--paper-raised); box-shadow: var(--shadow-dark); transform: translateX(100%); transition: transform .3s ease-in-out; z-index: 60; padding: 72px 28px 28px; }
.mobile-menu.active { transform: translateX(0); }

/* ---------- Botones heredados del gestor de cookies ---------- */
[data-cc="show-preferencesModal"] { margin: 0 .5em .5em 0; }

/* ---------- Widgets de contacto flotantes ---------- */
.amo-wp       { background: var(--accent) url("../images/whatsapp.svg") 50% no-repeat; background-size: 75%; }
.amo-telegram { background: var(--accent-bright) url("../images/telegram.svg") 50% no-repeat; background-size: 75%; }
.amo-viber    { background: var(--accent-deep) url("../images/viber.svg") 50% no-repeat; background-size: 75%; }
