/**
 * LifeVibe Bundle & Upsell Styles
 *
 * CSS for bundle discount notices and upsell functionality
 *
 * @package LifeVibe
 * @author SHOUT Media
 * @link https://shoutmedia.nl
 * @version 1.0.0
 */

/* Bundle Discount Notice */
.bundle-discount-notice {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    animation: slideInDown 0.3s ease-out;
}

.discount-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #166534;
}

.discount-notice-content svg {
    flex-shrink: 0;
    color: #22c55e;
    margin-top: 2px;
}

.discount-notice-content strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #15803d;
}

.discount-notice-content p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.discount-amount {
    font-weight: 700;
    color: #15803d;
    font-size: 1.125rem;
}

/* Price Update Animation */
.total-price {
    transition: all 0.3s ease;
}

.total-price.price-updated {
    transform: scale(1.1);
    color: #22c55e;
}

/* Upsell Checkboxes Enhancement */
.upsell-item {
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.upsell-item:hover {
    background: #f9fafb;
}

.upsell-checkbox:checked + span {
    color: #22c55e;
    font-weight: 600;
}

.upsell-checkbox {
    cursor: pointer;
    transition: all 0.2s;
}

.upsell-checkbox:checked {
    background-color: #22c55e;
    border-color: #22c55e;
}

/* Add to Cart Button Success State */
.single_add_to_cart_button.success {
    background: #22c55e !important;
    border-color: #22c55e !important;
}

.single_add_to_cart_button.success:hover {
    background: #16a34a !important;
}

/* Loading Spinner Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Slide In Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bundle Badge in Cart */
.bundle-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #166534;
    margin-top: 4px;
}

.bundle-badge svg {
    width: 14px;
    height: 14px;
    color: #22c55e;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .bundle-discount-notice {
        padding: 12px;
    }

    .discount-notice-content {
        gap: 10px;
    }

    .discount-notice-content strong {
        font-size: 0.875rem;
    }

    .discount-notice-content p {
        font-size: 0.8125rem;
    }

    .discount-amount {
        font-size: 1rem;
    }
}

/* Upsell Section Enhancement */
.upsells-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.upsells-container::-webkit-scrollbar {
    width: 6px;
}

.upsells-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.upsells-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.upsells-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Bundle Savings Summary in Cart/Checkout */
.bundle-savings-summary {
    animation: slideInDown 0.4s ease-out;
}

.bundle-savings-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    transition: all 0.3s ease;
}

/* Tooltip for Bundle Info */
.bundle-info-tooltip {
    position: relative;
    display: inline-block;
}

.bundle-info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
}

.bundle-info-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: 2px;
}

/* Cross-sell Items Selected State */
.crosssell-item.selected {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.crosssell-item.selected::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Variation Options Enhancement */
.variation-option.selected {
    border-color: #22c55e !important;
    background: #f0fdf4 !important;
}

.variation-option.selected svg {
    color: #22c55e !important;
}

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Pulse Animation for Discount Badge */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

.bundle-discount-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* Cart Notice Styling */
.woocommerce-message.bundle-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left-color: #22c55e;
    color: #166534;
}

.woocommerce-message.bundle-message::before {
    color: #22c55e;
}

/* Responsive Grid for Bundle Products */
@media (max-width: 640px) {
    .upsells-grid {
        grid-template-columns: 1fr;
    }

    .crosssells-scroll {
        gap: 12px;
    }

    .crosssell-card {
        flex: 0 0 200px;
    }
}
