/* Bundle Product Frontend Styles */

/* Bundle Product Wrapper */
.bundle-product-wrapper {
    /* max-width: 800px; */
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* כותרות סעיפים */
.bundle-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bundle-section-title .icon {
    font-size: 24px;
}

.required-badge {
    /* background: #ef4444; */
    background: #eff0f0;
    color: #1f2937;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #e5e7eb;
}

/* מוצרים קבועים */
.bundle-fixed-items {
    /* background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px; */
}

.fixed-items-list {
    display: grid;
    gap: 15px;
}

.fixed-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.fixed-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.fixed-item .item-image {
    background: #fff;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.fixed-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fixed-item .quantity,
.option-item .quantity {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

.fixed-item .checkmark {
    width: 30px;
    height: 30px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* קבוצות בחירה */
.bundle-selectable-groups {
    /* margin-bottom: 30px; */
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bundle-group {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    /* margin-bottom: 25px; */
}

.group-options {
    display: grid;
    gap: 15px;
}

/* אופציות בחירה */
.option-item {
    display: block;
    cursor: pointer;
    position: relative;
}

.option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
    position: relative;
}

.option-item:hover .option-content {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.option-item.selected .option-content {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.option-image {
    background: #fff;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    padding: 5px;
}

.option-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fixed-item .item-details,
.option-details {
    /* flex: 1; */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fixed-item .item-details h4,
.option-details h4 {
    /* margin: 0 0 8px 0; */
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.fixed-item .item-details .product-subtitle,
.option-details .product-subtitle {
    font-size: 14px;
    color: #6b7280;
}

.option-price {
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.option-price .original-price {
    color: #9ca3af;
    font-size: 13px;
}

.option-price .bundle-price {
    color: #10b981;
    font-weight: 600;
    font-size: 15px;
}

.option-description {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.price-addon {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    width: max-content;
}

/* span.price-addon.has-addon {
    background: #7460dd;
    color: #ffffff;
} */

/* סימון בחירה */
.radio-check {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s;
}

.option-item.selected .radio-check {
    border-color: #667eea;
    background: #667eea;
}

.option-item.selected .radio-check::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* סיכום ומחיר */
.bundle-summary {
    margin-top: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.bundle-price-display {
    text-align: center;
}

.price-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 8px;
}

.bundle-total-price {
    display: block;
    color: white;
    font-size: 36px;
    font-weight: 700;
    transition: all 0.3s;
}

.bundle-total-price.price-updating {
    transform: scale(1.1);
    opacity: 0.7;
}

/* כפתור הוספה לסל */
.bundle-add-to-cart,
.bundle-remove-from-cart {
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    justify-content: center;
}

.bundle-remove-from-cart {
    background: #ef4444;
    color: white;
}

.bundle-add-to-cart:hover,
.bundle-remove-from-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.bundle-remove-from-cart:hover {
    background: #dc2626;
}

.bundle-add-to-cart:active,
.bundle-remove-from-cart:active {
    transform: translateY(0);
}

.bundle-add-to-cart.loading,
.bundle-remove-from-cart.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.bundle-add-to-cart.added {
    background: #10b981;
    color: white;
}

.bundle-add-to-cart .icon {
    font-size: 22px;
}

.bundle-add-to-cart .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* הודעת שגיאה */
.bundle-error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    border: 2px solid #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
    .bundle-section-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .fixed-item,
    .option-content {
        position: relative;
        flex-direction: column;
        text-align: center;
        padding: 7px;
    }
    
    .fixed-item .item-image,
    .option-image {
        width: 100%;
        height: 90px;
    }
    
    .bundle-total-price {
        font-size: 28px;
    }
    
    .bundle-add-to-cart {
        width: 100%;
    }

    .bundle-product-wrapper {
        padding: 0;
    }

    .bundle-group {
        padding: 10px;
    }

    .option-details {
        justify-content: center;
        align-items: center;
        gap: 5px;
    }

    .option-details h4 {
        font-size: 15px;
    }

    .fixed-item .checkmark,
    .radio-check {
        position: absolute;
        right: 5px;
        bottom: 5px;
    }

    .bundle-summary {
        padding: 15px;
        margin-top: 15px;
    }

    .group-options {
        gap: 10px;
    }
}
