/*
Theme Name: Hello Elementor Child - IPM Configurator
Theme URI: https://elementor.com/
Description: Safe child theme matching the IPM configurator product layout on masite.bg.
Author: IPM Timber
Template: hello-elementor
Version: 1.4.0
*/

/* Critical configurator shell: prevents the unstyled WooCommerce layout from
   flashing before the configurator script has rendered its interface. */
body.single-product.postid-10683 .ipm-configurator-layout.ipm-loading {
    opacity: 0;
    visibility: hidden;
}

body.single-product.postid-10683 .ipm-title,
body.single-product.postid-10683 .ipm-total {
    display: none !important;
}

body.single-product.postid-10683 #ipm-app:empty ~ .single_add_to_cart_button {
    visibility: hidden;
}

.single-product .summary p.price,
.single-product .summary .price,
.single-product .summary .woocommerce-Price-amount {
    display: none !important;
}

.ipm-step.ipm-complete h4 {
    color: #1e7d32;
    font-weight: 600;
}

.ipm-step.ipm-complete {
    border-left: 4px solid #1e7d32;
    padding-left: 10px;
}

.ipm-step {
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 0;
}

.ipm-step-header {
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s ease;
}

.ipm-step-content {
    max-height: 0;
    overflow: hidden;
    transition: 0.3s ease;
}

.ipm-step.active .ipm-step-content {
    max-height: 300px;
    margin-top: 10px;
}

.ipm-step.complete .ipm-step-header {
    color: #1e7d32;
    font-weight: 600;
}

.ipm-step.complete {
    border-left: 4px solid #1e7d32;
    padding-left: 12px;
}

/* Exact copy of the live IPM "Additional CSS" rules that Masite was missing. */
body.single-product { overflow-x: hidden; }

.ipm-configurator-layout {
    display: grid;
    grid-template-columns: minmax(0, 60%) minmax(360px, 40%);
    align-items: start;
    width: 100%;
    height: calc(100vh - 125px);
    min-height: 640px;
    overflow: hidden !important;
}

.ipm-right {
    background: #fff;
    border-left: 1px solid #e8e8e8;
    padding: 28px 24px 40px;
    height: 100%;
    min-height: 640px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    font-size: 16px;
}

.ipm-left {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 640px;
    overflow: hidden;
}

#ipm-root .ipm-scene, #ipm-3d, .ipm-3d-container {
    width: 100%; height: 100%; min-height: 640px;
    position: relative; overflow: hidden;
}

.ipm-room-upload {
    position: absolute; top: 10px; left: 10px; z-index: 10;
    padding: 8px; border-radius: 6px; background: rgba(255,255,255,.9);
}

#ipm-price { margin-bottom: 20px; font-size: 34px; font-weight: 700; line-height: 1.15; }
.ipm-title { display: none !important; font-size: 28px; margin-bottom: 18px; }
.ipm-total { display: none !important; font-size: 16px; margin-bottom: 22px; }

#ipm-app, #ipm-app .ipm-steps {
    display: block !important; position: relative !important;
    height: auto !important; overflow: visible !important;
}

.ipm-step {
    display: block !important; position: relative !important;
    height: auto !important; min-height: 0 !important;
    overflow: visible !important; clear: both;
    border-bottom: 1px solid #ededed; padding: 14px 0; z-index: 1;
}

.ipm-step-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 0; cursor: pointer;
}

