/* ===========================================
   CLEAN PRODUCT PAGE LAYOUT
   Works for customizable products only
   =========================================== */

/* Apply flexbox to the product container */
body.product-customizable div.product {
    display: flex;
    flex-direction: column;
}

/* Order direct children of div.product */
body.product-customizable div.product #product-customizer {
    order: 1;
}

body.product-customizable div.product .product-entry-wrapper {
    order: 2;
}

body.product-customizable div.product .minifig-how-it-works {
    order: 3;
}

body.product-customizable div.product .minifig-showcase {
    order: 4;
}

body.product-customizable div.product .minifig-faq {
    order: 5;
}

/* Ensure customizer takes full width */
body.product-customizable #product-customizer {
    width: 100%;
    max-width: 100%;
    margin-bottom: 2rem;
}

/* ===== STICKY PRODUCT SUMMARY (Cart Bar) ===== */

/* Make product-entry-wrapper sticky at bottom */
body.product-customizable .product-entry-wrapper {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: #FFFFFF;
    border-top: 2px solid var(--theme-palette-color-4);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* Entry summary flexbox layout */
body.product-customizable .entry-summary {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: nowrap;
}

/* Product Title */
body.product-customizable .entry-summary .product_title {
    margin: 0 !important;
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--theme-palette-color-3);
    flex: 1;
    min-width: 0;
    order: 1;
}

/* Price */
body.product-customizable .entry-summary .price {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 !important;
    white-space: nowrap;
    order: 2;
}

/* Add-to-cart container */
body.product-customizable .entry-summary .ct-product-add-to-cart {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    order: 3;
}

/* Cart Form */
body.product-customizable .entry-summary .ct-product-add-to-cart form.cart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
}

/* Cart actions wrapper */
body.product-customizable .entry-summary .ct-cart-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hide quantity selector */
body.product-customizable .entry-summary .quantity {
    display: none;
}

/* Add to Cart Button */
body.product-customizable .entry-summary .single_add_to_cart_button {
    font-family: 'Inter', sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 14px 32px !important;
    background: var(--theme-palette-color-1) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0 !important;
}

body.product-customizable .entry-summary .single_add_to_cart_button:hover {
    background: var(--theme-palette-color-2) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* Hide dividers and product meta in sticky bar */
body.product-customizable .entry-summary .ct-product-divider,
body.product-customizable .entry-summary .product_meta {
    display: none;
}

/* Add bottom spacing so sticky bar doesn't cover footer */
body.product-customizable .site-main {
    padding-bottom: 80px;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 767px) {
    body.product-customizable .entry-summary {
        padding: 10px 16px;
        gap: 8px;
    }
    
    body.product-customizable .entry-summary .product_title {
        font-size: 0.9rem;
    }
    
    /* Horizontal layout: Price + Button */
    body.product-customizable .entry-summary .price {
        font-size: 1.25rem;
        flex-shrink: 0;
        margin-right: auto;
    }
    
    body.product-customizable .entry-summary .single_add_to_cart_button {
        font-size: 14px !important;
        padding: 10px 20px !important;
        flex: 0 0 auto;
    }
    
    body.product-customizable .site-main {
        padding-bottom: 60px;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    body.product-customizable .entry-summary {
        padding: 12px 24px; /* Reduced */
    }
    
    body.product-customizable .entry-summary .product_title {
        font-size: 1.125rem;
    }
    
    body.product-customizable .entry-summary .single_add_to_cart_button {
        padding: 12px 24px !important; /* Slightly reduced */
    }
}