/**
 * TPB QuickView Modal - Iframe Content Styles
 * Clean, maintainable styles for content displayed inside the modal iframe
 */

/* ============================================
   HIDE UNWANTED ELEMENTS IN IFRAME MODE
   ============================================ */

body.tpb-qv-iframe header,
body.tpb-qv-iframe .site-header,
body.tpb-qv-iframe .elementor-location-header,
body.tpb-qv-iframe footer,
body.tpb-qv-iframe .site-footer,
body.tpb-qv-iframe .elementor-location-footer,
body.tpb-qv-iframe #wpadminbar,
body.tpb-qv-iframe .woocommerce-breadcrumb,
body.tpb-qv-iframe .woocommerce-product-gallery,
body.tpb-qv-iframe .woocommerce-tabs,
body.tpb-qv-iframe .related,
body.tpb-qv-iframe .upsells,
body.tpb-qv-iframe .woocommerce-product-rating,
body.tpb-qv-iframe .woocommerce-product-meta,
body.tpb-qv-iframe .product_title,
body.tpb-qv-iframe .price {
    display: none !important;
}

/* ============================================
   BASE IFRAME BODY STYLING
   ============================================ */

body.tpb-qv-iframe {
    margin: 0 !important;
    padding: 30px 40px !important;
    background: #fff !important;
    color: #333 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    min-height: 100vh !important;
}

/* ============================================
   HEADER / TITLE SECTION
   ============================================ */

/* Hide the original product title (but keep descriptions) */
body.tpb-qv-iframe .entry-title,
body.tpb-qv-iframe .product_title {
    display: none !important;
}

/* Keep the short description visible - it contains the CPB */
body.tpb-qv-iframe .woocommerce-product-details__short-description {
    display: block !important;
}

/* Modal header added via JavaScript */
body.tpb-qv-iframe .tpb-modal-header {
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid #e9ecef !important;
}

body.tpb-qv-iframe .tpb-modal-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

body.tpb-qv-iframe .tpb-modal-description {
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #6c757d !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   CPB COMPONENT CONTAINER
   ============================================ */

body.tpb-qv-iframe .afc-composite-product,
body.tpb-qv-iframe [class*="composite-product"],
body.tpb-qv-iframe [class*="composite"],
body.tpb-qv-iframe .woocommerce-product-details__short-description > * {
    display: block !important;
    visibility: visible !important;
    margin: 0 0 30px 0 !important;
    padding: 0 !important;
}

/* ============================================
   COMPONENT SECTIONS (Steps)
   ============================================ */

body.tpb-qv-iframe .afc-composite-product > div {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 24px !important;
    margin-bottom: 20px !important;
}

body.tpb-qv-iframe .afc-composite-product h4 {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
}

body.tpb-qv-iframe .afc-composite-product .afc-component-description {
    font-size: 14px !important;
    color: #6c757d !important;
    margin-bottom: 20px !important;
    line-height: 1.5 !important;
}

/* ============================================
   RADIO BUTTON OPTIONS (Step 1 & 2)
   ============================================ */

body.tpb-qv-iframe .afc-composite-product input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #ddd !important;
    border-radius: 50% !important;
    background-color: white !important;
    cursor: pointer !important;
    position: relative !important;
    margin-right: 12px !important;
    vertical-align: middle !important;
    transition: all 0.2s ease !important;
}

body.tpb-qv-iframe .afc-composite-product input[type="radio"]:hover {
    border-color: #007cba !important;
}

body.tpb-qv-iframe .afc-composite-product input[type="radio"]:checked {
    border-color: #007cba !important;
    background-color: white !important;
}

body.tpb-qv-iframe .afc-composite-product input[type="radio"]:checked::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background-color: #007cba !important;
}

body.tpb-qv-iframe .afc-composite-product label {
    font-size: 15px !important;
    color: #333 !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

body.tpb-qv-iframe .afc-composite-product label:hover {
    color: #007cba !important;
}

/* ============================================
   PRODUCT CARDS (Step 3 - Complete Bundles)
   ============================================ */

/* Container for bundle products */
body.tpb-qv-iframe .afc-composite-product .afc-component-products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

/* Individual product card */
body.tpb-qv-iframe .afc-composite-product .afc-component-product {
    background: white !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
}

body.tpb-qv-iframe .afc-composite-product .afc-component-product:hover {
    border-color: #007cba !important;
    box-shadow: 0 4px 16px rgba(0, 124, 186, 0.15) !important;
    transform: translateY(-2px) !important;
}

body.tpb-qv-iframe .afc-composite-product .afc-component-product.selected {
    border-color: #007cba !important;
    background: #f0f8ff !important;
}

/* Product thumbnail */
body.tpb-qv-iframe .afc-composite-product .afc-component-product img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
}

/* Product title */
body.tpb-qv-iframe .afc-composite-product .afc-component-product .afc-product-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
}

/* Product price */
body.tpb-qv-iframe .afc-composite-product .afc-component-product .price {
    display: block !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #5ac59a !important;
    margin-bottom: 12px !important;
}

/* Product description */
body.tpb-qv-iframe .afc-composite-product .afc-component-product .afc-product-description {
    font-size: 13px !important;
    color: #6c757d !important;
    line-height: 1.5 !important;
    margin-bottom: 12px !important;
    flex-grow: 1 !important;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */

body.tpb-qv-iframe .single_add_to_cart_button,
body.tpb-qv-iframe .afc_add_to_cart_button {
    background: #5ac59a !important;
    color: white !important;
    border: none !important;
    padding: 16px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 30px !important;
    display: inline-block !important;
}

body.tpb-qv-iframe .single_add_to_cart_button:hover,
body.tpb-qv-iframe .afc_add_to_cart_button:hover {
    background: #4ab088 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(90, 197, 154, 0.3) !important;
}

body.tpb-qv-iframe .single_add_to_cart_button:disabled,
body.tpb-qv-iframe .afc_add_to_cart_button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ============================================
   PROGRESSIVE DISCLOSURE (Animations)
   ============================================ */

body.tpb-qv-iframe .afc-composite-product .afc-component {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out !important;
}

body.tpb-qv-iframe .afc-composite-product .afc-component.visible {
    animation: fadeInUp 0.4s ease-in-out !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    body.tpb-qv-iframe {
        padding: 20px !important;
    }

    body.tpb-qv-iframe .afc-composite-product .afc-component-products {
        grid-template-columns: 1fr !important;
    }
}
