/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: white;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: white;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Product option cards for modal */
.product-option-card {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-option-card:hover {
    background-color: #f0f0f0;
    border-color: #e0e0e0;
}

.product-image-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
}

.product-details {
    flex: 1;
    padding-right: 40px; /* Make room for badge */
}

.product-title {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: var(--primary-color);
    line-height: 1.3;
    padding-right: 140px; /* Increased from 120px to 140px to make more room for badges */
    white-space: normal; /* Allow text to wrap if necessary */
    overflow-wrap: break-word; /* Break long words if needed */
    
}

.product-description {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 16px;
}

.product-status {
    display: none;
}

.in-stock {
    display: flex;
    align-items: center;
    color: #4CAF50;
    font-size: 14px;
    font-weight: 500;
}

.in-stock-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4CAF50;
    margin-right: 6px;
}

/* Product Badge styling in modal */
.product-option-card .product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: #5a67d8;
    z-index: 5;
    white-space: nowrap; /* Prevent badge text from wrapping */
}

.product-price-display {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.discounted-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 22px;
}

.product-radio {
    position: absolute;
    right: 20px;
    bottom: 20px;
}

.radio-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.radio-custom.selected {
    background-color: white;
}

.radio-custom.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* Mobile Styles */
@media (max-width: 767px) {
    .modal {
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 0;
        margin-top: auto;
        margin-bottom: auto;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(90vh - 80px);
        overflow-y: auto;
    }
    
    .product-option-card {
        padding: 15px;
    }
    
    .product-image-container {
        width: 60px;
        margin-right: 15px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .product-description {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .original-price {
        font-size: 16px;
    }
    
    .discounted-price {
        font-size: 22px;
    }
}
