/* Hlavní kontejner jako flexbox pro správné sticky chování */
.wt_configurator_container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Levý panel s obrázky */
.wt_left_panel {
    height: fit-content;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Čisté sticky pro hlavní náhled bez překrývání obsahu */
.wt_image_container {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.10);
    margin-bottom: 1.2rem;
    width: 100%;
    max-width: 100vw;
    padding: 0 0 0.5rem 0;
}

.wt_base_image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wt_overlay_container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wt_overlay_image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: opacity;
}

.wt_overlay_image.wt_visible {
    opacity: 1;
}

.wt_overlay_image.wt_removing {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Pravý panel s kategoriemi */
.wt_right_panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wt_category_panel {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.wt_category_header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wt_category_header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.wt_category_selected {
    background: #f8f8f8;
}

.wt_category_selected::before {
    background: #4CAF50;
}

.wt_category_selected h2 {
    color: #4CAF50;
}

.wt_category_toggle {
    color: #666;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.wt_category_toggle::after {
    content: '›';
    font-size: 24px;
    transform: rotate(90deg);
    display: block;
    transition: transform 0.3s ease;
}

.wt_category_toggle.wt_rotated::after {
    transform: rotate(270deg);
}

.wt_category_panel .wt_category_content:not([style*="display: none"])+.wt_category_header .wt_category_toggle::after {
    transform: rotate(270deg);
}

.wt_category_content {
    padding: 1rem;
    display: none;
    background: #fff;
    position: relative;
}

.wt_category_content p {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 14px;
}

#content .wt_category_content p {
    margin: 0 0 1rem;
}

/* Scrollovatelný panel produktů v kategorii - horizontální carousel */
.wt_products_container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding-bottom: 6px;
    padding-top: 2px;
    scrollbar-width: thin;
    padding-right: 4px;
    white-space: nowrap;
}

.wt_products_container::-webkit-scrollbar {
    height: 8px;
    background: #eee;
}

.wt_products_container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.wt_product_element {
    flex: 0 0 calc((100% - 2.1rem) / 3.5); /* 3,5 slidu, 3x gap 0.7rem = 2.1rem */
    min-width: calc((100% - 2.1rem) / 3.5);
    max-width: calc((100% - 2.1rem) / 3.5);
    box-sizing: border-box;
    /* zvětším obrázek */
    padding: 0.5rem;
    border-radius: 12px;
    background: #f9f9f9;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.wt_product_element.wt_selected {
    background: #f0f9f0;
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.wt_product_element.wt_selected h3 {
    color: #4CAF50;
    font-weight: 600;
}

.wt_product_element.wt_selected .wt_show_button {
    background: #45a049;
}

.wt_product_image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin: 0;
    display: block;
    border-radius: 12px;
}

.wt_product_element h3 {
    margin: 0.5rem 0;
    font-size: 16px;
    color: #333;
}

.wt_standard_price {
    text-decoration: line-through;
    color: #333;
    font-size: 14px;
    margin: 0.25rem 0;
}

.wt_current_price {
    font-weight: bold;
    color: #000;
    font-size: 16px;
    margin: 0.25rem 0;
}

.wt_show_button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    border-radius: 4px;
    margin-top: 0.5rem;
    width: 100%;
}

.wt_show_button:hover {
    background: #45a049;
}

/* Panel s cenou a košíkem */
.wt_price_panel {
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.wt_price_info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0 0.3rem 0;
}

.wt_price_col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.2rem;
}

.wt_total_standard_price {
    font-size: 1rem;
    color: #888;
    text-decoration: line-through;
    margin-bottom: 0;
}

.wt_total_current_price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111;
    margin-bottom: 0;
}

.wt_discount_price {
    color: #4CAF50;
    font-size: 18px;
    font-weight: bold;
    margin: 1rem 0 0.5rem 0;
}

.wt_savings {
    color: #4CAF50;
    font-size: 14px;
    margin-bottom: 1rem;
}

