:root {
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --border: #e2e8f0;
  --border-strong: #4a90a47d;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #2563eb;
  --success: #22c55e;
  --muted: #cbd5e1;
  --table-radius: 14px;
  --gradient-start: #f0f9ff;
  --gradient-end: #e0f2fe;

  --gradient-start: #064e3b;
  --gradient-end: #059669;

  --gradient-start: #475569;
  --gradient-end: #64748b;
}


/* ===== SECTION WRAPPER ===== */
.comparison-section {
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  padding: 5rem 2rem 4rem;
  min-height: 100vh;
  /*display: flex;*/
  align-items: center;
  justify-content: center;
}
.comparison-header {
  display: block;
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.comparison-header h2 {
  font-size: 42px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 15px;
  line-height: 1.2;
}

.comparison-header p {
  font-size: 18px;
  color: #ffffff;
  line-height: 1.6;
  margin: 0;
}
.comparison-wrapper {
  max-width: 750px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--table-radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 40px, 0);
}

.comparison-wrapper.animate-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.comparison-wrapper.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ===== HEADER ===== */
.comparison-table thead {
  background: var(--bg);
  border-bottom: 2px solid #4a90a47d;
}

.comparison-table th {
  padding: 2.5rem 1.5rem 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  border-bottom: 2px solid var(--border-strong);
  position: relative;
  background: #f1f5f9;
}

.comparison-table th:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding-left: 1.5rem;
  padding-top: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8fafc;
}

/* Most Popular column with blue background */
th.most-popular {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  color: #0077b6;
  position: relative;
  overflow: visible;
}

/* Badge at the top */
th.most-popular::before {
  content: attr(data-badge);
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #4a90a4 0%, #5ca3b8 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}
.comparison-mobile .premium .mobile-plan-name,
th.premium {
  color: #b1922c;
}
.comparison-mobile .most-popular .mobile-plan-name {
  color: #0077b6;
}


/* ===== BODY ===== */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table td {
  padding: 1rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  text-align: center;
  color: #64748b;
}
.comparison-table .group-separator td {
  border-bottom: 2px solid #4a90a47d;
}
.comparison-table .th1 {
  width: 40%;
}
.comparison-table .th2 {
  width: 19%;
  min-width: 130px;
}
.comparison-table .th3 {
  width: 22%;
  min-width: 130px;
}
.comparison-table .th4 {
  width: 19%;
  min-width: 100px;
  max-width: 130px;
}
.comparison-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 1.5rem;
  font-size: 0.95rem;
  white-space: nowrap;
}


/* Estilos completos para destacar columna Pro */
.is_start .comparison-table th:nth-child(3),
.is_start .comparison-table td:nth-child(3) {
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8fb 100%);
    font-weight: 600;
    position: relative;
}

/* Badge superior en el header */
.is_start .comparison-table thead th:nth-child(3) {
    background: #4a9fb8;
    color: white;
}

/* Borde lateral para destacar */
.is_start .comparison-table td:nth-child(3),
.is_start .comparison-table th:nth-child(3) {
    border-left: 3px solid #4a9fb8;
    border-right: 3px solid #4a9fb8;
}

/* Primera y última fila con bordes top/bottom */
.is_start .comparison-table tr:first-child th:nth-child(3) {
    border-top: 3px solid #4a9fb8;
}

.is_start .comparison-table tr:last-child td:nth-child(3) {
    border-bottom: 3px solid #4a9fb8;
}

/* Ocultar columna Start cuando el usuario tiene plan Pro */
.is_pro .comparison-table th:nth-child(2),
.is_pro .comparison-table td:nth-child(2) {
    display: none;
}

/* Ocultar columnas Start y Pro cuando el usuario tiene plan Premium */
.is_premium .comparison-table th:nth-child(2),
.is_premium .comparison-table td:nth-child(2),
.is_premium .comparison-table th:nth-child(3),
.is_premium .comparison-table td:nth-child(3) {
    display: none;
}

/* Mostrar todas las columnas cuando se activa el toggle */
.is_pro.show-all-plans .comparison-table th:nth-child(2),
.is_pro.show-all-plans .comparison-table td:nth-child(2),
.is_premium.show-all-plans .comparison-table th:nth-child(2),
.is_premium.show-all-plans .comparison-table td:nth-child(2),
.is_premium.show-all-plans .comparison-table th:nth-child(3),
.is_premium.show-all-plans .comparison-table td:nth-child(3) {
    display: table-cell;
}

