/* ===================================
   CART PRODUCTS LIST
   =================================== */
.cod-cart-products {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cod-cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.cod-cart-empty svg {
    width: 80px;
    height: 80px;
    color: #94a3b8;
    margin: 0 auto 20px;
}

.cod-cart-empty h3 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 8px;
}

.cod-cart-empty p {
    color: #64748b;
}

.cod-cart-item {
    display: flex;
    gap: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.cod-cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cod-cart-item-image {
    flex-shrink: 0;
}

.cod-cart-item-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.cod-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cod-cart-item-name {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.cod-cart-item-variations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.variation-tag {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
}

.cod-cart-item-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #64748b;
}

.cod-cart-item-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.cod-cart-edit-btn,
.cod-cart-remove-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cod-cart-remove-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.cod-cart-item-price {
    flex-shrink: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.item-subtotal {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.item-delivery {
    font-size: 13px;
    color: #64748b;
}

.cod-cart-checkout-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-top: 16px;
}

.cod-cart-checkout-btn:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* ===================================
   EDIT MODAL
   =================================== */
.cod-cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.cod-cart-modal-content {
    max-width: 600px;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cod-cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.cod-cart-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
}

.cod-cart-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 24px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cod-cart-modal-close:hover {
    background: #e2e8f0;
}

.cod-cart-modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.cod-edit-loader {
    text-align: center;
    padding: 40px 20px;
}

.cod-edit-loader .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid #e2e8f0;
    border-top-color: #121212;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#codCartEditContent {
    direction: rtl;
    text-align: right;
}

#codCartEditContent > label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    margin-top: 20px;
}

#codEditProductName {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 20px 0;
}

.cod-edit-quantity {
    margin: 20px 0;
}

.cod-edit-quantity label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.cod-edit-price-preview {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.cod-cart-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    direction: rtl;
}

.cod-btn-save {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cod-btn-save:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.cod-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cod-btn-cancel {
    padding: 12px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cod-btn-cancel:hover {
    background: #f1f5f9;
    color: #475569;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    /* Keep the row layout — just shrink the thumbnail */
    .cod-cart-item {
        flex-direction: row;
        gap: 12px;
        padding: 12px;
    }

    .cod-cart-item-image {
        flex-shrink: 0;
    }

    .cod-cart-item-image img {
        width: 72px;
        height: 72px;
        object-fit: cover;
    }

    .cod-cart-item-name {
        font-size: 15px;
    }

    .cod-cart-item-price {
        flex-direction: column;
        justify-content: center;
        text-align: left;
    }

    .item-subtotal {
        font-size: 16px;
    }

    .cod-cart-modal-content {
        margin: 20px auto;
    }
}