/**
 * CruelCRM Product Configurations Frontend Styles
 */

.cruelcrm-product-configuration {
    margin: 30px 0;
    padding: 25px;
    border: none;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    transition: none;
}

.cruelcrm-product-configuration:hover {
    box-shadow: none;
}

/* Main Product */
.cruelcrm-configuration-main-product {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cruelcrm-configuration-main-product h2 {
    width: 100%;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
}

.cruelcrm-configuration-main-product-image {
    flex: 0 0 40%;
    max-width: 40%;
    padding-right: 20px;
}

.cruelcrm-configuration-main-product-info {
    flex: 0 0 60%;
    max-width: 60%;
}

.cruelcrm-configuration-main-product-price {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.cruelcrm-configuration-main-product-description p:last-child {
    margin-bottom: 0;
}

/* Configuration Summary */
.cruelcrm-configuration-summary {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.cruelcrm-configuration-summary h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.cruelcrm-configuration-summary-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.cruelcrm-configuration-summary-product {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.cruelcrm-configuration-summary-option {
    color: #555;
    font-size: 16px;
}

/* Total Price */
.cruelcrm-configuration-total-price {
    margin-top: 10px;
    padding: 15px;
    background-color: #AB8912;
    color: white;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.cruelcrm-configuration-total-price-label {
    margin-right: 5px;
}

.cruelcrm-configuration-total-price-amount {
    font-size: 20px;
}

/* Configuration Options */
.cruelcrm-configuration-options {
    margin-bottom: 30px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.cruelcrm-configuration-options h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.cruelcrm-configuration-options-list {
    overflow: hidden;
    margin-bottom: 15px;
}

.cruelcrm-configuration-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background-color: #fff;
    cursor: pointer;
}

.cruelcrm-configuration-option:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

.cruelcrm-configuration-option.selected {
    background-color: #f5f5f5;
    border: 1px solid #AB8912;
    border-left: 3px solid #AB8912;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cruelcrm-configuration-option:last-child {
    border-bottom: none;
}

.cruelcrm-configuration-option label {
    display: flex;
    align-items: center;
    flex: 1;
    margin: 0;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
}

.cruelcrm-configuration-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom radio button - simplified to avoid centering issues */
.cruelcrm-configuration-option.selected {
    background-color: #f5f5f5;
    border: 1px solid #AB8912;
    border-left: 3px solid #AB8912;
}

.cruelcrm-configuration-option label {
    padding-left: 0; /* Remove padding that was for the circle */
}

.cruelcrm-configuration-option-name {
    flex: 1;
    font-size: 15px;
    color: #333;
    transition: color 0.2s ease;
}

.cruelcrm-configuration-option:hover .cruelcrm-configuration-option-name {
    color: #000;
}

.cruelcrm-configuration-option-price {
    display: none; /* Hide the price display as requested */
}

.cruelcrm-configuration-option.selected .cruelcrm-configuration-option-price {
    display: none; /* Hide the price display as requested */
}

.cruelcrm-configuration-option-image {
    margin-left: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.cruelcrm-configuration-option-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Removed enlarge on hover as requested */

.cruelcrm-configuration-option.selected .cruelcrm-configuration-option-image img {
    border-color: #AB8912;
}

/* Image Popup/Lightbox */
.cruelcrm-image-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cruelcrm-image-popup.active {
    display: flex;
    opacity: 1;
}

.cruelcrm-image-popup-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.cruelcrm-image-popup-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    background-color: white; /* White background for PNG images */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* Remove multiple frames */
    border: none;
    border-radius: 0;
}

.cruelcrm-image-popup-close {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cruelcrm-image-popup-close:hover {
    background-color: #f0f0f0;
}

/* Actions */
.cruelcrm-configuration-actions {
    display: flex;
    align-items: center;
}

.cruelcrm-configuration-quantity {
    margin-right: 20px;
}

.cruelcrm-configuration-quantity label {
    display: block;
    margin-bottom: 5px;
}

.cruelcrm-configuration-quantity-input {
    width: 70px;
    padding: 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cruelcrm-configuration-quantity-input:focus {
    border-color: #AB8912;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 2px rgba(171, 137, 18, 0.1);
}

.cruelcrm-add-configuration-to-cart {
    flex: 1;
    max-width: 250px;
    padding: 12px 20px;
    background-color: #AB8912;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cruelcrm-add-configuration-to-cart:hover {
    background-color: #967710;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.cruelcrm-add-configuration-to-cart:active {
    background-color: #80660E;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transform: translateY(1px);
}

/* Error Messages */
.cruelcrm-error {
    color: #b22222;
    padding: 10px;
    background-color: #ffeeee;
    border: 1px solid #ffcccc;
    border-radius: 3px;
}

/* Product Page Configuration */
.cruelcrm-product-page-configuration {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.cruelcrm-product-page-configuration .cruelcrm-product-configuration {
    margin-top: 0;
    border: none;
    padding: 0;
}

.cruelcrm-product-page-configuration .cruelcrm-configuration-main-product {
    display: none; /* Hide the main product section since we're already on the product page */
}

.cruelcrm-product-page-configuration .cruelcrm-configuration-options h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.cruelcrm-product-page-configuration .cruelcrm-configuration-options-list {
    margin-bottom: 20px;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .cruelcrm-product-configuration {
        padding: 15px;
    }
    
    .cruelcrm-configuration-main-product-image,
    .cruelcrm-configuration-main-product-info {
        flex: 0 0 100%;
        max-width: 100%;
        padding-right: 0;
    }
    
    .cruelcrm-configuration-main-product-image {
        margin-bottom: 20px;
        text-align: center;
    }
    
    /* Responsive styles for configuration summary */
    .cruelcrm-configuration-summary {
        padding: 12px;
    }
    
    .cruelcrm-configuration-summary h4 {
        font-size: 15px;
    }
    
    .cruelcrm-configuration-summary-product,
    .cruelcrm-configuration-summary-option {
        font-size: 14px;
    }
    
    /* Responsive styles for total price */
    .cruelcrm-configuration-total-price {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .cruelcrm-configuration-total-price-amount {
        font-size: 18px;
    }
    
    .cruelcrm-configuration-option {
        flex-wrap: wrap;
        padding: 12px;
    }
    
    .cruelcrm-configuration-option.selected {
        border-left-width: 2px;
    }
    
    .cruelcrm-configuration-option label {
        padding-left: 25px;
    }
    
    .cruelcrm-configuration-option-name {
        font-size: 14px;
    }
    
    .cruelcrm-configuration-option-price {
        margin-left: 10px;
        padding: 3px 6px;
        font-size: 13px;
    }
    
    .cruelcrm-configuration-option-image {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        height: auto;
        text-align: center;
    }
    
    .cruelcrm-configuration-option-image img {
        width: auto;
        max-height: 100px;
    }
    
    .cruelcrm-configuration-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cruelcrm-configuration-quantity {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .cruelcrm-add-configuration-to-cart {
        max-width: 100%;
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* Mobile popup adjustments */
    .cruelcrm-image-popup-content {
        max-width: 95%;
    }
    
    .cruelcrm-image-popup-close {
        top: -15px;
        right: -15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}