.purchase-course {
    .container {
        margin: auto;
        max-width: 98rem;
        padding: 0 2rem;
        padding-bottom: 6rem;
        padding-top: 6rem;

        h1 {
            text-align: left;

            &::after {
                margin-left: 0;
                left: 0;
            }
        }
    }

    .module-purchase-form {
        background-color: #f3f3f3;
        padding-top: 6rem;
        padding-bottom: 6rem;
        margin: 0 auto;

        .module-tabbed-content {
            max-width: 98rem;
            margin: auto;
            padding: 0;
            box-shadow: 0 14px 28px 0 rgba(0, 0, 0, .1);

            .tabs {
                display: -ms-flexbox;
                display: flex;

                .tab {
                    -ms-flex: 0 0 50%;
                    flex: 0 0 50%;
                    padding: 1rem;
                    padding-left: 2rem;
                    border-bottom: 1px solid #929d9e;
                }

                .active {
                    border: 1px solid #929d9e;
                    border-bottom: 0;
                    color: #db0f80;
                    font-weight: 700;
                }
            }

            .tabs-content {
                padding: 4rem 0;
                border: 1px solid #929d9e;
                border-top: 0;

                .container-form {
                    margin: 0 auto;
                    max-width: 78rem;
                    padding: 0 2rem;
                    position: relative;
                    width: 100%;

                    h2,
                    h3 {
                        font-size: 2.4rem;
                        margin-top: 2rem;
                        margin-bottom: 1rem;
                        font-family: "Montserrat", sans-serif;
                        font-weight: 900;
                        line-height: 1.1em;
                        text-align: center;
                    }

                    h3 {
                        font-size: 2rem;
                        margin-top: 3rem;
                    }

                    h4 {
                        font-size: 1.6rem;
                        font-weight: 700;
                        margin: 2rem 0 1rem 0;
                        color: #333;
                    }

                    form {
                        ul {
                            list-style: none;
                            padding: 0;

                            .field.wide {
                                margin: 1rem 0 2rem 0;

                                .hide {
                                    visibility: hidden;
                                    display: none;
                                }

                                label {
                                    display: block;
                                    margin-bottom: 0.5rem;
                                    font-weight: 600;
                                }

                                input[type=text],
                                input[type=email],
                                input[type=tel],
                                select {
                                    color: #757575;
                                    appearance: none;
                                    background-color: #fff;
                                    box-shadow: none;
                                    box-sizing: border-box;
                                    padding: 2rem;
                                    border: 1px solid #ddd;
                                    width: 100%;
                                    transition: .1s;
                                    line-height: 1.15;
                                    font-size: 1.6rem;
                                    border-radius: 4px;

                                    &:focus {
                                        outline: none;
                                        border-color: #db0f80;
                                    }

                                    &.error {
                                        border-color: #dc3545;
                                        border-width: 2px;
                                    }
                                }

                                .error-message {
                                    color: #dc3545;
                                    font-size: 1.4rem;
                                    margin-top: 0.5rem;
                                    margin-bottom: 0;
                                    font-weight: 500;
                                }

                                select {
                                    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23757575' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
                                    background-repeat: no-repeat;
                                    background-position: right 1.5rem center;
                                    padding-right: 4rem;
                                }
                            }

                            .field {
                                margin: 1rem 0 2rem 0;
                            }
                        }
                    }
                }

                /* Resumen de compra */
                .purchase-summary {
                    border: 1px solid #ddd;
                    border-radius: 8px;
                    padding: 2rem;
                    margin-bottom: 3rem;

                    .summary-item {
                        display: flex;
                        align-items: center;
                        gap: 1rem;
                        padding: 1rem 0;

                        &.total {
                            border-bottom: 2px solid #eee;
                            padding-bottom: 1.5rem;
                            margin-bottom: 1rem;

                            strong {
                                color: #4a5565;
                                font-size: 2.4rem;
                            }

                            .currency {
                                color: #666;
                                font-size: 1.4rem;
                            }
                        }

                        .icon {
                            font-size: 2.4rem;
                            color: #db0f80;
                        }
                    }
                }

                /* Métodos de pago */
                .payment-methods {
                    display: grid;
                    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
                    gap: 2rem;
                    margin: 3rem 0;

                    .payment-method-card {
                        background: white;
                        border: 2px solid #ddd;
                        border-radius: 12px;
                        padding: 2rem;
                        text-align: center;
                        cursor: pointer;
                        transition: all 0.3s;

                        &:focus {
                            border-color: #0ce8ab;
                        }

                        &.selected {
                            border-color: #0ce8ab;
                            border-width: 3px;
                            background: #f5fff9;
                        }

                        .payment-icon {
                            height: 80px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            margin-bottom: 1rem;

                            img {
                                max-width: 100%;
                                max-height: 120px;
                            }
                        }

                        p {
                            font-weight: 600;
                            font-size: 1.4rem;
                            margin: 0;
                        }
                    }
                }

                /* Contenido de métodos de pago */
                .payment-content {
                    border: 1px solid #ddd;
                    border-radius: 8px;
                    padding: 3rem;
                    margin-top: 2rem;

                    .error-banner {
                        background: #ffebee;
                        border-left: 4px solid #dc3545;
                        padding: 1.5rem;
                        margin-bottom: 2rem;
                        border-radius: 4px;

                        p {
                            color: #dc3545;
                            font-size: 1.6rem;
                            font-weight: 600;
                            margin: 0;
                        }
                    }

                    button:disabled {
                        opacity: 0.6;
                        cursor: not-allowed;
                    }

                    input:disabled,
                    select:disabled {
                        background-color: #f5f5f5;
                        cursor: not-allowed;
                    }

                    .bank-info {
                        padding: 2rem;
                        border-radius: 8px;
                        margin: 2rem 0;

                        ul {
                            list-style: none;
                            padding-left: 0;
                            margin: 1rem 0;

                            li {
                                padding: 0.5rem 0;
                                color: #555;

                                &:before {
                                    content: "•";
                                    color: #0ce8ab;
                                    padding-right: 1rem;
                                }
                            }
                        }
                    }

                    .bank-note,
                    .payment-note {
                        padding: 1.5rem;
                        margin-top: 2rem;
                        border-radius: 4px;
                        font-size: 1.8rem;
                        line-height: 1.6em;

                        a {
                            color: #564bfd;
                            font-weight: 600;
                            text-decoration: none;

                            &:hover {
                                text-decoration: underline;
                            }
                        }
                    }

                    .payment-instructions {
                        padding: 2rem 2rem 2rem 4rem;
                        border-radius: 8px;
                        margin: 2rem 0;

                        li {
                            padding: 0.8rem 0;
                            line-height: 1.6;
                            color: #333;
                        }
                    }
                }
            }
        }
    }
}


/* Alpine.js x-cloak */
[x-cloak] {
    display: none !important;
}

@media screen and (min-width: 992px) {
    .purchase-course {
        .container {
            padding-bottom: 8rem;
            padding-top: 8rem;
        }

        .module-purchase-form {
            padding-top: 8rem;
            padding-bottom: 8rem;
        }
    }
}

@media screen and (min-width: 768px) {
    .purchase-course {
        .module-purchase-form {
            .module-tabbed-content {
                .tabs-content {
                    .container-form {
                        form {
                            ul {
                                .field.wide {
                                    flex: 0 0 100%;
                                    max-width: 100%;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}