.wt_add_to_cart,
.wt_add_to_cart_discount {
    width: 100%;
    padding: 1rem;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.wt_add_to_cart:disabled,
.wt_add_to_cart_discount:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wt_add_to_cart {
    background: #4CAF50;
    color: white;
}

.wt_add_to_cart:hover:not(:disabled) {
    background: #45a049;
}

.wt_add_to_cart_discount {
    background: #4CAF50;
    color: white;
}

.wt_add_to_cart_discount:hover:not(:disabled) {
    background: #45a049;
}

/* Navigační tlačítka kategorií */
.wt_category_navigation {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #eee;
}

.wt_category_next,
.wt_category_buy {
    width: 100%;
    padding: 1rem;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wt_category_next:hover,
.wt_category_buy:hover {
    background: #45a049;
}

.wt_category_next::after {
    content: '›';
    font-size: 24px;
    margin-left: 0.5rem;
    line-height: 1;
}

.wt_category_next:disabled,
.wt_category_buy:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.8;
}

.wt_category_next:disabled::after {
    opacity: 0.5;
}

/* Responzivní design */
@media (max-width: 768px) {
    .wt_left_panel {
        display: none !important;
    }
    .wt_base_image {
       max-width: 300px;
    }
    body.wt-configurator-active {
        padding-bottom: 120px;
    }

    .wt_right_panel {
        padding-top: 25px;
    }

    .wt_configurator_container {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }

    .wt_left_panel {
        position: relative;
        padding: 0;
        margin-bottom: 1rem;
    }

    .wt_image_container {
        top: 0px;
        margin-bottom: 0.7rem;
        padding-bottom: 0.3rem;
        z-index: 1000;
        text-align: center;
    }

    .wt_category_panel {
        margin: 0 0 0.75rem 0;
        border-radius: 0px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .wt_category_header {
        padding: 0.5rem 1.25rem;
    }

    .wt_category_content {
        padding: 1rem 1.25rem;
    }

    .wt_category_content p {
        margin: 0 0 1.25rem 0;
        line-height: 1.4;
    }

    .wt_products_container {
        max-width: 100vw;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        gap: 0.3rem;
        padding-bottom: 4px;
        padding-right: 2px;
        padding-top: 1px;
        white-space: nowrap;
    }

    .wt_category_column .wt_products_container {
        flex-direction: row;
        gap: 0.7rem;
    }

    .wt_product_element {
        flex: 0 0 calc((100vw - 2.1rem) / 3.5);
        min-width: calc((100vw - 2.1rem) / 3.5);
        max-width: calc((100vw - 2.1rem) / 3.5);
        padding: 0.3rem;
        border-radius: 10px;
    }

    .wt_product_image {
        max-height: 90px;
    }

    .wt_standard_price {
        font-size: 0.8rem;
        margin: 0.25rem 0;
    }

    .wt_current_price {
        font-size: 1rem;
        margin: 0.25rem 0 0.5rem 0;
    }

    .wt_show_button {
        width: 100%;
        padding: 0.5rem;
        font-size: 1.25rem;
        border-radius: 0px;
    }

    .wt_category_navigation {
        margin: 0;
        padding: 1.25rem;
        background: #f8f8f8;
        border-top: 1px solid #eee;
    }

    .wt_price_panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
        padding: 0.75rem 1rem;
        z-index: 100;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 1rem;
        align-items: center;
    }

    .wt_price_info {
        padding: 0.4rem 0 0.1rem 0;
    }

    .wt_buy_button {
        font-size: 1.2rem;
        padding: 1rem 0;
        border-radius: 18px;
    }

    .wt_total_standard_price,
    .wt_total_current_price {
        margin-bottom: 0;
    }

    .wt_discount_price {
        font-size: 1rem;
        margin: 0;
    }

    .wt_savings {
        font-size: 0.8rem;
        margin: 0;
    }

    .wt_cart_buttons {
        display: flex;
        gap: 0.5rem;
    }

    .wt_add_to_cart,
    .wt_add_to_cart_discount {
        padding: 0.75rem 1rem;
        font-size: 1.75rem;
        border-radius: 0px;
        white-space: nowrap;
        min-width: 120px;
    }

    .wt_scroll_top {
        bottom: 130px;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .wt_category_header h2 {
        margin-block-start: 0.5rem;
        margin-block-end: 0.5rem;
    }

    .wt_categories_grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.7rem;
    }

    .wt_product_element {
        flex: 0 0 calc((100vw - 2.1rem) / 3.5);
        min-width: calc((100vw - 2.1rem) / 3.5);
        max-width: calc((100vw - 2.1rem) / 3.5);
        padding: 0.3rem;
        border-radius: 10px;
    }

    .wt_product_image {
        max-height: 90px;
    }
}

/* Skryj progress bar */
.wt_progress_bar,
.wt_progress_fill {
    display: none !important;
}

/* Styl pro tlačítko Koupit v dolním sticky menu */
.wt_buy_button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0.8rem 0;
    font-size: 1.43rem;
    font-weight: 700;
    border-radius: 18px;
    align-self: stretch;
    margin: 0;
    border: 2px solid #4CAF50;
    background: #4CAF50;
    color: #fff;
    transition: background 0.2s, color 0.2s, border 0.2s;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.10);
}

