/**
 * Copyright © Inn. All rights reserved.
 * Bundle Product Enhancement Styles
 */

/* General Bundle Option Styles */
.inn-bundle-option-checkbox,
.inn-bundle-option-radio,
.inn-bundle-option-multi {
    margin-bottom: 2rem;
}

.inn-bundle-option-checkbox .label > span,
.inn-bundle-option-radio .label > span,
.inn-bundle-option-multi .label > span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* Grid Layout for Options with Images */
.inn-bundle-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .inn-bundle-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
}

/* Choice Wrapper with Images */
.inn-bundle-choice-wrapper {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.inn-bundle-choice-wrapper:hover {
    transform: translateY(-2px);
}

.inn-bundle-choice-wrapper input[type="checkbox"],
.inn-bundle-choice-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Image Label Styles */
.inn-bundle-image-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.inn-bundle-image-label:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Selected State */
.inn-bundle-choice-wrapper input:checked + .inn-bundle-image-label,
.inn-bundle-choice-wrapper.selected .inn-bundle-image-label {
    border-color: #1979c3;
    background: #f0f7ff;
    box-shadow: 0 0 0 2px rgba(25, 121, 195, 0.2);
}

/* Hover state for selected items */
.inn-bundle-choice-wrapper.selected:hover .inn-bundle-image-label {
    border-color: #1565a3;
    background: #e6f2ff;
}

/* Disabled State */
.inn-bundle-choice-wrapper input:disabled + .inn-bundle-image-label {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Image Wrapper */
.inn-bundle-image-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.inn-bundle-option-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.inn-bundle-choice-wrapper:hover .inn-bundle-option-image {
    opacity: 0.9;
}

/* Checkmark Icon */
.inn-bundle-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: #1979c3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.inn-bundle-checkmark svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.inn-bundle-choice-wrapper input:checked ~ .inn-bundle-image-label .inn-bundle-checkmark {
    opacity: 1;
    transform: scale(1);
}

/* Radio Marker */
.inn-bundle-radio-marker {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #1979c3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.inn-bundle-radio-marker svg {
    width: 12px;
    height: 12px;
    color: #fff;
}

.inn-bundle-choice-wrapper input:checked ~ .inn-bundle-image-label .inn-bundle-radio-marker {
    opacity: 1;
    transform: scale(1);
}

/* Option Info */
.inn-bundle-option-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
}

.inn-bundle-option-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.inn-bundle-option-name .product-name {
    font-weight: 500;
}

.inn-bundle-option-tier-price {
    font-size: 0.8rem;
    color: #666;
}

/* Price Notice */
.inn-bundle-option-name .price-notice {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.85rem;
}

/* Discount Badge */
.inn-bundle-discount-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #ff5722;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Discount Info Message */
.inn-bundle-discount-info {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
}

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

.inn-bundle-discount-text {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2e7d32;
}

.inn-bundle-discount-text:before {
    content: '🎉';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Discount Active State */
.inn-bundle-option-checkbox.discount-active .label {
    color: #2e7d32;
}

/* Fallback for Options without Images */
.inn-bundle-option-checkbox:not(.with-images) .field.choice,
.inn-bundle-option-radio:not(.with-images) .field.choice {
    margin-bottom: 0.75rem;
}

.inn-bundle-option-checkbox:not(.with-images) .label,
.inn-bundle-option-radio:not(.with-images) .label {
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Loading State */
.inn-bundle-loading {
    position: relative;
    pointer-events: none;
}

.inn-bundle-loading:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .inn-bundle-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .inn-bundle-image-label {
        padding: 0.5rem;
    }
    
    .inn-bundle-option-name {
        font-size: 0.8rem;
    }
    
    .inn-bundle-discount-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Hover Effect Enhancement */
.inn-bundle-choice-wrapper.hover .inn-bundle-image-label {
    border-color: #1979c3;
    box-shadow: 0 4px 12px rgba(25, 121, 195, 0.15);
}

/* Focus Styles for Accessibility */
.inn-bundle-choice-wrapper input:focus + .inn-bundle-image-label {
    outline: 2px solid #1979c3;
    outline-offset: 2px;
}

/* Animation for Selection */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 121, 195, 0.4);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(25, 121, 195, 0);
    }
}

.inn-bundle-choice-wrapper input:checked + .inn-bundle-image-label {
    animation: pulse 0.5s ease-out;
}

/* Bundle Options Container */
.bundle-options-container {
    margin-top: 2rem;
}

/* Fieldset Styling */
.fieldset.fieldset-bundle-options {
    border: none;
    padding: 0;
    margin: 2rem 0;
}

.fieldset.fieldset-bundle-options .legend {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding: 0;
    border: none;
}

/* Bundle Price Display - Hide "To" price (updatesicher) */
.price-box.price-final_price .price-to {
    display: none !important;
}

/* Bundle Price Display - Style "From" as "ab" */
.price-box.price-final_price .price-from {
    margin: 0;
}

.price-box.price-final_price .price-from .price-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Minimal Price Styling */
.price-box.price-final_price .minimal-price {
    margin: 0;
}

.price-box.price-final_price .minimal-price .price-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Hide original label text, will be replaced via JS */
.price-box.price-final_price .price-from .price-label,
.price-box.price-final_price .minimal-price .price-label {
    font-size: 0;
}

.price-box.price-final_price .price-from .price-label:after,
.price-box.price-final_price .minimal-price .price-label:after {
    content: 'ab';
    font-size: 1rem;
    font-weight: 600;
}

