/* Custom Order Bumps Styles */
.custom-order-bump {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e1e1;
    transition: all 0.3s ease;
    position: relative;
    color: #333 !important;
}

.custom-order-bump:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.custom-order-bump.processing {
    opacity: 0.7;
    pointer-events: none;
}

.custom-order-bump.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: bump-loading 1s infinite linear;
}

@keyframes bump-loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bump-image {
    flex: 0 0 120px; /* Increased from 60px to 120px */
    margin-right: 15px;
    position: relative;
    cursor: pointer;
}

.bump-image img {
    width: 100%;
    height: 120px; /* Fixed height for consistency */
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.bump-image:hover img {
    transform: scale(1.05);
}

.bump-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.bump-image:hover .bump-image-overlay {
    opacity: 1;
}

.bump-zoom-icon {
    color: white;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bump-details {
    flex: 1;
}

.bump-title {
    margin: 0 0 3px;
    font-weight: 500;
    font-size: 1.1em;
    color: #333;
}

.bump-description {
    margin: 0 0 8px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.bump-pricing {
    margin-bottom: 8px;
}

.bump-regular-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
}

.bump-discounted-price {
    color: #d32f2f;
    font-weight: 600;
    margin-left: 8px;
    font-size: 1.1em;
}

.bump-checkbox-label {
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    margin: 0;
    font-weight: 500;
    color: #333;
}

.bump-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.bump-checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.5;
}

/* Responsive styles */
@media (max-width: 768px) {
    .custom-order-bump {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 10px;
    }
    
    .bump-image {
        flex: 0 0 100px; /* Increased from 50px to 100px */
        margin-right: 12px;
        margin-bottom: 0;
    }
    
    .bump-image img {
        max-height: 100px; /* Increased from 50px to 100px */
        height: 100px; /* Fixed height for consistency */
    }
    
    .bump-details {
        text-align: left;
        flex: 1;
    }
    
    .bump-title {
        font-size: 1em;
        margin-bottom: 2px;
    }
    
    .bump-description {
        font-size: 0.85em;
        margin-bottom: 6px;
    }
    
    .bump-checkbox-label {
        justify-content: flex-start;
        font-size: 0.85em;
    }
}

/* Integration with common themes */
.woocommerce .custom-order-bump {
    font-family: inherit;
}

.woocommerce .custom-order-bump .bump-title {
    font-family: inherit;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .custom-order-bump {
        background: #f8f9fa !important;
        border-color: #dee2e6;
        color: #212529 !important;
    }
    
    .bump-title {
        color: #212529 !important;
    }
    
    .bump-description {
        color: #495057 !important;
    }
    
    .bump-checkbox-label {
        color: #212529 !important;
    }
    
    .bump-regular-price {
        color: #6c757d !important;
    }
}

/* Product Popup Styles */
.bump-product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.bump-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.bump-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bump-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.bump-popup-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.bump-popup-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #000 !important; 
    background-color: transparent !important;
    padding: 0;
    width: 55px;
    height: 55px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.bump-popup-close:hover {
    color: #000; /* Changed from #333 to #000 for better contrast */
}

.bump-popup-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    gap: 20px;
}

.bump-popup-image {
    flex: none;
    max-width: 400px; /* Larger image display */
    width: 100%;
}

.bump-popup-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    max-height: 400px;
    object-fit: contain;
}

.bump-popup-info {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.bump-popup-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
    text-align: center;
    max-width: 500px;
}

.bump-popup-pricing {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bump-popup-regular-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.bump-popup-discounted-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2em;
}

.bump-popup-view-product {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d; /* Changed from #007cba to grey */
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.bump-popup-view-product:hover {
    background: #5a6268; /* Darker grey on hover */
    color: white !important;
}

/* Mobile responsive popup */
@media (max-width: 768px) {
    .bump-popup-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .bump-popup-image {
        max-width: 300px; /* Smaller on mobile but still prominent */
    }
    
    .bump-popup-header h3 {
        font-size: 1.3em; /* Slightly smaller title on mobile */
    }
}