/* =========================================================================
   LEGAL PAGES — shared stylesheet for the 16 root-level legal / marketing /
   support pages rendered from templates/legal/*.html.

   Pattern: BEM, prefixed .legal-page. Variants:
     .legal-page                (base)
     .legal-page--marketing     (hero, full-width image)
     .legal-page--legal         (serif typography for RGPD / terms)
     .legal-page--terms         (numbered clauses, dense)
     .legal-page--cookies-config (grid of toggles)
   ========================================================================= */

/* Pull in shop.css (transitively via @import) + product-detail.css so pages
   that combine .shop-page .product-page with .legal-page get the same
   background, padding, width and CSS variables as /tienda/agenda-planner-maison-2027.
   product-detail.css must be imported AFTER shop.css to override --pm-* tokens.
   Load order after @import: shop.css → product-detail.css → legal-pages.css
   → legal-pages.css wins same-specificity ties (color/line-height kept on
   .legal-page base for legal readability). */
@import url("/css/shop.css?v=2026081101");
@import url("/css/product-detail.css?v=2026081201");

/* ===================== Base layout ===================== */

.legal-page {
  color: #2f241b;
  line-height: 1.7;
  font-size: 1rem;
}

/* ── Re-uso del shell visual de shop/product-detail ──
   El wrapper .shop-shell.product-shell hereda padding 24px 0 64px y
   width min(1180px, calc(100% - 32px)) de product-detail.css para que
   la transición desde /tienda/producto/* sea imperceptible. */
.legal-page .product-shell {
  /* Override del .product-shell de product-detail.css: heredamos todo el
     spacing para no duplicar padding. */
  padding-top: 24px;
  padding-bottom: 64px;
}

/* ── Justificación al centro del texto legal (RGPD / condiciones) ── */
.legal-page--legal p,
.legal-page--legal li,
.legal-page--terms p,
.legal-page--terms li,
.legal-section p,
.legal-section li,
.legal-contact-box p,
.legal-contact-box li {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.legal-page--legal h1,
.legal-page--legal h2,
.legal-page--legal h3,
.legal-page--terms h1,
.legal-page--terms h2,
.legal-page--terms h3,
.legal-section h1,
.legal-section h2,
.legal-section h3 {
  text-align: left;
}

/* ── Selectores cortos huérfanos (legacy templates) ── */
.legal-section {
  margin: 0 0 32px;
  padding: 24px 0;
  border-top: 1px solid rgba(111, 78, 55, 0.12);
}
.legal-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.legal-section h2 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.32rem;
  line-height: 1.3;
  font-weight: 700;
  color: #2f241b;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}
.legal-section h3 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: #2f241b;
  margin: 22px 0 8px;
}
.legal-section p,
.legal-section li {
  font-size: 1rem;
  line-height: 1.7;
  color: #2f241b;
  margin: 0 0 12px;
}
.legal-section ul,
.legal-section ol {
  padding-left: 1.4rem;
  margin: 0 0 12px;
}

.legal-contact-box {
  margin: 24px 0 32px;
  padding: 20px 24px;
  background: rgba(242, 184, 114, 0.10);
  border: 1px solid rgba(111, 78, 55, 0.18);
  border-left: 4px solid #f2b872;
  border-radius: 12px;
  font-size: 0.98rem;
  color: #2f241b;
}
.legal-contact-box p { margin: 0 0 8px; }
.legal-contact-box p:last-child { margin-bottom: 0; }
.legal-contact-box a {
  color: #2f241b;
  text-decoration: underline;
  text-decoration-color: rgba(47, 36, 27, 0.4);
  text-underline-offset: 3px;
}
.legal-contact-box a:hover { text-decoration-color: #2f241b; }

.baja-page {
  max-width: 720px;
  margin: 0 auto;
}
.baja-card {
  background: #ffffff;
  border: 1px solid rgba(111, 78, 55, 0.12);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 24px -16px rgba(47, 36, 27, 0.18);
}
.baja-card h2 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.32rem;
  margin: 0 0 12px;
  color: #2f241b;
}
.baja-card p { margin: 0 0 12px; line-height: 1.7; }

