/**
 * Ma Selection Cart Styles
 */

/* Main container */
.cdv2-selection-cart {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    transform: translateX(100%);
}

.cdv2-selection-cart.active {
    transform: translateX(0) !important;
}

.cdv2-selection-cart.expanded {
    transform: translateX(0) !important;
}

/* Header */
.cdv2-selection-header {
    background-color: #24455B;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.cdv2-selection-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cdv2-selection-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdv2-selection-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    padding: 0 4px;
}

.cdv2-selection-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: #24455B;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
}

/* Content */
.cdv2-selection-content {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cdv2-selection-cart.expanded .cdv2-selection-content {
    max-height: none;
}

/* Empty state */
.cdv2-selection-empty {
    text-align: center;
    color: #666;
    padding: 20px 0;
}

.cdv2-selection-empty p {
    margin: 5px 0;
}

/* Items list */
.cdv2-selection-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cdv2-selection-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cdv2-selection-item:last-child {
    border-bottom: none;
}

.cdv2-selection-item-details {
    flex: 1;
}

.cdv2-selection-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.cdv2-selection-item-finance {
    font-size: 14px;
    color: #666;
}

.cdv2-selection-item-type {
    margin: 0 0 3px 0;
}

.cdv2-selection-item-payment {
    margin: 0;
    color: #24455B;
    font-weight: 600;
}

.cdv2-selection-remove {
    background: none;
    border: none;
    color: #f44336;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
}

/* Actions */
.cdv2-selection-actions {
    margin-top: 15px;
    text-align: center;
}

.cdv2-selection-checkout {
    width: 100%;
    padding: 12px;
    background-color: #24455B;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cdv2-selection-checkout:hover {
    background-color: #183243;
}

/* Form dialog */
.cdv2-selection-form-dialog {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 10; /* Increased from 1 to 10 to ensure it appears above other elements */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    transform: translateX(100%);
}

.cdv2-selection-form-dialog.active {
    transform: translateX(0);
}

.cdv2-selection-form-content {
    background-color: white;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cdv2-selection-form-header {
    background-color: #24455B;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cdv2-selection-form-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cdv2-selection-form-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    z-index: 5;
}

.cdv2-selection-form-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
    flex: 1;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.cdv2-selection-submit, .cdv2-back-to-selection {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cdv2-selection-submit {
    background-color: #24455B;
    color: white;
}

.cdv2-selection-submit:hover {
    background-color: #183243;
}

.cdv2-back-to-selection {
    background-color: #f5f5f5;
    color: #333;
}

.cdv2-back-to-selection:hover {
    background-color: #e0e0e0;
}

/* Add to selection button */
.cdv2-add-to-selection {
    background-color: #24455B;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
    margin-top: 15px;
}

.cdv2-add-to-selection:hover {
    background-color: #183243;
}

.cdv2-add-to-selection:before {
    content: "+";
    font-size: 20px;
}

/* Toast notification */
.cdv2-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 2000;
}

.cdv2-toast.error {
    background-color: #f44336;
}

.cdv2-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Selection bottom popup */
.cdv2-selection-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #24455B;
    color: white;
    padding: 20px;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 2000;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cdv2-selection-popup.show {
    transform: translateY(0);
}

.cdv2-selection-popup-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.cdv2-selection-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.cdv2-selection-popup-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
}

.cdv2-selection-popup-primary {
    background-color: white;
    color: #24455B;
}

.cdv2-selection-popup-primary:hover {
    background-color: #f0f0f0;
}

.cdv2-selection-popup-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.cdv2-selection-popup-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    .cdv2-selection-popup-buttons {
        flex-direction: column;
    }
}

/* Animations */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Cart overlay */
.cdv2-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.cdv2-selection-cart.active + .cdv2-selection-overlay {
    display: block;
}

/* Cart close button */
.cdv2-selection-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
}

/* Responsive */
@media (max-width: 767px) {
    .cdv2-selection-cart {
        width: 100%;
        max-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}