/***************** ensure only needed field groups are shown and loaded *******************/

.sqm-custom-fields,
.piece_precut_area-custom-fields,
.xm-custom-fields,
.sqm-simple-custom-fields {
    display: none;
}

.sqm-calculation .sqm-custom-fields,
.piece_precut_area-calculation .piece_precut_area-custom-fields,
.two-m-calculation .two-m-custom-fields,
.m-calculation .m-custom-fields,
.xm-calculation .xm-custom-fields,
.sqm_simple-calculation .sqm-simple-custom-fields {
    display: flex;
    position: relative;
    flex-flow: column;
}

body {
    --product-price-background: linear-gradient(135deg, rgba(85, 201, 65, 0.1), rgba(85, 201, 65, 0.05));
}

/******************** product layout *************************/

.redesign2024-product-summary .wd-single-price {
    background: var(--product-price-background);
    padding: 15px 15px 0 15px;
    border-radius: 6px 6px 0 0;
}

/******************* WAPF layout *****************/

.wapf {
    --border-color: #e1e5e9;
    border: 1px solid var(--border-color);
    background: #fafbfc;
    border-radius: 8px;
}

.wapf .wapf-wrapper {
    margin: 0 0 20px 0;
}

.wapf .choice-header {
    padding: 0;
}

.wapf .choice-header .wapf-field-label {
    border-bottom: 1px solid var(--border-color);
    background: white;
    display: flex;
    border-radius: 8px 8px 0 0;
    padding: 16px;
    margin: 0;
}

.wapf .choice-header .wapf-field-input {
    padding: 16px;
}

.wapf .choice-body {
    padding: 0 16px;
}

.wapf .choice-body .wapf-field-container {
    width: auto !important;
}

.wapf .choice-header .wapf-swatch--text {
    flex: 1;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.wapf .choice-header .wapf-swatch--text:hover,
.wapf .choice-header .wapf-swatch--text.wapf-checked {
    border-color: #55C941;
    background: rgba(85, 201, 65, 0.05);
    color: #333;
}

.wapf-product-totals {
    margin: 5px 16px 16px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: auto;
    border-radius: 4px;
}

.wapf .wapf-product-totals > .wapf--inner > div {
    display: flex;
    flex-flow: column;
    align-items: center;
}

.wapf .wapf-product-totals div span:first-child {
    font-size: medium;
}

.wapf .wapf-product-totals .wapf-grand-total {
    color: #55C941;
}

.wapf table.variations label {
    color: #777777;
}

/****************** text swatches *******************/

.wapf-swatch--text {
    margin: 0;
    border-width: 2px;
}

.wapf-field-text-swatch .wapf-swatch-wrapper .wapf-swatch--text:not(:last-child) {
    margin-right: 15px;
}

.wapf-swatch--text.wapf-checked {
    background: #ffffff;
    border: 2px solid #054b81;
    color: #054b81;
}

.wapf-swatch--text:hover {
    border-color: #054b81;
}

/************** general input fields ***************/

.wapf-wrapper .customCalculation {
    padding: 0;
}

.wapf-field-input .wapf-input[type="number"] {
    width: 75px;
    min-height: 42px;
}

.wapf-field-input .wapf-input[type="number"]:invalid {
    border: 2px solid #bf4f00;
}

.wapf-field-container:has(.wapf-input[type="number"]:invalid) .wapf-field-restriction-text {
    color: #bf4f00;
}

.wapf-field-input .wapf-input[readonly] {
    border: none;
    padding-left: 10px;
    text-align: left;
    background: transparent;
}

.wapf-field-label label {
    margin-bottom: 0;
}

.wapf-field-container {
    display:flex;
    flex-flow: column;
    justify-content: space-between;
}

.inactive .wapf-field-input {
    width: 55px;
    color: var(--wd-title-color);
    display: inline-block;
}

.inactive .wapf-field-input .wapf-input {
    color: #777777;
}

.wapf-field-restriction-text {
    display: block;
}

.wapf-field-select select {
    min-width: 90px;
    border-radius: 4px;
    background-color: white;
}

table.variations select {
    width: auto;
    background-color: white;
}

.wapf-field-input {
    position: relative;
}

.wapf-field-input .wapf-checkbox .wapf-custom {
    margin: 0 5px 0 0;
}

/************************* specific input fields **************************/

/* hide precut width label */
.wapf .choice-body .wapf-field-container.ppa-precut-width-output {
    width: 0 !important;
    padding: 0;
    visibility: hidden;
}

.wapf-field-input:has(input[type="number"],select, input[type="text"]) > div {
    width: auto;
}

.wapf-field-input:has(input[type="number"],select, input[type="text"]) > div::after {
    content: "m";
    color: #777777;
    margin-top: 10px;
    position: absolute;
    top: 0;
    margin-left: 5px;
}

.sqm-roof-area .wapf-field-input::after,
.sqm-product-area .wapf-field-input::after {
    content: "m²";
}

.max-cover-length.inactive .wapf-field-input input {
    padding: 0;
}

.sqm-product-width .wapf-field-input::after {
    margin-top: 10px;
}

.sqm-product-width .wapf-field-input {
    width: 30px;
    color: var(--wd-title-color);
}

.anti-condense-coating {
    display: flex;
    flex-flow: row-reverse;
    align-items: center;
    width: auto !important;
    justify-content: flex-end;
}

.anti-condense-coating .wapf-field-label {
    font-size: 21px;
    margin-bottom: 0;
}

.anti-condense-coating .wapf-field-label label {
    display: none;
}

.anti-condense-coating .wapf-field-label,
.delivery-pawn-pallet .wapf-field-label {
    font-size: 18px;
    margin-top: -5px;
    margin-bottom: 0;
}

.sqm-tile-width.inactive .wapf-input[type="number"] {
    width: 30px;
    padding: 0;
}

.wapf-field-container.delivery-pawn-pallet > .wapf-field-label > label {
    font-weight: normal;
    font-size: 14px;
}

.delivery-pawn-pallet {
    flex-direction: row-reverse;
    display: none;
    width: auto !important;
    justify-content: flex-end;
}

.wapf-field-container.delivery-pawn-pallet .wapf-field-input {
    width: 15px;
}

.delivery-pawn-pallet .wapf-field-input input.wapf-input {
    width: 15px;
    padding: 0;
    font-size: 14px;
    height: initial;
    margin-top: -5px;
}

.delivery-pawn-pallet .wapf-field-input:has(input[type="number"]) > div::after {
    content: "";
}

.sqm-custom-fields > .wapf-field-container:not(.piece-precut-area-input-choice) {
    padding: 0 0 0 21px;
}