:root {
  --primary-red: #e30613;
  --text-dark: #1a1a1a;
  --text-muted: #666;
  --bg-light: #f8f9fa;

  /* Fluid Typography con clamp(min, preferred, max) */
  --fs-h1: clamp(2rem, 5vw, 3rem);
  --fs-h2: clamp(1.25rem, 3vw, 1.6rem);
  --fs-body: clamp(0.9rem, 1vw + 0.5rem, 1rem);

  /* Fluid Spacing */
  --spacing-lg: clamp(40px, 8vw, 80px);
  --container-gap: clamp(20px, 5vw, 60px);
}

html {
  scroll-behavior: smooth;
}

.tyc-page {
  padding-top: var(--header-height);
  background: #fff;
  color: var(--text-dark);
  font-family: "Montserrat", sans-serif;
  overflow-x: hidden; /* Evita desbordamiento horizontal accidental en móviles */
}

/* Hero Section */
.tyc-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: white;
  padding: var(--spacing-lg) 0;
  text-align: center;
  margin-bottom: 40px;
}

.tyc-hero .badge {
  background: var(--primary-red);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  display: inline-block;
  font-weight: 600;
}

.tyc-hero h1 {
  font-size: var(--fs-h1);
  margin-bottom: 15px;
  font-weight: 800;
  letter-spacing: -1px;
}

.tyc-hero p {
  opacity: 0.7;
  font-size: 1rem;
  font-weight: 300;
}

/* Layout Container */
.tyc-layout {
  display: grid !important; /* Evita que las reglas flex/block de la clase container del framework anulen el grid */
  grid-template-columns: 280px 1fr;
  gap: var(--container-gap);
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.tyc-sidebar {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.tyc-content {
  grid-column: 2;
  width: 100%;
  min-width: 0;
}

/* Sidebar Navigation */

.tyc-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tyc-nav li {
  margin-bottom: 18px;
}

.tyc-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  line-height: 1.4;
}

.tyc-nav a:hover {
  color: var(--primary-red);
  transform: translateX(5px);
}

/* Content Area */
.tyc-content section {
  margin-bottom: 30px;
  scroll-margin-top: calc(var(--header-height) + 40px);
}

.tyc-content h2 {
  font-size: var(--fs-h2);
  color: var(--text-dark);
  margin-bottom: 25px;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

.tyc-content h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-red);
}

.tyc-content p {
  font-size: var(--fs-body);
  line-height: 1.8;
  color: #4a4a4a;
  margin-bottom: 20px;
  text-align: justify;
}

.tyc-content strong {
  color: var(--text-dark);
  font-weight: 600;
}

.tyc-content a {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border 0.3s;
  word-break: break-word; /* Previene desbordamiento en móviles por URLs o correos largos */
  overflow-wrap: break-word;
}

.tyc-content a:hover {
  border-bottom-color: var(--primary-red);
}

/* Listas en el contenido legal */
.tyc-content ul,
.tyc-content ol {
  margin-top: 10px;
  margin-bottom: 25px;
  padding-left: 24px;
}

.tyc-content ul {
  list-style-type: disc;
}

.tyc-content ol {
  list-style-type: decimal;
}

.tyc-content li {
  font-size: var(--fs-body);
  line-height: 1.8;
  color: #4a4a4a;
  margin-bottom: 12px;
}

.tyc-content li strong {
  color: var(--text-dark);
}

/* Listas anidadas */
.tyc-content li ul {
  margin-top: 10px;
  margin-bottom: 10px;
  list-style-type: circle;
}

.tyc-content li ul li {
  margin-bottom: 8px;
}