.ipm-step-number { font-size: 18px; font-weight: 600; color: #7a7a7a; }
.ipm-step.active .ipm-step-number { color: #2f4f2f; }
.ipm-step-title { font-size: 18px; font-weight: 600; }
.ipm-step-content { display: none; }

.ipm-option {
    appearance: none; border: none; background: none;
    cursor: pointer; position: relative; z-index: 2;
}

.ipm-option:not(.icon) {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 42px; padding: 10px 18px; margin: 6px 10px 6px 0;
    border: 1px solid #d8d8d8; background: #fff;
    font-size: 15px; transition: .18s ease;
}

.ipm-option:not(.icon):hover {
    border-color: #2f4f2f; color: #2f4f2f; transform: translateY(-1px);
}

.ipm-option:not(.icon).active {
    border-color: #2f4f2f; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.ipm-option.disabled { opacity: .35 !important; pointer-events: none !important; }

.ipm-hex-grid {
    display: block !important; position: relative !important; width: 100%;
    margin-top: 24px; margin-bottom: 24px; overflow: visible;
    z-index: 3; min-height: 120px;
}

.ipm-hex-grid::after { display: none; }
.ipm-hex-grid .ipm-option.icon {
    position: absolute; width: 120px; height: 104px;
    display: flex; align-items: center; justify-content: center;
    padding: 0; margin: 0; background: transparent !important;
    border: none !important; box-shadow: none !important; z-index: 4;
}
.ipm-hex-grid .ipm-option.icon img {
    width: 118px; height: 102px; object-fit: contain; transition: .18s ease;
}
.ipm-hex-grid .ipm-option.icon:hover img {
    transform: translateY(-6px) scale(1.05);
    filter: drop-shadow(0 10px 18px rgba(0,0,0,.25));
}
.ipm-hex-grid .ipm-option.icon.active img {
    transform: none;
    filter: drop-shadow(0 0 0 2px #2f4f2f) drop-shadow(0 4px 8px rgba(0,0,0,.14));
}
.ipm-hex-grid .ipm-option.icon::after {
    content: attr(data-label); position: absolute; left: 50%; top: 100%;
    transform: translate(-50%,5px); padding: 5px 8px; border-radius: 4px;
    background: rgba(47,79,47,.96); color: #fff; font-size: 14px;
    font-weight: 600; line-height: 1.2; white-space: nowrap; opacity: 0;
    pointer-events: none; transition: opacity .15s ease,transform .15s ease; z-index: 20;
}
.ipm-hex-grid .ipm-option.icon:hover,
.ipm-hex-grid .ipm-option.icon:focus-visible { z-index: 50 !important; }
.ipm-hex-grid .ipm-option.icon:hover::after,
.ipm-hex-grid .ipm-option.icon:focus-visible::after {
    opacity: 1; transform: translate(-50%,0);
}
.ipm-hex-spacer { display: block; width: 100%; height: 0; pointer-events: none; }

#ipm-app .ipm-panel {
    display: block !important; position: relative !important;
    height: auto !important; min-height: 0 !important; overflow: visible !important;
    clear: both !important; border-bottom: 1px solid #ededed;
}
#ipm-app .ipm-panel .ipm-step { border-bottom: none !important; }
#ipm-app .ipm-panel-body {
    position: relative !important; height: auto !important; min-height: 0 !important;
    overflow: visible !important; padding: 12px 0 42px !important; clear: both !important;
}
#ipm-app .ipm-panel-body::after { content: ""; display: block; clear: both; }

#ipm-room-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center bottom; z-index: 1; pointer-events: none;
}

.ipm-pdf-btn, #ipm-copy-link, .single_add_to_cart_button {
    display: block !important; width: 100%; margin-top: 18px !important;
    padding: 16px 22px !important; background: #2f4f2f !important;
    color: #fff !important; border: none !important; font-size: 16px !important;
    font-weight: 600 !important; text-transform: uppercase; cursor: pointer;
}
.ipm-pdf-btn:hover, #ipm-copy-link:hover, .single_add_to_cart_button:hover { opacity: .92; }

#ipm-app .ipm-step-header::after { content: none !important; display: none !important; }
#ipm-app .ipm-panel > .ipm-step {
    position: relative !important; padding-right: 44px !important;
    box-sizing: border-box !important; cursor: pointer !important;
}
#ipm-app .ipm-panel > .ipm-step::after {
    content: "▼" !important; display: block !important; visibility: visible !important;
    opacity: 1 !important; position: absolute !important; right: 16px !important;
    top: 50% !important; transform: translateY(-50%) !important;
    color: #2f4f2f !important; font-family: Arial,sans-serif !important;
    font-size: 13px !important; font-weight: 700 !important; line-height: 1 !important;
    pointer-events: none !important; z-index: 999 !important;
}
#ipm-app .ipm-panel.active > .ipm-step::after,
#ipm-app .ipm-panel > .ipm-step.active::after { content: "▲" !important; }
#ipm-app .ipm-panel > .ipm-step:hover::after { color: #6b3f1d !important; }

@media (max-width: 1024px) {
    .ipm-configurator-layout {
        grid-template-columns: 1fr; height: auto; min-height: 0; overflow: visible !important;
    }
    .ipm-left, .ipm-right { height: auto; min-height: 0; overflow: visible !important; }
    #ipm-root .ipm-scene, #ipm-3d, .ipm-3d-container { height: 520px; min-height: 520px; }
}
