: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: 80px;
  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: 60px;
  }

  .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);
}
