/* =========================================
   SLIDE-OUT SHOPPING CART
   ========================================= */

/* Overlay */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 400px;
    max-width: 100%;
    background: #ffffff;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}
.cart-panel.open {
    transform: translateX(0);
}

/* Header */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.cart-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
}
.cart-close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #555;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.cart-close-btn:hover {
    background: #f3f4f6;
    color: #111;
}

/* Body (scrollable items area) */
.cart-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

/* Empty state */
.cart-empty-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    gap: 0.5rem;
}
.cart-empty-msg p {
    font-size: 1.05rem;
    font-weight: 600;
    color: #555;
    margin-top: 0.5rem;
}
.cart-empty-msg span {
    font-size: 0.85rem;
    color: #999;
}

/* Individual cart item */
.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-img {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f5;
}
.cart-item-details {
    flex: 1;
    min-width: 0;
}
.cart-item-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-options {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.5;
}
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.45rem;
}
.cart-item-qty button {
    width: 26px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.cart-item-qty button:hover {
    background: #e5e7eb;
}
.cart-item-qty span {
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}
.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    flex-shrink: 0;
}
.cart-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}
.cart-item-remove {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.2s;
}
.cart-item-remove:hover {
    color: #991b1b;
    text-decoration: underline;
}

/* Footer (sticky bottom) */
.cart-footer {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.cart-subtotal-row span:first-child {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}
.cart-subtotal-row span:last-child {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
}
.cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background: #111;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}
.cart-checkout-btn:hover {
    background: #333;
}
