/* Configurator presentation, restored after calculator rules were removed from
   the published theme in 2acd8822. Keep controls/DOM and calculations intact. */
#calculator {
    min-width: 0;
    max-width: 100%;
    container-type: inline-size;
}
#calculator > .ui.one.column.grid {
    margin-inline: 0 !important;
    max-width: 100%;
}
#calculator > .ui.one.column.grid > h1,
#calculator > .ui.one.column.grid > h2 {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.3;
}
#calculator #float-box {
    display: none;
    position: sticky;
    top: .5rem;
    z-index: 1100;
    width: 100%;
    padding: .75rem 1rem;
    margin: 0 0 1rem;
    background: #111;
    color: #fff;
    border: 1px solid currentColor;
    text-align: center;
}
#calculator #float-box p {
    margin: 0 !important;
    line-height: 1.4;
    font-size: 1rem !important;
}
#calculator #float-box #total-price {
    font-size: 1.5rem !important;
    overflow-wrap: anywhere;
}
#calculator > .ui.grid[id^="step-"],
#calculator .petals > .ui.grid.step {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(6rem, .6fr) minmax(0, 2fr) minmax(6rem, .7fr) minmax(4rem, .4fr);
    align-items: start;
    gap: 1rem;
    margin: 1.25rem 0 0;
    padding: 1.25rem 0;
    border-top: 1px solid #bbb;
}
#calculator > #step-0.ui.grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(7rem, .7fr) minmax(0, 2.6fr) minmax(4rem, .4fr);
    align-items: center;
}
#calculator > .ui.grid[id^="step-"] > .column,
#calculator .petals > .ui.grid.step > .column {
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
    overflow-wrap: anywhere;
}
#calculator .five.wide.column {
    position: relative;
}
#calculator .five.wide.column > img {
    display: block;
    width: 100%;
    max-width: 312px;
    height: auto;
    margin-inline: auto;
}
#calculator .petal-canvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 312px;
    height: auto;
    pointer-events: none;
}
#calculator .calculator-step {
    position: static;
    margin: 0 0 .5rem;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}
#calculator .calculator-p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
#calculator #area-config {
    width: min(100%, 12rem);
    min-width: 0;
    padding: .5rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
}
#calculator .calclulator-product-title {
    margin: 0 0 .75rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}