/* Subtítulos (h3) */
.tyc-content h3 {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-top: 35px;
  margin-bottom: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* Mobile Adaptability */
@media (max-width: 992px) {
  .tyc-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0 24px 60px !important; /* Forzamos el padding exacto para coincidir con los márgenes negativos de legal-nav */
  }

  .tyc-sidebar {
    grid-column: 1;
    width: 100%;
    position: relative;
    z-index: 10; /* Asegura que esté por encima del contenido si hay solapamiento */
  }

  .tyc-content {
    grid-column: 1;
    width: 100%;
  }

  .tyc-hero {
    padding: 60px 20px;
  }

  .tyc-content section {
    margin-bottom: 20px;
  }

  .tyc-content p {
    text-align: left; /* Desactiva el justificado en móviles para evitar espacios gigantes */
  }

  .tyc-content ul,
  .tyc-content ol {
    padding-left: 20px; /* Reduce la sangría para ganar espacio de texto en pantallas chicas */
  }
}

/* Tables in content */
.tyc-content .table-container {
  width: 100%;
  overflow-x: auto;
  margin: 30px 0 45px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.tyc-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 0.4vw + 0.65rem, 0.9rem);
  min-width: 700px;
}

.tyc-content th,
.tyc-content td {
  padding: clamp(12px, 1.5vw, 18px) clamp(12px, 1.5vw, 20px);
  text-align: left;
  border-bottom: 1px solid #eee;
  line-height: 1.5;
}

.tyc-content th {
  background: var(--bg-light);
  color: var(--text-dark);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1.2px;
}

.tyc-content tr:last-child td {
  border-bottom: none;
}

.tyc-content tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

.tyc-content td strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-red);
}
/* --- Estilos para el Acordeón de Campañas --- */
.tyc-content details {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.tyc-content details[open] {
  border-color: var(--primary-red);
  box-shadow: 0 10px 25px rgba(227, 6, 19, 0.05);
}
.tyc-content summary {
  list-style: none; /* Quita la flecha por defecto */
  padding: 24px 30px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.tyc-content summary::-webkit-details-marker {
  display: none; /* Quita flecha en Safari */
}
/* El título dentro del summary */
.tyc-content summary h2 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.1rem !important;
  color: var(--text-dark);
  max-width: 90%;
}
.tyc-content summary h2::after {
  display: none; /* Quitamos la línea roja estática si existe */
}
/* Icono Personalizado (Flecha) */
.tyc-content summary::after {
  content: "+";
  font-family: monospace;
  font-size: 1.5rem;
  color: var(--primary-red);
  font-weight: 400;
  transition: transform 0.3s ease;
}
.tyc-content details[open] summary::after {
  content: "-";
  transform: rotate(180deg);
}
/* Contenedor del contenido interno */
.campaign-details-inner {
  padding: 10px 30px 30px;
  border-top: 1px solid #f9f9f9;
  animation: slideDown 0.4s ease-out;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efectos de Interacción Extra */
.tyc-content summary:hover {
  background-color: rgba(227, 6, 19, 0.02); /* Toque sutil de rojo */
}

.tyc-content summary h2 {
  transition: color 0.3s ease;
}

.tyc-content summary:hover h2 {
  color: var(--primary-red);
}

/* --- Estilos para el Bloque de Resumen Legal (Pie de Página) --- */
.tyc-footer-summary {
  margin-top: 40px;
  margin-bottom: 60px;
  padding: 0 24px; /* Alineación con el contenedor principal */
}

.tyc-footer-summary .summary-box {
  background: #f9f9f9;
  padding: clamp(20px, 4vw, 40px);
  border-radius: 16px;
  border: 1px solid #eee;
  line-height: 1.7;
  color: #4a4a4a;
  font-size: 0.95rem;
  max-width: 1252px; /* Alineado con el layout */
  margin: 0 auto;
}

.tyc-footer-summary p {
  margin-bottom: 15px;
}

.tyc-footer-summary p:last-child {
  margin-bottom: 0;
}

.tyc-footer-summary strong {
  color: var(--text-dark);
  font-weight: 700;
}

.tyc-footer-summary .meta-info {
  font-size: 0.82rem;
  color: #888;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #efefef;
}

.tyc-footer-summary a {
  color: var(--primary-red);
  font-weight: bold;
  text-decoration: none;
  transition: opacity 0.3s;
}

.tyc-footer-summary a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .tyc-footer-summary {
    margin-top: 20px;
    margin-bottom: 40px;
  }
}
