/**
 * O2 Bundles - Frontend Styles
 * 
 * Styles for bundle pages using WooCommerce single product structure
 *
 * @package WC_Product_Bundles
 * @version 1.2.0
 */

/* =============================================
   CUSTOMIZE COLORS HERE
   ============================================= */
:root {
    --wcpb-primary: #0066cc;
    --wcpb-primary-hover: #0052a3;
    --wcpb-success: #2e7d32;
    --wcpb-success-bg: #e8f5e9;
    --wcpb-error: #c62828;
    --wcpb-error-bg: #ffebee;
    --wcpb-text: #333333;
    --wcpb-text-muted: #666666;
    --wcpb-border: #e0e0e0;
    --wcpb-bg-light: #f5f5f5;
}

/* =============================================
   SINGLE PRODUCT LAYOUT FIX
   ============================================= */
body.wcpb-bundle-page .product {
    display: flex !important;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

body.wcpb-bundle-page .product > .woocommerce-product-gallery,
body.wcpb-bundle-page .product > .images {
    flex: 0 0 48%;
    max-width: 48%;
    float: none !important;
    width: auto !important;
}

body.wcpb-bundle-page .product > .summary {
    flex: 0 0 48%;
    max-width: 48%;
    float: none !important;
    width: auto !important;
}

@media (max-width: 768px) {
    body.wcpb-bundle-page .product {
        flex-direction: column;
        padding: 20px 15px;
    }
    
    body.wcpb-bundle-page .product > .woocommerce-product-gallery,
    body.wcpb-bundle-page .product > .images,
    body.wcpb-bundle-page .product > .summary {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* =============================================
   IMAGE CONTAINER
   ============================================= */
.wcpb-image-container {
    position: relative;
    background: var(--wcpb-bg-light);
    border-radius: 8px;
    overflow: hidden;
}

.wcpb-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.wcpb-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    border-radius: 4px;
    z-index: 10;
}

/* =============================================
   PRICE STYLING
   ============================================= */
body.wcpb-bundle-page .summary .price {
    font-size: 24px;
    margin-bottom: 15px;
}

body.wcpb-bundle-page .summary .price del {
    color: #999;
    font-size: 18px;
    margin-right: 10px;
}

body.wcpb-bundle-page .summary .price ins {
    text-decoration: none;
    font-weight: 700;
    color: var(--wcpb-text);
}

.wcpb-savings {
    display: inline-block;
    padding: 10px 15px;
    background: var(--wcpb-success-bg);
    color: var(--wcpb-success);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* =============================================
   INCLUDED PRODUCTS
   ============================================= */
.wcpb-included-products {
    margin: 25px 0;
    border: 1px solid var(--wcpb-border);
    border-radius: 8px;
    overflow: hidden;
}

.wcpb-included-products h3 {
    margin: 0;
    padding: 15px 20px;
    background: var(--wcpb-bg-light);
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--wcpb-border);
}

.wcpb-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcpb-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.wcpb-product-item:last-child {
    border-bottom: none;
}

.wcpb-product-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: var(--wcpb-bg-light);
    border-radius: 6px;
    overflow: hidden;
}

.wcpb-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcpb-product-info {
    flex: 1;
}

.wcpb-product-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--wcpb-text);
    text-decoration: none;
    margin-bottom: 4px;
}

.wcpb-product-name:hover {
    color: var(--wcpb-primary);
}

.wcpb-product-price {
    font-size: 13px;
    color: var(--wcpb-text-muted);
}

/* =============================================
   ADD TO CART FORM
   ============================================= */
body.wcpb-bundle-page .cart {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

body.wcpb-bundle-page .cart .quantity {
    margin-right: 0;
}

body.wcpb-bundle-page .cart .quantity .qty {
    width: 70px;
    height: 50px;
    text-align: center;
    font-size: 16px;
    border: 2px solid var(--wcpb-border);
    border-radius: 6px;
}

body.wcpb-bundle-page .cart .single_add_to_cart_button {
    flex: 1;
    min-width: 200px;
    height: 50px;
    background: var(--wcpb-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

body.wcpb-bundle-page .cart .single_add_to_cart_button:hover {
    background: var(--wcpb-primary-hover);
}

body.wcpb-bundle-page .cart .single_add_to_cart_button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.wcpb-bundle-page .cart .single_add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
}

body.wcpb-bundle-page .cart .single_add_to_cart_button.added {
    background: var(--wcpb-success);
}

@media (max-width: 480px) {
    body.wcpb-bundle-page .cart {
        flex-direction: column;
    }
    
    body.wcpb-bundle-page .cart .quantity,
    body.wcpb-bundle-page .cart .single_add_to_cart_button {
        width: 100%;
    }
    
    body.wcpb-bundle-page .cart .quantity .qty {
        width: 100%;
    }
}

/* =============================================
   CART MESSAGE
   ============================================= */
.wcpb-cart-message {
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 15px;
    display: none;
}

.wcpb-cart-message.success {
    display: block;
    background: var(--wcpb-success-bg);
    color: var(--wcpb-success);
}

.wcpb-cart-message.error {
    display: block;
    background: var(--wcpb-error-bg);
    color: var(--wcpb-error);
}

.wcpb-cart-message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* =============================================
   CART BADGES
   ============================================= */
.wcpb-cart-bundle-badge {
    display: inline-block;
    background: var(--wcpb-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
    margin-right: 6px;
}

/* =============================================
   SHORTCODE CARDS
   ============================================= */
.wcpb-bundles-grid {
    display: grid;
    gap: 24px;
}

.wcpb-columns-1 { grid-template-columns: 1fr; }
.wcpb-columns-2 { grid-template-columns: repeat(2, 1fr); }
.wcpb-columns-3 { grid-template-columns: repeat(3, 1fr); }
.wcpb-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .wcpb-columns-3, .wcpb-columns-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .wcpb-columns-2, .wcpb-columns-3, .wcpb-columns-4 { grid-template-columns: 1fr; }
}

.wcpb-bundle-card {
    background: #fff;
    border: 1px solid var(--wcpb-border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.wcpb-bundle-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.wcpb-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.wcpb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcpb-card-content {
    padding: 20px;
}

.wcpb-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.wcpb-card-title a {
    color: var(--wcpb-text);
    text-decoration: none;
}

.wcpb-card-title a:hover {
    color: var(--wcpb-primary);
}

.wcpb-card-price del {
    font-size: 14px;
    color: #999;
    margin-right: 8px;
}

.wcpb-card-price ins {
    font-size: 20px;
    font-weight: 700;
    color: var(--wcpb-text);
    text-decoration: none;
}

.wcpb-card-savings {
    font-size: 13px;
    color: var(--wcpb-success);
    font-weight: 600;
    margin: 8px 0 16px;
}

.wcpb-card-button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--wcpb-primary);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.wcpb-card-button:hover {
    background: var(--wcpb-primary-hover);
    color: #fff;
}