#calculator .ui.form,
#calculator [id="sylius-product-selecting-variant"] {
    width: 100%;
    min-width: 0;
    margin: 0;
}
#calculator .ui.form .field > label {
    display: block;
    float: none;
    font-size: .875rem;
    line-height: 1.4 !important;
    margin-bottom: .35rem;
}
#calculator form > .ui.grid:not(.product-color-picker-small) {
    display: grid;
    grid-template-columns: minmax(8.5rem, 1.5fr) auto minmax(0, 1fr) auto minmax(4rem, 1fr);
    align-items: start;
    gap: .5rem;
    margin: .75rem 0 !important;
}
#calculator form > .ui.grid > .column {
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
}
#calculator .ui.form select,
#calculator .ui.form input[type="number"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font: inherit;
    font-size: 1rem;
}
#calculator .ui.form select {
    height: auto;
    min-height: 2.75rem;
    line-height: 1.4;
    padding: .5rem 1.75rem .5rem .5rem;
}
#calculator .total-weight {
    padding-top: 1.7rem !important;
    overflow-wrap: anywhere;
}
#calculator .total-weight h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.4;
}
#calculator .product-color-picker-small {
    width: 100%;
    margin: 0 0 1rem;
    text-align: left;
}
#calculator .product-color-picker-small > .required.field {
    width: 100%;
    min-width: 0;
}
#calculator .product-color-picker-small .ui.dropdown {
    display: block;
    width: 100%;
    min-width: 0;
}
#calculator .product-color-picker-small .grouped.fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2rem, 1fr));
    gap: .65rem;
    margin: .5rem 0;
}
#calculator .product-color-picker-small .grouped.fields > .field {
    float: none;
    clear: none;
    min-width: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
}
#calculator .product-color-picker-small .ui.toggle.checkbox {
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    border: 1px solid #666;
}
#calculator .product-color-picker-small .checkbox > input {
    width: 100%;
    height: 100%;
    inset: 0;
    margin: 0;
    cursor: pointer;
}
#calculator .product-color-picker-small .checkbox > label::before,
#calculator .product-color-picker-small .checkbox > label::after {
    display: none;
}
#calculator .product-color-picker-small .checkbox:focus-within {
    outline: 3px solid #075ba8;
    outline-offset: 2px;
}
#calculator .product-color-picker-small .checkbox.red-border,
#calculator .product-color-picker-small .checkbox.checked {
    outline: 3px solid #ae0000;
    outline-offset: 2px;
}
#calculator .ui.grid:has(> .product-price-class) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    margin: .75rem 0 !important;
    padding: 0 !important;
}
#calculator .ui.grid > .product-price-class.column {
    width: auto !important;
    padding: 0 .5rem 0 0;
}
#calculator .product-price-class p {
    margin: 0 0 .25rem !important;
    line-height: 1.4 !important;
    font-size: .875rem;
}
#calculator .product-price-class {
    min-width: 0;
    overflow-wrap: anywhere;
}
#calculator .product-price-class .sylius-product-price {
    color: inherit !important;
    line-height: 1.4;
}
#calculator .ui.black.column {
    padding: .65rem !important;
    align-self: start;
}
#calculator .ui.black.column > p {
    margin: 0 0 .3rem;
    font-size: .875rem;
    line-height: 1.4 !important;
}
#calculator .ui.black.column > p[id^="req-value"] {
    margin: 0;
    font-size: 1.1rem;
}
#calculator .next-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: static;
    float: none;
    align-self: stretch;
    padding: .5rem !important;
    cursor: pointer;
}
#calculator .next-step-p {
    margin: 0 0 .5rem;
    font-size: .875rem;
    line-height: 1.4;
}
#calculator .next-step .plus.circle.icon {
    margin: 0;
    font-size: 2rem;
}
#calculator .last-petal-step {
    margin-top: .75rem;
    margin-left: auto;
    max-width: 12rem;
}
#calculator input[type="range"] {
    max-width: 100%;
}
#calculator #submit-btn {
    max-width: 100%;
    height: auto;
    min-height: 3rem;
    font-size: 1rem;
    line-height: 1.4;
    margin: 1rem 0;
    white-space: normal;
}
html:has(#high-contrast-css) #calculator { background: #000; color: #fff; }
html:has(#high-contrast-css) #calculator .ui.form .field > label { color: #fff; }
html:has(#high-contrast-css) #calculator .green-config { color: #91ff91; }
html:has(#high-contrast-css) #calculator .red-config { color: #ff9595; }
html:has(#high-contrast-css) #calculator .checkbox.checked,
html:has(#high-contrast-css) #calculator .checkbox.red-border { outline-color: #ff0; }
@media (max-width: 1100px) {
    #calculator > .ui.grid[id^="step-"],
    #calculator > #step-0.ui.grid,
    #calculator .petals > .ui.grid.step {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    #calculator .ui.grid[id^="step-"] > .six.wide.column,
    #calculator > #step-0.ui.grid > .eight.wide.column,
    #calculator .petals > .ui.grid.step > .six.wide.column {
        grid-column: 1 / -1;
    }
}
@media (max-width: 600px) {
    #calculator > .ui.grid[id^="step-"],
    #calculator > #step-0.ui.grid,
    #calculator .petals > .ui.grid.step {
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
    }
    #calculator .ui.grid[id^="step-"] > .column,
    #calculator .petals > .ui.grid.step > .column {
        grid-column: 1 !important;
    }
    #calculator form > .ui.grid:not(.product-color-picker-small) {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }
    #calculator .total-weight { padding-top: 0 !important; }
    #calculator .next-step {
        flex-direction: row;
        gap: .75rem;
        justify-content: flex-end;
    }
    #calculator .next-step-p { margin: 0; }
    #calculator .calculator-step { font-size: 2rem; }
}

/* Container thresholds also respond to the existing root text-size control. */
@container (max-width: 60rem) {
    #calculator > .ui.grid[id^="step-"],
    #calculator > #step-0.ui.grid,
    #calculator .petals > .ui.grid.step {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    #calculator .ui.grid[id^="step-"] > .six.wide.column,
    #calculator > #step-0.ui.grid > .eight.wide.column,
    #calculator .petals > .ui.grid.step > .six.wide.column { grid-column: 1 / -1; }
}
@container (max-width: 35rem) {
    #calculator > .ui.grid[id^="step-"],
    #calculator > #step-0.ui.grid,
    #calculator .petals > .ui.grid.step { grid-template-columns: minmax(0, 1fr); }
    #calculator .ui.grid[id^="step-"] > .column,
    #calculator .petals > .ui.grid.step > .column { grid-column: 1 !important; }
    #calculator form > .ui.grid:not(.product-color-picker-small) { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    #calculator .total-weight { padding-top: 0 !important; }
    #calculator .next-step { flex-direction: row; gap: .75rem; justify-content: flex-end; }
    #calculator .next-step-p { margin: 0; }
}

/* Reuse the existing homepage selector on its dedicated category URL only. */
#main-content:has(#configurator-entry) > .menu-left { display: none; }
#main-content:has(#configurator-entry) > .twelve.wide.column { width: 100% !important; }
#configurator-entry { min-width: 0; max-width: 100%; }
#configurator-entry h1 { overflow-wrap: anywhere; }
#configurator-entry .configurator-homepage { width: 100%; max-width: 100%; }
html:has(#high-contrast-css) #configurator-entry { color: #fff; background: #000; }

#configurator-entry table { width: 100% !important; max-width: 100%; table-layout: fixed; }
#configurator-entry td { min-width: 0; overflow-wrap: anywhere; }
#configurator-entry #product-packages img { max-width: 100%; height: auto !important; }

/* Keep native packing text visible when the existing text-size control grows it. */
@container (max-width: 20rem) {
    #calculator form > .ui.grid:not(.product-color-picker-small) {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    #calculator .total-weight { grid-column: 1 / -1; }
}
