﻿.name-2line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.25rem;
    max-height: 2.5rem;
}

.js-line {
    transition: box-shadow .2s ease, transform .05s ease;
}

    .js-line:hover {
        box-shadow: 0 6px 16px rgba(0,0,0,.06);
    }

#js-cart-totals {
    box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.toast-area {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
    width: min(96vw,680px);
}

.toast-item {
    pointer-events: auto;
    background: #111827;
    color: #fff;
    padding: .625rem .875rem;
    border-radius: .75rem;
    box-shadow: 0 10px 20px rgba(0,0,0,.18);
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    opacity: .98;
}

    .toast-item.success {
        background: #065f46;
    }

    .toast-item.error {
        background: #7f1d1d;
    }

    .toast-item.info {
        background: #1f2937;
    }

@media (max-width: 640px) {
    .toast-item {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
}

.cart-line {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    grid-template-areas:
        "img info del"
        "img qty qty"
        "img prices prices";
    column-gap: 12px;
    row-gap: 10px;
    align-items: start;
}

.cart-line-img {
    grid-area: img;
    width: 96px;
    height: 48px;
    border-radius: 12px;
    background: #f3f4f6;
    object-fit: contain;
    display: block;
}

.cart-line-info {
    grid-area: info;
    min-width: 0;
}

.cart-line-variant {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-line-del {
    grid-area: del;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #fee2e2;
    background: #fff;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .cart-line-del:hover {
        background: #fef2f2;
        border-color: #fecaca;
    }

.cart-line-qty {
    grid-area: qty;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.cart-line-prices {
    grid-area: prices;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.cart-line-unit,
.cart-line-sub {
    white-space: nowrap;
    font-size: 14px;
}

.cart-line-unit {
    opacity: .9;
}

.cart-line-sub {
    font-weight: 700;
}

@media (min-width: 640px) {
    .cart-line {
        grid-template-columns: 110px 1fr 120px 180px 120px 44px;
        grid-template-areas: "img info unit qty sub del";
        align-items: center;
        row-gap: 0;
    }

    .cart-line-img {
        width: 110px;
        height: 55px;
    }

    .cart-line-prices {
        display: contents;
    }

    .cart-line-unit {
        grid-area: unit;
        text-align: right;
        font-size: 14px;
    }

    .cart-line-sub {
        grid-area: sub;
        text-align: right;
        font-size: 14px;
    }

    .cart-line-qty {
        grid-area: qty;
        justify-content: center;
    }

    .cart-line-del {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border-color: #e5e7eb;
        color: #dc2626;
    }

        .cart-line-del:hover {
            background: #f9fafb;
            border-color: #e5e7eb;
        }
}

@media (min-width: 1024px) {
    .cart-line {
        grid-template-columns: 132px 1fr 130px 190px 130px 44px;
    }

    .cart-line-img {
        width: 132px;
        height: 66px;
    }
}
