/* ==========================================================================
   ATEMPO — DISEÑO DE TARJETAS DE PLANES Y PRECIOS
   Adaptado con fidelidad a la identidad oficial de Atempo (Marrón #572C19 y Cintas Negras)
   Formato compacto y equilibrado para visualización óptima
   ========================================================================== */

/* Contenedor en cuadrícula responsive */
.ref-pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: 58rem; /* Compactado a 928px para encajar armónicamente en viewport */
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .ref-pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Tarjeta base: proporciones más compactas sin alterar la jerarquía */
.ref-pricing-card {
  position: relative;
  background-color: #FFFFFF;
  border-radius: 22px;
  border: 1px solid #E7E4DE;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px -2px rgba(23, 22, 20, 0.05), 0 2px 6px -1px rgba(23, 22, 20, 0.03);
  overflow: hidden;
  isolation: isolate;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 250ms ease, border-color 200ms ease;
}

@media (min-width: 640px) {
  .ref-pricing-card {
    padding: 2rem 2rem;
  }
}

.ref-pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px -8px rgba(23, 22, 20, 0.08), 0 6px 12px -3px rgba(23, 22, 20, 0.04);
}

/* Tarjeta destacada: Plan Básico en Marrón Institucional Atempo (#572C19) */
.ref-pricing-card.ref-featured {
  border: 2px solid #572C19;
  box-shadow: 0 16px 36px -10px rgba(87, 44, 25, 0.16), 0 6px 14px -3px rgba(87, 44, 25, 0.06);
}

.ref-pricing-card.ref-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 42px -10px rgba(87, 44, 25, 0.22), 0 8px 18px -4px rgba(87, 44, 25, 0.08);
}

/* Cintas diagonales en la esquina superior derecha: COLOR NEGRO (#171614) */
.ref-ribbon-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 125px;
  height: 125px;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
  border-top-right-radius: 22px;
}