.wt_buy_button:disabled {
    background: #ccc;
    color: #fff;
    border: 2px solid #ccc;
    cursor: not-allowed;
}

.wt_buy_button:hover:not(:disabled),
.wt_buy_button:focus:not(:disabled) {
    background: #388e3c;
    border-color: #388e3c;
    color: #fff;
}

/* Scroll to top button */
.wt_scroll_top {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wt_scroll_top::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    transform: rotate(-45deg) translate(2px, 2px);
}

.wt_scroll_top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Přidáme preload třídu pro načítání obrázků */
.wt_preload {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* --- Nové rozložení kategorií jako sloupce s dynamickým gridem --- */
.wt_categories_grid {
    display: grid;
    gap: 1.2rem;
    width: 100%;
    justify-content: center;
}

/* Dynamický počet sloupců podle počtu kategorií */
.wt_categories_grid[data-category-count="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.wt_categories_grid[data-category-count="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.wt_categories_grid[data-category-count="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.wt_categories_grid[data-category-count]:not([data-category-count="2"]):not([data-category-count="3"]):not([data-category-count="4"]) {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
}

.wt_category_column {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    align-items: stretch;
}

.wt_category_column .wt_products_container {
    display: flex;
    flex-direction: row;
    gap: 0.7rem;
}

.wt_product_element:hover,
.wt_product_element:active {
    border-color: #4CAF50;
    background: #f0f9f0;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.12);
}

.wt_product_element.wt_selected {
    border-color: #4CAF50;
    background: #e8fbe8;
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.18);
}

/* Skryj název a cenu */
.wt_product_element h3,
.wt_product_element .wt_standard_price,
.wt_product_element .wt_current_price,
.wt_show_button {
    display: none !important;
}

/* Odstraním fixní variantu */
.wt_image_container-fixed {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    z-index: 10 !important;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.10);
    margin: 0;
    padding: 0 0 1rem 0;
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1.5px); }
    80% { transform: translateX(1.5px); }
    100% { transform: translateX(0); }
}
.wt_product_element.shake-hint {
    animation: shake 0.35s cubic-bezier(.36,.07,.19,.97) both;
    animation-iteration-count: 1;
}

/* Wrapper pro všechny slidery */
.wt_configurator_sliders_wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    margin: 1.2rem 0 0.5rem 0;
}

/* Blok jednoho slideru */
.wt_slider_block {
    width: 100%;
    margin-bottom: 0.2rem;
}

/* Nadpis slideru */
.wt_slider_title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #222;
    text-align: left;
    padding-left: 0.2rem;
}

/* Wrapper pro řádek filtrů */
.wt_configurator_filters_row {
    display: flex;
    flex-direction: row;
    gap: 0.7rem;
    width: 100%;
    margin: 0 auto 0.55rem auto;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0 0.5rem;
    flex-wrap: nowrap;
}

.wt_filter_item {
    width: 50%;
    min-width: 120px;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0;
}

.wt_filter_label {
    font-size: 0.98rem;
    font-weight: 500;
    margin-bottom: 0.13rem;
    color: #222;
    letter-spacing: 0.01em;
}

.wt_filter_select {
    width: 100%;
    font-size: 1rem;
    padding: 0.38rem 2.8rem 0.38rem 0.7rem;
    border-radius: 9px;
    border: 1.2px solid #e0e0e0;
    background: #fafafa;
    color: #222;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    margin-bottom: 0.1rem;
    outline: none;
    transition: border 0.2s;
    appearance: none;
    position: relative;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23888" height="36" viewBox="0 0 24 24" width="36" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 2.2em;
    min-height: 38px;
    box-sizing: border-box;
}

.wt_filter_select:focus {
    border: 1.2px solid #4CAF50;
    background: #fff;
}

.wt_filter_loading {
    font-size: 0.98rem;
    color: #4CAF50;
    font-weight: 500;
    margin-top: 0.1rem;
    min-height: 1.2em;
    letter-spacing: 0.01em;
    animation: filterFade 1s linear;
}

@keyframes filterFade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 768px) {
    .wt_configurator_filters_row {
        flex-direction: row;
        gap: 0.7rem;
        padding: 0 0.1rem;
        margin-bottom: 0.35rem;
        align-items: stretch;
        flex-wrap: nowrap;
    }
    .wt_filter_item {
        width: 50%;
        min-width: 0;
        max-width: 100vw;
    }
    .wt_filter_select {
        font-size: 0.98rem;
        padding: 0.4rem 2.8rem 0.4rem 0.7rem;
        min-height: 36px;
    }
    .wt_filter_label {
        font-size: 0.98rem;
        margin-bottom: 0.13rem;
    }
}