/* ========================================
   RASTI - Formatos y Precios Page
   ======================================== */

/* Hero */
.formatos-hero-section {
    padding-top: calc(var(--navbar-height, 72px) + 2.5rem);
    padding-bottom: 2rem;
    background: #ffffff;
    text-align: center;
}

.formatos-hero-inner {
    width: min(680px, calc(100% - 2rem));
    max-width: 680px;
    margin: 0 auto;
}

.formatos-hero-title {
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.85rem;
    font-family: var(--font-display);
}

.formatos-hero-subtitle {
    font-size: 1.05rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0;
}

/* Fade-in: texto del header */
.formatos-fade-item {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.formatos-fade-item:nth-child(1) { transition-delay: 0ms; }
.formatos-fade-item:nth-child(2) { transition-delay: 100ms; }
.formatos-fade-item:nth-child(3) { transition-delay: 200ms; }

.formatos-fade-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade-in: cards de formato */
.formatos-card {
    opacity: 0;
    transform: translateY(40px) rotateX(12deg);
    transform-origin: top center;
    transition:
        opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    will-change: opacity, transform;
}

.formatos-card:nth-child(1) { transition-delay: 0ms; }
.formatos-card:nth-child(2) { transition-delay: 120ms; }
.formatos-card:nth-child(3) { transition-delay: 240ms; }

.formatos-card.is-visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

/* Sin animación para quienes lo prefieren */
.formatos-card .what-rasti-format-visual {
    background: rgba(189, 61, 117, 0.07);
    border: 1px solid rgba(189, 61, 117, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .formatos-fade-item,
    .formatos-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ── Sección pricing — fondo oscuro para contrastar con la sección blanca de arriba ── */
.formatos-pricing-section {
    padding: 3.5rem 0 4.5rem;
    background: #ffffff;
}

.formatos-pricing-inner {
    width: min(1080px, calc(100% - 4rem));
    margin: 0 auto;
}

/* Textos del encabezado sobre fondo blanco */
.formatos-pricing-inner .what-rasti-section-label {
    background: rgba(189, 61, 117, 0.1);
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.formatos-pricing-inner .what-rasti-section-title {
    color: #1f2433;
    white-space: normal;
    margin-bottom: 0.5rem;
}

.formatos-pricing-inner .what-rasti-section-text {
    color: #4b5163;
    margin-bottom: 0;
}

/* Wrapper: scroll horizontal + espacio extra arriba para el badge */
.pricing-table-wrapper {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Tabla */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    min-width: 560px;
}

/* ── Columnas — todas con mismo padding-top para alinear los botones ── */
.pt-feature-col {
    width: 38%;
}

.pt-col {
    width: 20.66%;
    text-align: center;
    vertical-align: top;
    padding: 2rem 0.75rem 1.5rem;
    border: none;
}

/* Columna destacada: transparencia del color primary, sin border-radius */
.pt-col-featured {
    background: rgba(189, 61, 117, 0.07);
    border: none;
    position: relative;
}

/* Badge "Más popular" — centrado en el espacio extra superior */
.pt-popular-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    white-space: nowrap;
    background: #7ee8e8;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
}

/* Botones de plan — todos igual, misma altura */
.pt-plan-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.9rem 1rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    background: var(--primary, #BD3D75);
    transition: filter 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.pt-plan-link:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.pt-plan-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

.pt-plan-price {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    display: block;
    line-height: 1.1;
}

.pt-plan-sub {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.82);
    display: block;
    line-height: 1.35;
}

/* ── Primera fila: más acentuada ── */
.pricing-table tbody tr:first-child {
    border-top: 2px solid #1f2433;
}

.pricing-table tbody tr:first-child .pt-feature {
    color: #1f2433;
    font-weight: 700;
    font-size: 0.92rem;
}

.pricing-table tbody tr:first-child .pt-check {
    color: #1f2433;
    font-size: 1.3rem;
}

/* ── Filas siguientes: grises, línea sutil ── */
.pricing-table tbody tr {
    border-top: 1px solid #e5e7eb;
    transition: background 0.15s ease;
}

.pricing-table tbody tr:hover {
    background: rgba(189, 61, 117, 0.03);
}

.pt-feature {
    padding: 0.95rem 0 0.95rem 0.25rem;
    font-size: 0.86rem;
    color: #6b7280;
    text-align: left;
    font-weight: 400;
}

.pt-cell {
    text-align: center;
    padding: 0.95rem 0.5rem;
    border: none;
}

/* Columna destacada: misma transparencia en cada fila */
.pt-cell-featured {
    background: rgba(189, 61, 117, 0.07);
}

.pt-check {
    color: #374151;
    font-size: 1.15rem;
    font-weight: 700;
    display: inline-block;
}

.pt-dash {
    color: #d1d5db;
    font-size: 1.1rem;
    font-weight: 400;
    display: inline-block;
}

.pt-value {
    color: #374151;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    display: inline-block;
    text-align: center;
}

/* ── Responsive móvil ── */
@media (max-width: 640px) {
    .formatos-pricing-inner {
        width: min(100%, calc(100% - 1.5rem));
    }

    .pricing-table-wrapper {
        padding-top: 1.25rem;
        padding-bottom: 0.35rem;
    }

    .pricing-table {
        min-width: 520px;
    }

    .pt-col {
        padding: 1.75rem 0.4rem 1rem;
    }

    .pt-plan-link {
        padding: 0.8rem 0.7rem 0.75rem;
        border-radius: 10px;
    }

    .pt-plan-name {
        font-size: 0.74rem;
        letter-spacing: 0.04em;
    }

    .pt-plan-price {
        font-size: 1.2rem;
    }

    .pt-plan-sub {
        font-size: 0.58rem;
    }

    .pt-popular-badge {
        font-size: 0.58rem;
        padding: 0.24rem 0.65rem;
    }

    .pt-feature {
        font-size: 0.78rem;
        padding: 0.85rem 0.5rem 0.85rem 0;
    }

    .pt-cell {
        padding: 0.85rem 0.25rem;
    }

    .pt-value {
        font-size: 0.72rem;
    }

    .formatos-card .what-rasti-format-copy {
        padding: 0 0.2rem 0.15rem;
    }

    .formatos-card .what-rasti-format-list {
        padding-left: 1rem;
    }
}

/* CTA */
.formatos-cta-section {
    padding: 1.5rem 0 2rem;
}

.formatos-cta {
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    .formatos-hero-section {
        padding-top: calc(var(--navbar-height, 72px) + env(safe-area-inset-top) + 1rem);
        padding-bottom: 1.75rem;
    }
}

@media (max-width: 640px) {
    .formatos-hero-inner {
        width: min(100%, calc(100% - 1.5rem));
        margin-top: 0;
    }

    .formatos-hero-title {
        font-size: clamp(1.85rem, 8vw, 2.3rem);
    }

    .formatos-hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
    }
}

@media (max-width: 420px) {
    .pricing-table {
        min-width: 470px;
    }

    .pt-col {
        padding: 1.6rem 0.3rem 0.9rem;
    }

    .pt-plan-link {
        padding: 0.72rem 0.55rem 0.68rem;
    }

    .pt-plan-price {
        font-size: 1.05rem;
    }

    .pt-plan-sub {
        font-size: 0.54rem;
        line-height: 1.25;
    }

    .pt-feature {
        font-size: 0.74rem;
    }

    .pt-check,
    .pt-dash {
        font-size: 1rem;
    }

    .pt-value {
        font-size: 0.68rem;
    }
}
