.custom-cart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    display: none;
    z-index: 9998;
}

.custom-cart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, calc(100vw - 40px));
    max-height: 80vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 9999;
    overflow: hidden;
    border: 1px solid #ece5de;
}

.custom-cart-modal.active,
.custom-cart-modal-overlay.active {
    display: block;
}

.custom-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #efe8e1;
}

.custom-cart-header h3 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #1c1c1c;
}

.custom-cart-close {
    border: none;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #1c1c1c;
    padding: 0;
}

.custom-cart-body {
    padding: 10px 28px;
    max-height: 52vh;
    overflow-y: auto;
}

.custom-cart-items {
    display: flex;
    flex-direction: column;
}

.cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f1ece6;
}

.cart-item__media img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.cart-item__content {
    min-width: 0;
}

.cart-item__title {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: #1f1f1f;
    margin-bottom: 6px;
    word-break: break-word;
}

.cart-item__meta {
    font-size: 14px;
    color: #5a524b;
}

.cart-item__meta span {
    font-weight: 600;
    color: #1f1f1f;
}

.cart-item__controls {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-self: end;
}

.cart-item__qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d9cec2;
    background: #fff;
    color: #1f1f1f;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.qty-btn:hover {
    background: #f8f4f0;
}

.qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f1f1f;
}

.cart-item__subtotal {
    min-width: 120px;
    text-align: right;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    color: #1f1f1f;
}

.cart-remove-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d9cec2;
    background: #fff;
    color: #7c6f63;
    border-radius: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.cart-remove-btn:hover {
    background: #f8f4f0;
    color: #ce332e;
    border-color: #cdbdb0;
}

.custom-cart-footer {
    border-top: 1px solid #efe8e1;
    padding: 18px 28px 22px;
}

.custom-cart-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.custom-cart-total-label {
    font-size: 18px;
    font-weight: 600;
    color: #1f1f1f;
}

.custom-cart-total-value {
    font-size: 26px;
    font-weight: 700;
    color: #1f1f1f;
}

.custom-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.custom-cart-continue {
    border: 1px solid #d7cabd;
    background: #fff;
    color: #1f1f1f;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.custom-cart-continue:hover {
    background: #f8f5f1;
}

.custom-cart-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 13px 22px;
    border-radius: 12px;
    background: #ce332e;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
}

.custom-cart-checkout:hover {
    background: #ce332e;
    color: #fff;
}

.custom-cart-empty {
    padding: 24px 0;
    font-size: 18px;
    color: #333;
}

@media (max-width: 900px) {
    .custom-cart-modal {
        width: calc(100vw - 16px);
        max-height: 88vh;
        border-radius: 16px;
    }

    .custom-cart-header,
    .custom-cart-body,
    .custom-cart-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .custom-cart-header h3 {
        font-size: 24px;
    }

    .custom-cart-body {
        max-height: 54vh;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 12px;
    }

    .cart-item__media img {
        width: 60px;
        height: 82px;
    }

    .cart-item__title {
        font-size: 17px;
    }

    .cart-item__meta {
        font-size: 13px;
    }

    .cart-item__controls {
        grid-column: 1 / -1;
        justify-self: stretch;
        justify-content: space-between;
        flex-wrap: wrap;
        padding-left: 72px;
        gap: 10px;
    }

    .cart-item__subtotal {
        min-width: auto;
        font-size: 18px;
    }

    .custom-cart-total-row {
        justify-content: flex-start;
    }

    .custom-cart-total-value {
        font-size: 22px;
    }

    .custom-cart-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-cart-checkout,
    .custom-cart-continue {
        width: 100%;
        text-align: center;
    }
}