/**
 * Bundle & Save WooCommerce - Frontend Styles
 */

/* Bootstrap Icons */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css');

/* Bundle Section Container */
.bundle-save-section {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 30px;
    margin: 0 0 40px 0; /* Reduced top margin, increased bottom margin */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecff;
    clear: both; /* Ensure it doesn't interfere with other elements */
}

/* Bundle Header */
.bundle-header {
    text-align: center;
    margin-bottom: 25px;
}

.bundle-header h3 {
    color: #1e3a8a;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bundle Content */
.bundle-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
}

/* Bundle Products */
.bundle-products {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 300px;
}

.bundle-product {
    text-align: center;
    flex: 1;
}

.product-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    background: #e8ecff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.no-image-placeholder {
    color: #94a3b8;
    font-size: 40px;
}

/* Bundle Separator */
.bundle-separator {
    color: #1e3a8a;
    font-size: 24px;
    font-weight: 700;
    margin: 0 10px;
}

/* Bundle Pricing */
.bundle-pricing {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 250px;
}

.discount-banner {
    background: #e8ecff;
    color: #1e3a8a;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.discount-banner strong {
    font-weight: 700;
}

.discount-banner a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.discount-banner a:hover {
    color: #1e40af;
    text-decoration: underline;
}

.discount-banner a strong {
    color: inherit;
}

/* Bundled Product Pricing */
.bundled-product-pricing {
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #e8ecff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.original-price,
.discounted-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.original-price:last-child,
.discounted-price:last-child {
    margin-bottom: 0;
}

.price-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.price-value {
    font-size: 16px;
    font-weight: 600;
}

.price-value.original {
    color: #9ca3af;
    text-decoration: line-through;
}

.price-value.discounted {
    color: #10b981;
    font-size: 18px;
}

.savings-info {
    background: #10b981;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #059669;
}

.savings-info strong {
    font-size: 18px;
    color: #ffffff;
    margin-left: 5px;
}

/* Bundle Actions */
.bundle-actions {
    text-align: center;
}

.add-bundle-to-cart {
    background: #1e3a8a !important;
    color: #ffffff !important;
    border: none !important;
    padding: 15px 30px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3) !important;
    cursor: pointer !important;
    min-width: 200px !important;
}

.add-bundle-to-cart:hover {
    background: #1e40af !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4) !important;
}

.add-bundle-to-cart:active {
    transform: translateY(0) !important;
}

/* Loading State */
.add-bundle-to-cart.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Success Message */
.bundle-success-message {
    background: #10b981;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-top: 15px;
    animation: slideIn 0.3s ease;
}

.bundle-success-message a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
}

.bundle-success-message a:hover {
    color: #f0fdf4;
    text-decoration: none;
}

.bundle-success-message small {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 8px;
    display: inline-block;
}

/* Error Message */
.bundle-error-message {
    background: #ef4444;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-top: 15px;
    animation: slideIn 0.3s ease;
    border: 2px solid #dc2626;
}

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

/* GeneratePress Child Theme Integration */
.woocommerce .bundle-save-section {
    margin-bottom: 2em; /* Match WooCommerce spacing */
}

.woocommerce div.product .bundle-save-section {
    margin-top: 0; /* Remove top margin to sit closer to product summary */
}

/* Ensure proper spacing above tabs */
.woocommerce div.product .woocommerce-tabs {
    margin-top: 0; /* Remove default top margin */
}

/* Responsive Design */
@media (max-width: 768px) {
    .bundle-save-section {
        padding: 20px;
        margin: 20px 0;
    }
    
    .bundle-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .bundle-products {
        flex-direction: column;
        gap: 15px;
    }
    
    .bundle-separator {
        transform: rotate(90deg);
        margin: 10px 0;
    }
    
    .product-image {
        width: 100px;
        height: 100px;
    }
    
    .product-link {
        padding: 3px;
    }
    
    .product-link:hover {
        transform: none;
        box-shadow: none;
        background: none;
    }
    
    .bundle-pricing {
        min-width: auto;
        width: 100%;
    }
    
    .bundled-product-pricing {
        padding: 12px 15px;
    }
    
    .original-price,
    .discounted-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .price-label {
        font-size: 13px;
    }
    
    .price-value {
        font-size: 15px;
    }
    
    .price-value.discounted {
        font-size: 16px;
    }
    
    .add-bundle-to-cart {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .bundle-header h3 {
        font-size: 20px;
    }
    
    .product-image {
        width: 80px;
        height: 80px;
    }
    
    .total-price strong {
        font-size: 18px;
    }
}

/* Responsive adjustments for GeneratePress */
@media (max-width: 768px) {
    .bundle-save-section {
        margin: 0 0 30px 0;
        padding: 20px;
    }
}

/* Product Links */
.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
    border-radius: 15px;
    padding: 5px;
}

.product-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.15);
    background: rgba(232, 236, 255, 0.3);
}

.product-link:hover .product-image {
    transform: scale(1.05);
}

.product-link:hover .product-title {
    color: #1e40af;
}

/* Ensure product images and titles inherit link styling */
.product-link .product-image {
    transition: transform 0.3s ease;
}

.product-link .product-title {
    transition: color 0.3s ease;
}