.ref-ribbon {
  position: absolute;
  top: 24px;
  right: -36px;
  width: 160px;
  transform: rotate(45deg);
  background: #171614;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 5px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Variante de cinta para Plan Complejo (Próximamente): también NEGRA */
.ref-ribbon.ref-ribbon-secondary {
  background: #171614;
  color: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Tipografía de la tarjeta: compactada armónicamente */
.ref-card-title {
  font-size: 1.35rem; /* ~21.6px */
  font-weight: 800;
  color: #171614;
  letter-spacing: -0.02em;
}

.ref-card-price-row {
  display: flex;
  align-items: baseline;
  margin-top: 0.5rem;
}

.ref-card-price-num {
  font-size: 2.35rem; /* ~37.6px */
  font-weight: 800;
  color: #171614;
  letter-spacing: -0.03em;
  line-height: 1;
}

@media (min-width: 640px) {
  .ref-card-price-num {
    font-size: 2.75rem; /* 44px */
  }
}

.ref-card-price-period {
  font-size: 0.8125rem; /* 13px */
  font-weight: 500;
  color: #6B6862;
  margin-left: 0.45rem;
}

.ref-card-subprice {
  font-size: 0.775rem; /* ~12.4px */
  font-weight: 500;
  color: #572C19;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.ref-card-description {
  font-size: 0.8125rem; /* 13px */
  color: #6B6862;
  margin-top: 0.5rem;
  line-height: 1.5;
  min-height: 38px;
}

/* Divisor sutil */
.ref-card-divider {
  margin-top: 0.875rem;
  margin-bottom: 0.875rem;
  border-top: 1px solid #E7E4DE;
}

/* Lista de características: espaciado optimizado */
.ref-card-features-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.ref-card-feature-item {
  display: flex;
  align-items: flex-start;
  font-size: 0.8125rem; /* 13px */
  color: #2D2B28;
  line-height: 1.4;
}

.ref-card-feature-icon {
  width: 0.95rem;
  height: 0.95rem;
  color: #572C19; /* Marrón institucional Atempo */
  margin-right: 0.55rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* Botón principal (Contratar Plan Básico - Marrón institucional Atempo) */
.ref-btn-primary {
  background-color: #572C19;
  color: #FFFFFF;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  box-shadow: 0 4px 14px rgba(87, 44, 25, 0.22);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.ref-btn-primary:hover {
  background-color: #432213;
  box-shadow: 0 6px 18px rgba(87, 44, 25, 0.32);
  transform: translateY(-1px);
}

.ref-btn-primary:active {
  background-color: #30180D;
  transform: translateY(0);
}

/* Botón deshabilitado (Plan Complejo) */
.ref-btn-disabled {
  background-color: #F6F5F2;
  color: #8C887E;
  border: 1px solid #E7E4DE;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: not-allowed;
  opacity: 0.85;
}

/* Switcher / Toggle mensual de facturación (Marrón Atempo) */
.ref-toggle-container {
  display: inline-flex;
  align-items: center;
  background-color: #F2EFE9;
  padding: 4px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid #E7E4DE;
}

.ref-toggle-active {
  background-color: #572C19;
  color: #FFFFFF;
  padding: 5px 16px;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(87, 44, 25, 0.2);
}

.ref-toggle-inactive {
  padding: 5px 14px;
  color: #6B6862;
}

.ref-toggle-badge {
  color: #572C19;
  font-weight: 600;
  font-size: 0.75rem;
  margin-left: 4px;
}

/* ==========================================================================
   MODAL DE CHECKOUT COMERCIAL REDISEÑADO (3 BLOQUES FUNCIONALES)
   ========================================================================== */
.commercial-modal-dialog {
  background-color: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #E7E4DE;
  max-width: 32rem; /* 512px para mayor amplitud y claridad */
  width: 100%;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 25px 60px -15px rgba(23, 22, 20, 0.3), 0 10px 24px -6px rgba(23, 22, 20, 0.1);
  transform: scale(0.96) translateY(8px);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .commercial-modal-dialog {
    padding: 2rem;
  }
}

.commercial-modal-backdrop.is-open .commercial-modal-dialog {
  transform: scale(1) translateY(0);
}

/* Bloques modulares del checkout */
.checkout-block {
  background-color: #FAFAF8;
  border: 1px solid #E7E4DE;
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.875rem;
  transition: border-color 150ms ease;
}

.checkout-summary-block {
  background-color: #FAF0EB;
  border-color: #E8D8CF;
}

.checkout-transfer-block {
  background-color: #FAFAF8;
  border-color: #E7E4DE;
}

.checkout-whatsapp-block {
  background-color: #F8FAF8;
  border-color: #D1E7DD;
}

/* Caja de alias con botón de copiado */
.checkout-alias-box {
  background-color: #FFFFFF;
  border: 1px solid #E7E4DE;
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-copy-alias-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: #FFFFFF;
  border: 1px solid #D4D0C8;
  color: #171614;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
  flex-shrink: 0;
  user-select: none;
}

.btn-copy-alias-custom:hover {
  background-color: #F6F5F2;
  border-color: #572C19;
  color: #572C19;
}

.btn-copy-alias-custom.is-copied {
  background-color: #E8F5E9;
  border-color: #A5D6A7;
  color: #1B5E20;
}

/* Botón de WhatsApp destacado para comprobante y consultas */
.btn-whatsapp-checkout {
  background-color: #25D366;
  color: #FFFFFF !important;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none !important;
  width: 100%;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.28);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}

.btn-whatsapp-checkout:hover {
  background-color: #20BD5A;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.36);
  color: #FFFFFF !important;
}

.btn-whatsapp-checkout:active {
  transform: translateY(0);
}

/* Área secundaria / subordinada */
.checkout-subordinate-box {
  padding-top: 0.75rem;
  border-top: 1px dashed #E7E4DE;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ==========================================================================
   ATEMPO — ESPACIADO PRE-FOOTER Y DESPLEGABLE DE BENEFICIOS (PLANES.HTML)
   ========================================================================== */

/* Espaciado pre-footer en planes.html (conservando padding superior original: 2rem en móvil, 3rem en tablet y 3.5rem en escritorio) */
.planes-main {
  padding-top: 2rem;
  padding-bottom: 5.5rem;
}

@media (min-width: 640px) {
  .planes-main {
    padding-top: 3rem;
    padding-bottom: 7.5rem;
  }
}

@media (min-width: 1024px) {
  .planes-main {
    padding-top: 3.5rem;
    padding-bottom: 9.5rem;
  }
}

/* Botón discreto «Más información» en Plan Complejo */
.ref-details-accordion {
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
}

.ref-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  padding: 0.35rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: 6px;
  color: #572C19;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
  user-select: none;
}

.ref-details-toggle:hover {
  color: #432213;
  background-color: #FAF0EB;
}

.ref-details-toggle:focus-visible {
  outline: 2px solid #572C19;
  outline-offset: 2px;
}

.ref-details-toggle-icon {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ref-details-toggle[aria-expanded="true"] .ref-details-toggle-icon {
  transform: rotate(180deg);
}

/* Contenido desplegable animado con CSS grid */
.ref-details-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  opacity: 0;
  visibility: hidden;
}

.ref-details-content.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #E7E4DE;
}

.ref-details-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Grupos de categorías detalladas */
.ref-detail-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #171614;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ref-detail-group-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #572C19;
  flex-shrink: 0;
}

.ref-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.75rem;
}

.ref-detail-list li {
  position: relative;
  font-size: 0.75rem;
  color: #6B6862;
  line-height: 1.4;
  padding-left: 0.65rem;
}

.ref-detail-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: #8C887E;
}
