@use "base/variables" as v;
@use "base/mixins" as m;

.carrito-view {

    .nombre-pagina {
        
        h1 {
            margin-top: 5rem;
    
            @include m.tabletV2 {
                margin-top: 7rem;
            }
        }
    }

    .contenedor {

        .producto {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 2rem;
            padding: 1rem;
            border: 1px solid v.$gris;
            border-radius: 0.5rem;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            text-align: center;

            @include m.tabletV2 {
                // Flexbox para distribución horizontal en pantallas grandes
                flex-direction: row;
                justify-content: space-between;
                align-items: flex-start;
            }

            .image {
                flex: 0 0 15rem;
                max-width: 15rem;
                margin-right: 1rem;
                
                @include m.tabletV2 {
                    margin-right: 2rem;
                    margin-bottom: 0;
                }

                img {
                    width: 100%;
                    height: auto;
                    border-radius: 0.5rem;
                }
            }

            .detalles {
                flex: 1;
                margin-top: 1rem;
                margin-left: 1rem;

                @include m.tabletV2 {
                    margin-top: 0;
                    margin-left: 2rem;
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                }

                h2 {
                    font-size: 2.5rem;
                    margin-bottom: 0.5rem;

                    span {
                        color: v.$rosa;
                    }
                }

                p {
                    font-size: 1.6rem;
                    margin-bottom: 0.5rem;

                    span {
                        color: v.$rosa;
                    }
                }
            }

            .acciones-orden {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                margin-top: 1rem;

                @include m.tabletV2 {
                    flex-direction: column;
                    align-items: flex-end;
                    margin-top: 0;
                }

                .opciones-cantidad {
                    display: flex;
                    align-items: center;
                    margin-bottom: 1rem;

                    button {
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        width: 2.5rem;
                        height: 2.5rem;
                        margin: 0 0.5rem;
                        font-size: 1.5rem;
                        background-color: v.$grisOscuro;
                        color: v.$blanco;
                        border-radius: 50%;
                        text-decoration: none;
                        transition: background-color 0.3s ease;

                        &:hover {
                            background-color: darken(v.$rosaClaro, 10%);
                        }
                    }
                }

                .boton-eliminar {
                    border-radius: 1rem;
                }

                @include m.tabletV2 {
                    margin-top: 0;
                }
            }
        }
    }

    h3 {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px solid v.$gris;
        font-size: 2rem;
        text-align: right;
    }

    .iva {
        color: #aaa;
        margin-top: 2rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid v.$gris;
        font-size: 2rem;
        text-align: right;
    }

    .opciones {
        display: flex;
        justify-content: space-between;
        margin-top: 2rem;

        .boton-aprobar {
            border-radius: 1rem;
        }
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);

    .modal-content {
        background-color: v.$blanco;
        margin: 15% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
        border-radius: 1rem;

        h2 {
            border-bottom: 1px solid v.$gris;
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;

            &:hover,
            &:focus {
                color: black;
                text-decoration: none;
                cursor: pointer;
            }
        }

        .modal-body {

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

                li {
                    border-bottom: 1px solid v.$gris;
                    padding-bottom: 1rem;
                    margin-bottom: 2rem;
                }
            }

            .acciones-carrito {
                display: flex;
                justify-content: space-between;

                .ver-carrito {

                    flex-grow: 1;
                    gap: 1rem;
                    margin-right: 1rem;

                    @include m.boton(v.$amarillo, v.$blanco);
                    
                    @include m.tabletV2 {
                        width: auto;
                    }
                }

            }
            .redireccionar {
                margin-top: 1rem;

                .boton-aprobar {
                    border-radius: 1rem;
                }

                .boton-azul {
                    border-radius: 1rem;
                }
            }
        }
    }
}