/* cart.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Inter', 'Poppins', sans-serif;
    background-color: #fff;
    color: #111;
    -webkit-font-smoothing: antialiased;
}

.cart-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    padding-bottom: 180px; /* Space for sticky footer and bottom nav */
    position: relative;
}

.cart-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.cart-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-left: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.back-link {
    color: #111;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.cart-items-list {
    padding: 0 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    animation: fadeIn 0.4s ease-in-out;
    position: relative;
    transition: opacity 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.item-img-placeholder {
    width: 85px;
    height: 110px;
    background-color: #f9f9f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.item-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 2rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    position: absolute;
    top: 1.5rem;
    right: 0;
    padding: 0.25rem;
    display: flex;
    transition: color 0.2s;
}
.btn-remove:hover { color: #000; }

.item-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.item-price {
    font-weight: 600;
    font-size: 1rem;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.item-actions {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 32px;
}

.qty-btn {
    background: #fff;
    border: none;
    width: 32px;
    height: 100%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s;
}

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

.qty-val {
    width: 32px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    line-height: 32px;
}

.cart-summary {
    padding: 2rem 1rem;
    background: #fff;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #555;
}

.summary-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 1.25rem 0;
}

.total-row {
    font-weight: 700;
    font-size: 1.15rem;
    color: #111;
    margin-bottom: 0;
}

.sticky-footer {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    background: #fff;
    padding: 1rem;
    border-top: 1px solid #eee;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
}

.pay-btn {
    width: 100%;
    max-width: 468px; 
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #111;
    color: #fff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pay-btn:hover:not(:disabled) { background: #333; transform: translateY(-1px); }
.pay-btn:disabled { background: #ccc; cursor: not-allowed; color: #fff; }

.err {
    color: #dc2626;
    margin: 0.5rem 1rem 0;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    max-width: 468px;
}

.empty-cart {
    text-align: center;
    padding: 5rem 1rem;
    color: #666;
}
.empty-cart svg {
    margin-bottom: 1.5rem;
    color: #ddd;
}
.empty-cart h2 {
    font-size: 1.25rem;
    color: #111;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.empty-cart p {
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.btn-shop {
    display: inline-block;
    padding: 14px 32px;
    background: #111;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.btn-shop:hover { background: #333; }

@media (min-width: 501px) {
    .sticky-footer {
        width: 500px;
        left: 50%;
        transform: translateX(-50%);
    }
}