/* ── Cookie preferences (cookie toggle UI en /cookies/configurar) ── */
.cookie-preferences {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.cookie-toggle {
  background: #ffffff;
  border: 1px solid rgba(111, 78, 55, 0.16);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 6px 18px -16px rgba(47, 36, 27, 0.22);
}
.cookie-toggle__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.cookie-toggle__header h2 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.08rem;
  font-weight: 700;
  color: #2f241b;
  margin: 0;
}
.cookie-toggle__switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cookie-toggle__switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(111, 78, 55, 0.28);
  border-radius: 24px;
  transition: background 160ms ease;
}
.cookie-toggle__slider::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 160ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cookie-toggle__switch input:checked + .cookie-toggle__slider {
  background: #2f241b;
}
.cookie-toggle__switch input:checked + .cookie-toggle__slider::before {
  transform: translateX(20px);
}
.cookie-toggle__switch input:disabled + .cookie-toggle__slider {
  background: rgba(111, 78, 55, 0.5);
  cursor: not-allowed;
}
.cookie-toggle p {
  margin: 0 0 8px;
  font-size: 0.96rem;
  line-height: 1.65;
}
.cookie-toggle__list {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: rgba(47, 36, 27, 0.85);
}
.cookie-toggle__list li { margin-bottom: 4px; }
.cookie-preferences__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  justify-content: flex-end;
}
.cookie-preferences__status {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: #2f241b;
  text-align: right;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn--primary { background: #2f241b; color: #f7f1e3; border-color: #2f241b; }
.btn--primary:hover { background: #1c130b; border-color: #1c130b; }
.btn--ghost { background: transparent; color: #2f241b; border-color: rgba(47, 36, 27, 0.32); }
.btn--ghost:hover { background: rgba(47, 36, 27, 0.06); }

.legal-page__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b4a2f;
  background: rgba(242, 184, 114, 0.18);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.legal-page__title {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 2.4rem;
  line-height: 1.15;
  font-weight: 700;
  color: #2f241b;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.legal-page__lede {
  font-size: 1.12rem;
  line-height: 1.55;
  color: #5a4a3d;
  margin: 0 0 36px;
  max-width: 64ch;
}

.legal-page__updated {
  display: inline-block;
  font-size: 0.85rem;
  color: #85796f;
  font-weight: 500;
  margin-bottom: 32px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(111, 78, 55, 0.2);
}

.legal-page__section {
  margin: 0 0 32px;
}

.legal-page__section h2 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.32rem;
  line-height: 1.3;
  font-weight: 700;
  color: #2f241b;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}

.legal-page__section h3 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: #2f241b;
  margin: 22px 0 8px;
}

.legal-page__section p,
.legal-page__section li {
  font-size: 1rem;
  line-height: 1.7;
  color: #3d322a;
}

.legal-page__section p {
  margin: 0 0 14px;
}

.legal-page__section ul,
.legal-page__section ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.legal-page__section li {
  margin-bottom: 6px;
}

.legal-page__section strong {
  color: #2f241b;
  font-weight: 600;
}

.legal-page__section a {
  color: #6b4a2f;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.legal-page__section a:hover {
  color: #2f241b;
  text-decoration-thickness: 2px;
}

.legal-page__cta {
  display: inline-block;
  background: #6b4a2f;
  color: #fff8ed;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-top: 12px;
}

.legal-page__cta:hover {
  background: #2f241b;
  transform: translateY(-1px);
}

.legal-page__cta--secondary {
  background: transparent;
  color: #6b4a2f;
  border: 1.5px solid #6b4a2f;
  margin-left: 12px;
}

.legal-page__cta--secondary:hover {
  background: #6b4a2f;
  color: #fff8ed;
}

/* ===================== Marketing variant ===================== */

.legal-page--marketing {
  width: min(1080px, 100%);
  padding-top: 0;
}

.legal-page__hero {
  position: relative;
  width: 100%;
  margin-bottom: 48px;
  border-radius: 18px;
  overflow: hidden;
  background: #f5efe1;
  padding: 64px 48px;
}

.legal-page__hero--creadoras {
  background: linear-gradient(135deg, #f7e8d0 0%, #f2d2bb 100%);
}

.legal-page__hero--ampas {
  background: linear-gradient(135deg, #d8e3eb 0%, #c5d4dc 100%);
}

.legal-page__hero--familias {
  background: linear-gradient(135deg, #f7e8d0 0%, #e9d4b3 100%);
}

.legal-page__hero--media {
  background: linear-gradient(135deg, #e8e0f0 0%, #d4cae0 100%);
}

.legal-page__hero-inner {
  max-width: 640px;
}

.legal-page__hero h1 {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 2.6rem;
  line-height: 1.1;
  font-weight: 700;
  color: #2f241b;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.legal-page__hero p {
  font-size: 1.12rem;
  line-height: 1.55;
  color: #5a4a3d;
  margin: 0 0 24px;
}

.legal-page__benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 36px 0;
}

.legal-page__benefit {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid rgba(111, 78, 55, 0.1);
}

.legal-page__benefit h3 {
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #2f241b;
}

.legal-page__benefit p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #5a4a3d;
  margin: 0;
}

.legal-page__hero-image {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 12px;
  margin: 32px 0;
  background: #e0d6c4;
}

/* ===================== Legal / terms variant ===================== */

.legal-page--legal {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.96rem;
  line-height: 1.75;
}

.legal-page--legal .legal-page__title {
  font-size: 2rem;
}

.legal-page--legal .legal-page__section h2 {
  font-size: 1.2rem;
  border-left: 3px solid #c89060;
  padding-left: 14px;
  margin-top: 36px;
}

.legal-page--legal .legal-page__section h3 {
  font-size: 1rem;
  color: #5a4a3d;
}

.legal-page--terms ol {
  counter-reset: clause;
  list-style: none;
  padding-left: 0;
}

.legal-page--terms ol > li {
  counter-increment: clause;
  position: relative;
  padding-left: 38px;
  margin-bottom: 18px;
}

.legal-page--terms ol > li::before {
  content: counter(clause);
  position: absolute;
  left: 0;
  top: 2px;
  width: 26px;
  height: 26px;
  background: #6b4a2f;
  color: #fff8ed;
  border-radius: 50%;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===================== Cookie consent UI ===================== */

.legal-page--cookies-config {
  width: min(960px, 100%);
}

.cookie-toggles {
  display: grid;
  gap: 16px;
  margin: 32px 0;
}

.cookie-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid rgba(111, 78, 55, 0.14);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cookie-toggle:hover {
  border-color: rgba(111, 78, 55, 0.3);
  transform: translateY(-1px);
}

.cookie-toggle--required {
  background: #f9f3e5;
  border-color: rgba(111, 78, 55, 0.2);
  cursor: not-allowed;
}

.cookie-toggle__info h3 {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #2f241b;
}

.cookie-toggle__info p {
  font-size: 0.88rem;
  color: #5a4a3d;
  margin: 0;
  max-width: 52ch;
}

.cookie-toggle__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(76, 175, 80, 0.16);
  color: #2e7d32;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.cookie-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: #d4c8b3;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  border: none;
  padding: 0;
}

.cookie-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cookie-switch[aria-checked="true"] {
  background: #6b4a2f;
}

.cookie-switch[aria-checked="true"]::after {
  transform: translateX(24px);
}

.cookie-switch[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.cookie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(111, 78, 55, 0.12);
}

.cookie-status {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.92rem;
  display: none;
}

.cookie-status--success {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
  border-left: 3px solid #4caf50;
  display: block;
}

.cookie-status--info {
  background: rgba(146, 164, 187, 0.18);
  color: #3b4b5e;
  border-left: 3px solid #92a4bb;
  display: block;
}

/* ===================== Form fields (contacto / baja) ===================== */

.legal-form {
  max-width: 560px;
  margin: 32px 0;
  display: grid;
  gap: 18px;
}

.legal-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-form__field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2f241b;
}

.legal-form__field input,
.legal-form__field textarea,
.legal-form__field select {
  font-family: inherit;
  font-size: 1rem;
  padding: 11px 14px;
  border: 1.5px solid rgba(111, 78, 55, 0.22);
  border-radius: 8px;
  background: #fff;
  color: #2f241b;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.legal-form__field input:focus,
.legal-form__field textarea:focus,
.legal-form__field select:focus {
  outline: none;
  border-color: #6b4a2f;
  box-shadow: 0 0 0 3px rgba(107, 74, 47, 0.16);
}

.legal-form__field textarea {
  min-height: 120px;
  resize: vertical;
}

.legal-form__field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.legal-form__field--checkbox input {
  margin-top: 4px;
}

.legal-form__field--checkbox label {
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.5;
}

.legal-form__actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.legal-form__error {
  font-size: 0.85rem;
  color: #c62828;
  margin-top: 4px;
}

.legal-form__note {
  font-size: 0.85rem;
  color: #85796f;
  line-height: 1.5;
}

/* ===================== Data card (contacto / contacto cards) ===================== */

.legal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 32px 0;
}

.legal-info-card {
  background: #fff;
  border: 1px solid rgba(111, 78, 55, 0.12);
  border-radius: 12px;
  padding: 22px;
}

.legal-info-card h3 {
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #2f241b;
}

.legal-info-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #5a4a3d;
  margin: 0 0 4px;
}

.legal-info-card a {
  color: #6b4a2f;
  text-decoration: none;
  font-weight: 600;
}

.legal-info-card a:hover {
  text-decoration: underline;
}

/* ===================== Responsive ===================== */

@media (max-width: 768px) {
  .legal-page {
    padding: 32px 18px 60px;
  }
  .legal-page__title {
    font-size: 1.85rem;
  }
  .legal-page--legal .legal-page__title {
    font-size: 1.6rem;
  }
  .legal-page__hero {
    padding: 40px 24px;
  }
  .legal-page__hero h1 {
    font-size: 1.9rem;
  }
  .legal-page__hero-image {
    height: 220px;
  }
  .legal-form__actions {
    flex-direction: column;
  }
  .legal-page__cta--secondary {
    margin-left: 0;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-page__cta,
  .cookie-toggle,
  .cookie-switch,
  .cookie-switch::after {
    transition: none;
  }
  .legal-page__cta:hover,
  .cookie-toggle:hover {
    transform: none;
  }
}

/* ============================================================
 * AGENDA-APP HERO — inline-style replacements (CSP-safe)
 * Inline style attributes were used by familias/creadoras/media-kit
 * for hero centering, FAQ check/cross icons, footer alignment.
 * CSP blocks inline style="..." so we replicate the same look
 * via classes. Generated 2026-08-01.
 * ============================================================ */

/* Hero centering for creadoras / media-kit (no product image) */
.aa-hero--centered .aa-hero__inner {
  grid-template-columns: 1fr !important;
  text-align: center !important;
}
.aa-hero--centered .aa-hero__ctas {
  justify-content: center !important;
}

/* Hero with constrained copy width for the lead paragraphs */
.aa-hero__subtitle--spaced {
  margin-top: 1rem !important;
}

/* FAQ check / cross icon styles (media-kit "lo que sí / lo que no") */
.faq-icon {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.faq-icon__check {
  color: var(--pm-color-green-cta-strong, #4caf50);
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.faq-icon__check--inline {
  color: var(--pm-color-green-cta-strong, #4caf50);
  font-size: 16px;
  line-height: 1;
}
.faq-icon__cross {
  color: #b00020;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.faq-icon__cross--inline {
  color: #b00020;
  font-size: 16px;
  line-height: 1;
}
.faq-icon__check-blue {
  color: var(--pm-color-blue-active, #4a90e2);
  font-size: 16px;
  line-height: 1;
}
.faq-icon__cross-color {
  color: #b00020;
}

/* Footer text spacing utilities (used in dark band sections) */
.text-on-dark {
  color: rgba(255, 255, 255, 0.75);
}
.text-on-dark__title {
  font-family: var(--pm-font-ui);
  font-size: 15px;
  color: var(--pm-color-text-strong);
  margin: 0 0 8px;
}
.text-on-dark__subtitle {
  font-family: var(--pm-font-ui);
  font-size: 13px;
  color: var(--pm-color-text-soft);
  margin: 0;
}
.text-on-dark__caption {
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--pm-font-ui);
  font-size: 13px;
}
.text-on-dark__link {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* CTA row used inside aa-hero__ctas for centered double-button hero */
.aa-hero__ctas--centered {
  justify-content: center;
}

/* Contact bullet list (compact no-list list) */
.bullet-list--compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tag pill in contact section */
.tag-pill--dark {
  background: var(--pm-color-text-strong);
  color: var(--pm-color-surface);
}

/* Constrained copy width inside aa-hero__content */
.aa-content__copy-narrow {
  max-width: 580px;
}

/* Lead form intro paragraph */
.aa-lead-form__intro-narrow {
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
}

/* FAQ flex row layout (image + text side-by-side) */
.faq-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Static color helpers (for inline color: spans) */
.text-white {
  color: #fff;
}
.text-blue {
  color: var(--pm-color-blue-active);
}

.legal-btn-ghost-on-white {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.legal-page__section--spaced {
  margin-top: 48px;
}