/* Estilos para cuando el usuario tiene plan Pro */
.is_pro .comparison-table th:nth-child(3),
.is_pro .comparison-table td:nth-child(3) {
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8fb 100%);
    font-weight: 600;
    position: relative;
}

/* Badge superior en el header para Pro */
.is_pro .comparison-table thead th:nth-child(3) {
    background: #4a9fb8;
    color: white;
}

/* Borde lateral para destacar columna Pro */
.is_pro .comparison-table td:nth-child(3),
.is_pro .comparison-table th:nth-child(3) {
    border-left: 3px solid #4a9fb8;
    border-right: 3px solid #4a9fb8;
}

/* Primera y última fila con bordes top/bottom para Pro */
.is_pro .comparison-table tr:first-child th:nth-child(3) {
    border-top: 3px solid #4a9fb8;
}

.is_pro .comparison-table tr:last-child td:nth-child(3) {
    border-bottom: 3px solid #4a9fb8;
}

/* Estilos para cuando el usuario tiene plan Premium */
.is_premium .comparison-table th:nth-child(4),
.is_premium .comparison-table td:nth-child(4) {
    background: linear-gradient(135deg, #fefce8 0%, #fef9e7 100%);
    font-weight: 600;
    position: relative;
}

/* Badge superior en el header para Premium */
.is_premium .comparison-table thead th:nth-child(4) {
    background: linear-gradient(135deg, #d4af37 0%, #f0d970 100%);
    color: #3d2f00;
}

/* Borde lateral para destacar columna Premium */
.is_premium .comparison-table td:nth-child(4),
.is_premium .comparison-table th:nth-child(4) {
    border-left: 3px solid #d4af37;
    border-right: 3px solid #d4af37;
}

/* Primera y última fila con bordes top/bottom para Premium */
.is_premium .comparison-table tr:first-child th:nth-child(4) {
    border-top: 3px solid #d4af37;
}

.is_premium .comparison-table tr:last-child td:nth-child(4) {
    border-bottom: 3px solid #d4af37;
}

/* Badge en columna Premium con clase especial */
th.plan-premium-highlight::before {
  content: attr(data-badge);
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #d4af37 0%, #f0d970 100%);
  color: #3d2f00;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}


/* First row after separator gets extra top padding */
.group-separator + tr td {
  padding-top: 1.2rem;
}

/* ===== YES / NO ICONS ===== */
.check-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  text-align: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: white;
}

.check-icon.yes::before {
  content: "✓";
}

.check-icon.yes {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.check-icon.no::before {
  content: "×";
}

.check-icon.no {
  background: var(--muted);
}

/* ===== GROUP SEPARATOR ===== */
.group-separator td {
  padding: 0;
  border: none;
  position: relative;
  height: 1px;
  background: transparent;
}

/* ===== MOBILE VERSION ===== */
.comparison-mobile {
  display: none;
  margin-top: 2rem;
  padding: 0 1rem;
}

.mobile-plan {
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 40px, 0);
}

.mobile-plan.animate-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.mobile-plan.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.mobile-plan.animate-in:nth-child(1) { transition-delay: 0.1s; }
.mobile-plan.animate-in:nth-child(2) { transition-delay: 0.2s; }
.mobile-plan.animate-in:nth-child(3) { transition-delay: 0.3s; }

.mobile-plan-header {
  background: #f1f5f9;
  padding: 1.5rem 1.2rem 1.2rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-strong);
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Aumentar padding-top solo en el plan que tiene badge */

/* Usuario no logueado o sin plan: badge en Pro */
.mobile-plan:nth-child(2) .mobile-plan-header.most-popular {
  padding-top: 3rem;
}

/* Usuario en Start (trial): badge en Start y en Pro */
.is_start .mobile-plan:nth-child(1) .mobile-plan-header,
.is_start .mobile-plan:nth-child(2) .mobile-plan-header {
  padding-top: 3rem;
}

/* Usuario con plan Pro: badge en Pro */
.is_pro .mobile-plan:nth-child(2) .mobile-plan-header {
  padding-top: 3rem;
}

/* Usuario con plan Premium: badge en Premium */
.is_premium .mobile-plan:nth-child(3) .mobile-plan-header {
  padding-top: 3rem;
}

.mobile-plan-badge {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #4a90a4 0%, #5ca3b8 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(74, 144, 164, 0.2);
}

.mobile-plan-title-container {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
}

.mobile-plan-brand {
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(to bottom, #4a90a4, #2e6070);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.mobile-plan-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-plan-header.most-popular {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  color: var(--text-primary);
}

.mobile-plan-header.most-popular .mobile-plan-brand {
  background: linear-gradient(to bottom, #4a90a4, #2e6070);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Estilos para destacar el plan Pro en móvil cuando el usuario lo tiene */
.is_start .mobile-plan:nth-child(2),
.is_pro .mobile-plan:nth-child(2) {
  border: 3px solid #4a9fb8;
  box-shadow: 0 8px 20px rgba(74, 159, 184, 0.3);
}

.is_start .mobile-plan:nth-child(2) .mobile-plan-header,
.is_pro .mobile-plan:nth-child(2) .mobile-plan-header {
  background: #4a9fb8;
  color: white;
  border-bottom: 2px solid #3d8298;
}

.is_start .mobile-plan:nth-child(2) .mobile-plan-brand,
.is_pro .mobile-plan:nth-child(2) .mobile-plan-brand {
  background: linear-gradient(to bottom, #ffffff, #e0f2f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.is_start .mobile-plan:nth-child(2) .mobile-plan-name,
.is_pro .mobile-plan:nth-child(2) .mobile-plan-name {
  color: white;
}

/* Fondo de las celdas para plan Pro activo en móvil */
/* Usar clases zebra-odd/zebra-even agregadas por JS para un conteo continuo correcto */
.is_start .mobile-plan:nth-child(2) .mobile-plan-features li.zebra-odd,
.is_pro .mobile-plan:nth-child(2) .mobile-plan-features li.zebra-odd {
  background: linear-gradient(135deg, #e8f4f8 0%, #f0f8fb 100%);
}

.is_start .mobile-plan:nth-child(2) .mobile-plan-features li.zebra-even,
.is_pro .mobile-plan:nth-child(2) .mobile-plan-features li.zebra-even {
  background: linear-gradient(135deg, #d9eef5 0%, #e4f4f9 100%);
}

/* Excluir los separadores del conteo de colores */
.is_start .mobile-plan:nth-child(2) .mobile-plan-features .group-separator,
.is_pro .mobile-plan:nth-child(2) .mobile-plan-features .group-separator {
  background: transparent !important;
}

/* Estilos para destacar el plan Premium en móvil cuando el usuario lo tiene */
.is_premium .mobile-plan:nth-child(3) {
  border: 3px solid #d4af37;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.is_premium .mobile-plan:nth-child(3) .mobile-plan-header {
  background: linear-gradient(135deg, #d4af37 0%, #f0d970 100%);
  color: #3d2f00;
  border-bottom: 2px solid #c49d2e;
}

.is_premium .mobile-plan:nth-child(3) .mobile-plan-brand {
  background: linear-gradient(to bottom, #3d2f00, #5a4500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.is_premium .mobile-plan:nth-child(3) .mobile-plan-name {
  color: #3d2f00;
}

/* Fondo de las celdas para plan Premium activo en móvil */
/* Usar clases zebra-odd/zebra-even agregadas por JS para un conteo continuo correcto */
.is_premium .mobile-plan:nth-child(3) .mobile-plan-features li.zebra-odd {
  background: linear-gradient(135deg, #fefce8 0%, #fef9e7 100%);
}

.is_premium .mobile-plan:nth-child(3) .mobile-plan-features li.zebra-even {
  background: linear-gradient(135deg, #fef9d9 0%, #fef5d7 100%);
}

/* Excluir los separadores del conteo de colores */
.is_premium .mobile-plan:nth-child(3) .mobile-plan-features .group-separator {
  background: transparent !important;
}

/* Badge dorado para Premium en móvil */
.mobile-plan-header.plan-premium-highlight .mobile-plan-badge {
  background: linear-gradient(90deg, #d4af37 0%, #f0d970 100%);
  color: #3d2f00;
  box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* Ocultar plan Start en móvil cuando el usuario tiene plan Pro */
.is_pro .mobile-plan:nth-child(1) {
  display: none;
}

/* Ocultar planes Start y Pro en móvil cuando el usuario tiene plan Premium */
.is_premium .mobile-plan:nth-child(1),
.is_premium .mobile-plan:nth-child(2) {
  display: none;
}

/* Mostrar todos los planes cuando se activa el toggle */
.is_pro.show-all-plans .mobile-plan:nth-child(1),
.is_premium.show-all-plans .mobile-plan:nth-child(1),
.is_premium.show-all-plans .mobile-plan:nth-child(2) {
  display: block;
}

/* Botón para mostrar/ocultar todos los planes */
.comparison-toggle-container {
  text-align: center;
  margin-top: 2rem;
  display: none;
}

.is_pro .comparison-toggle-container,
.is_premium .comparison-toggle-container {
  display: block;
}

.comparison-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #2d6d7e;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: 2px solid #4a90a4;
  border-radius: 8px;
  background: #e0f2f7;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(74, 144, 164, 0.2);
}

.comparison-toggle-btn:hover {
  background: #c5e8f1;
  border-color: #3d8298;
  color: #1e5463;
  box-shadow: 0 4px 12px rgba(74, 144, 164, 0.3);
}

.comparison-toggle-btn:active {
  background: #b3dce8;
  box-shadow: 0 2px 6px rgba(74, 144, 164, 0.25);
}

/* Iconos SVG dentro del botón */
.comparison-toggle-btn .toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.comparison-toggle-btn .toggle-icon svg {
  width: 100%;
  height: 100%;
}

/* Estado cuando muestra "Show only relevant plans" (todas las columnas visibles) */
.show-all-plans .comparison-toggle-btn {
  background: #e2e8f0;
  border-color: #64748b;
  color: #475569;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.show-all-plans .comparison-toggle-btn:hover {
  background: #cbd5e1;
  border-color: #475569;
  color: #334155;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.show-all-plans .comparison-toggle-btn:active {
  background: #b3c0cf;
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.25);
}

.mobile-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-plan-features li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.mobile-plan-features li:last-child {
  border-bottom: none;
}

.mobile-plan-feature-name {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

.mobile-plan-feature-value {
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;

}

.mobile-plan-feature-value .check-icon {
  margin-left: 0.4rem;
}

/* Mobile group separator */
.mobile-plan-features .group-separator {
  height: 1px;
  padding: 0;
  margin: 0;
  border-bottom: 2px solid #a4d2e9;
}

.mobile-plan-features .group-separator::before,
.mobile-plan-features .group-separator::after {
  display: none;
}

/* ===== RESPONSIVE SWITCH ===== */
@media (max-width: 768px) {
  .comparison-section {
    padding: 3rem 1rem;
  }
  .comparison-header {
    margin-bottom: 40px;
  }
  .comparison-header h2 {
    font-size: 32px;
    line-height: 1.3;
  }
  .comparison-header p {
    font-size: 16px;
  }
  .comparison-table th {
    padding: 2.5rem 0.5rem 1.2rem;
  }
}
@media (max-width: 680px) {
  .comparison-section {
    padding: 3rem 0.5rem;
  }
  .comparison-table .th2 {
    min-width: 110px;
  }
  .comparison-table .th3 {
    min-width: 110px;
  }
  .comparison-table .th4 {
    max-width: 110px;
  }
  .comparison-table td:first-child {
    padding-left: 0.5rem;
  }
}
@media (max-width: 603px) {
  .comparison-wrapper {
    display: none;
  }
  .comparison-mobile {
    display: block;
    width: 100%;
    max-width: 450px;
    padding: 1.5rem 0.25rem;
    margin: 0 auto;
  }
  .comparison-table td:first-child {
    padding-left: 1.5rem;
  }
}
@media (max-width: 450px) {
  .comparison-header h2 {
    font-size: 28px;
  }
  .comparison-header p {
    font-size: 15px;
  }
  .comparison-mobile {
    padding: 1.5rem 0rem;
  }
  .mobile-plan-features li {
    padding-left: 0.5rem;
    white-space: nowrap;
    min-width: 300px;
  }
}