﻿.cart-page {
    --primary: #1f8f2e;
    --primary-700: #187326;
    --bg: #f6f8f7;
    --text: #172217;
    --muted: #5f6b5f;
    --border: rgba(0,0,0,.10);
    --top-gap: 16px;
    --bottom-nav: 50px;
    margin-top: 40px;

    min-height: 100vh;
    background: radial-gradient(800px 400px at 20% 10%, rgba(31,143,46,.12), transparent 60%), radial-gradient(900px 500px at 80% 0%, rgba(31,143,46,.10), transparent 55%), var(--bg);
    padding: var(--top-gap) 16px calc(140px + var(--bottom-nav) + env(safe-area-inset-bottom));
    font-family: system-ui, -apple-system, Segoe UI, Roboto;
}

.cart-shell {
    max-width: 980px;
    margin: 0 auto;
}

.muted {
    color: var(--muted);
}

.dot {
    opacity: .7;
}

.w-full {
    width: 100%;
}

/* Card no estilo Perfil.css */
.cardCart {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,.08);
    padding: 16px;
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* Empty */
.cart-empty {
    text-align: center;
    padding: 18px;
}

    .cart-empty h2 {
        margin: 8px 0 4px;
        color: var(--text);
        font-size: 18px;
        letter-spacing: -0.2px;
    }

    .cart-empty p {
        margin: 0 0 14px;
        font-size: 13px;
    }

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 6px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(31,143,46,.08);
    border: 1px solid rgba(31,143,46,.18);
    font-size: 26px;
}

/* Loading skeleton */
.cart-loading {
    padding: 18px;
}

.skeleton-line {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,.03), rgba(0,0,0,.06));
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    margin-top: 10px;
}

    .skeleton-line:first-child {
        margin-top: 0;
    }

.w60 {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Lista */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Item */
.cart-item {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 12px;
    align-items: start;
}

.item-left {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.item-img {
    width: 86px;
    height: 86px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.02);
}

    .item-img.placeholder {
        background: radial-gradient(120px 80px at 30% 20%, rgba(31,143,46,.10), rgba(0,0,0,.03));
    }

.item-body {
    min-width: 0;
}

.item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.item-title {
    min-width: 0;
}

.item-name {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-unit {
    margin-top: 6px;
    font-size: 13px;
}

.item-notes {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px dashed rgba(0,0,0,.14);
    background: rgba(0,0,0,.015);
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.notes-text {
    word-break: break-word;
    color: var(--text);
}

.item-bottom {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.qty-btn {
    width: 38px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--text);
}

    .qty-btn:active {
        background: rgba(0,0,0,.04);
    }

.qty-value {
    width: 36px;
    text-align: center;
    font-weight: 800;
    color: var(--text);
    font-size: 13px;
}

.item-total {
    text-align: right;
}

    .item-total strong {
        display: block;
        margin-top: 2px;
        color: var(--text);
        font-size: 15px;
    }

.btn-primary {
    height: 46px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform .04s ease, background .12s ease;
    box-shadow: 0 14px 30px rgba(31,143,46,.18);
}

    .btn-primary:hover {
        background: var(--primary-700);
    }

    .btn-primary:active {
        transform: translateY(1px);
    }

.btn-ghost-danger {
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(220, 53, 69, .28);
    background: rgba(220, 53, 69, .06);
    color: #b02a37;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .04s ease, background .12s ease;
    user-select: none;
}

    .btn-ghost-danger:hover {
        background: rgba(220, 53, 69, .10);
    }

    .btn-ghost-danger:active {
        transform: translateY(1px);
    }

.btn-link {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13px;
    user-select: none;
}

    .btn-link.danger {
        color: #b02a37;
    }

        .btn-link.danger:hover {
            background: rgba(220, 53, 69, .08);
        }

.cart-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bottom-nav);
    z-index: 50;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
    background: rgba(246,248,247,.78);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,.08);
    margin-bottom: 15px;
}

.cart-footer-inner {
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,.08);
    padding: 12px;
    display: grid;
    gap: 6px;
}

.total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 6px;
}

    .total-row strong {
        color: var(--text);
        font-size: 18px;
        letter-spacing: -0.2px;
    }

@media (min-width: 900px) {
    .cart-page {
        padding-top: calc(var(--top-gap) + 8px);
    }

    .cart-item {
        grid-template-columns: 94px 1fr;
    }

    .item-img {
        width: 94px;
        height: 94px;
    }
}

@media (max-width: 420px) {
    .cart-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .cart-footer {
        padding-left: 12px;
        padding-right: 12px;
        margin-bottom: 0px;
    }
}
