@import url('https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,200..800;1,200..800&family=Noto+Sans:ital,wght@0,100..900;1,100..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Red+Hat+Text:ital,wght@0,300..700;1,300..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
/*400 600 700 */

:root {
    --Red: hsl(14, 86%, 42%);
    --Green: hsl(159, 69%, 38%);
    --Rose-50: hsl(20, 50%, 98%);
    --Rose-100: hsl(13, 31%, 94%);
    --Rose-300: hsl(14, 25%, 72%);
    --Rose-400: hsl(7, 20%, 60%);
    --Rose-500: hsl(12, 20%, 44%);
    --Rose-900: hsl(14, 65%, 9%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Karla';
}

body {
    padding: 2em;
    background-color: var(--Rose-100);
}

body main {
    display: flex;
    flex-direction: column;
    gap: 4em;
    position: relative;
}

.desserts-title {
    font-size: 3em;
    font-weight: 700;
}

.desserts-container {
    padding-top: 2em;
    display: grid;
    gap: 2em;
}

article {
    position: relative;
}

article.active>img {
    border: 1px solid var(--Red);
}

article img {
    width: 100%;
    border-radius: 10px;
}

.category-product {
    color: var(--Rose-300);
    margin-top: 1.5em;
}

.name-product {
    margin-top: .2em;
}

.price-product {
    color: var(--Red);
    margin-top: .2em;
}

.actions-product {
    width: 45%;
    height: 2.5em;
    border-radius: 2em;
    background-color: var(--Rose-50);
    border: 1px solid var(--Rose-500);
    position: relative;
    top: -115px;
    left: 50%;
    transform: translateX(-50%);
}

.add-btn {
    background-color: transparent;
    border: none;
    width: 100%;
    height: 100%;
    /* display: none; */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    gap: 5px;
}

.add-btn img {
    width: auto;
}

.count-product {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-around;
    background-color: var(--Red);
    border-radius: 2em;
    border: none;
    color: var(--Rose-50);
    /* display: flex; */
    display: none;
}

.count-product button.decrement-btn,
.count-product button.increment-btn {
    background-position: center;
    background-repeat: no-repeat;
    padding: .6em;
    border: 1px solid var(--Rose-50);
    border-radius: 50%;
    background-color: transparent;
}

.count-product button.decrement-btn {
    background-image: url("./assets/images/icon-decrement-quantity.svg");
}

.count-product button.increment-btn {
    background-image: url("./assets/images/icon-increment-quantity.svg");
}

section.cart {
    background-color: var(--Rose-50);
    padding: 1.5em;
    border-radius: 10px;
}

section.cart h2 {
    color: var(--Red);
    font-weight: 800;
}

.empty-cart {
    margin-top: 2em;
    /* display: none; */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-cart p {
    margin-top: 1em;
    color: var(--Rose-500);
}

.full-cart {
    display: none;
}

.list-cart {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2em;
    margin-top: 1.5em;
}

.list-cart li {
    border-bottom: 1px solid var(--Rose-100);
    position: relative;
}

.delete-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-image: url("./assets/images/icon-remove-item.svg");
    background-position: center;
    background-repeat: no-repeat;
    padding: .7em;
    border: 1px solid var(--Rose-400);
    border-radius: 50%;
    background-color: transparent;
}

li .li-name {
    font-weight: 700;
    margin-bottom: 1em;
    color: var(--Rose-900);
}

li .li-info {
    display: flex;
    gap: 1em;
}

li .li-cantity {
    color: var(--Red);
}

li .li-price {
    color: var(--Rose-500);
}

li .li-total {
    color: var(--Rose-900);
}

.total-amount {
    margin-top: 2.5em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--Rose-900);
}

.total {
    font-size: 2em;
    font-weight: 700;
}

.msg {
    margin-top: 2em;
    display: flex;
    align-items: center;
    gap: .3em;
    color: var(--Rose-900);
}

.confirm-btn,
.newOrden-btn {
    margin-top: 1.2em;
    background-color: var(--Red);
    color: var(--Rose-100);
    width: 100%;
    padding: .8em 0;
    border: none;
    border-radius: 2em;
    font-size: 1.2rem;
    font-weight: 500;
}

/*popup*/
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    /* fondo negro transparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: scroll;
}

.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.hidden {
    display: none;
}

.popup {
    position: absolute;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background-color: var(--Rose-50);
    padding: 2em;
    z-index: 3;
    width: 100%;
    max-height: 100dvh;
    left: 0;
    top: 100px;
    border-top-left-radius: 1.5em;
    border-top-right-radius: 1.5em;
    overflow-y: scroll;
}

.popup>img {
    width: 3em;
}

.popup h2 {
    font-size: 2.5em;
    font-weight: 800;
    margin-top: .5em;
}

.popup>p {
    margin-top: .5em;
    color: var(--Rose-500);
    font-weight: 400;
}

.list-container {
    padding: 1.5em;
    margin-top: 2em;
    background-color: var(--Rose-100);
}

.mini-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.mini-list li {
    display: flex;
    align-items: center;
    /* centra verticalmente */
    gap: 12px;
    /* espacio entre elementos */
    padding: 1.2em 0;
    border-bottom: 1px solid var(--Rose-300);
}

.mini-list li:first-of-type {
    padding-top: 0;
}

.mini-list li img {
    width: 20%;
    /* ajusta al tamaño que quieras */
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.mini-list li div {
    display: flex;
    gap: 10px;
    flex-direction: column;
    /* apila los <p> */
    flex: 1;
    /* ocupa el espacio disponible */
    min-width: 0;
    /* 🔑 necesario para que funcione el ellipsis */
}

.name-product {
    white-space: nowrap;
    /* evita salto de línea */
    overflow: hidden;
    /* oculta lo que sobra */
    text-overflow: ellipsis;
    /* muestra los "..." */
    font-weight: 600;
    color: var(--Rose-900);
}

.info-product span {
    margin-right: 6px;
}

.prices {
    display: flex;
    gap: 10px;
}

.product-amount {
    color: var(--Red);
    font-weight: 500;
}

.product-price {
    color: var(--Rose-500);
}

.total-product {
    flex-shrink: 0;
    /* evita que se comprima */
    margin-left: auto;
    /* lo empuja a la derecha */
    font-weight: 600;
    color: var(--Rose-900);
}

.list-container .total-amount {
    margin-top: 1.5em;
}

@media (min-width: 1000px) {
    body main {
        flex-direction: row;
    }

    button {
        cursor: pointer;
    }

    .products {
        flex: 2;
    }

    .desserts-container {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        grid-column-gap: 1em;
        grid-row-gap: 1em;
    }

    .product .actions-product:hover {
        border: 1px solid var(--Red);
    }

    .count-product button:hover {
        background-color: var(--Rose-50);
    }

    .count-product button:hover.decrement-btn {
        background-image: url("./assets/images/icon-decrement-quantity\ \(hover\).svg");
    }

    .count-product button:hover.increment-btn {
        background-image: url("./assets/images/icon-increment-quantity\ \(hover\).svg");
    }

    .cart {
        flex: 1;
        height: fit-content;
    }

    .delete-btn:hover {
        border: 1px solid var(--Rose-900);
        background-image: url("./assets/images/icon-remove-item\ \(hover\).svg");
    }

    .confirm-btn:hover {
        filter: brightness(85%);
        /* reduce la luz → más oscuro */
    }

    .popup {
        position: absolute;
        display: flex;
        flex-direction: column;
        cursor: pointer;
        background-color: var(--Rose-50);
        padding: 2em;
        z-index: 3;
        width: 50%;
        max-height: 100dvh;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 1.5em;
    }
}