body.apc-calculator-product .apc-dynamic-price-label {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f4f7ef;
    color: #243d14;
    font-size: 14px;
    font-weight: 700;
}

body.apc-calculator-product .woocommerce-product-gallery,
body.apc-calculator-product .product-images,
body.apc-calculator-product .images {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.apc-calculator-product .woocommerce-product-gallery img,
body.apc-calculator-product .product-images img,
body.apc-calculator-product .images img {
    max-width: 100%;
    height: auto;
}

body.apc-calculator-product .related,
body.apc-calculator-product .upsells,
body.apc-calculator-product .wd-carousel-container.related-products,
body.apc-calculator-product .products.related,
body.apc-calculator-product .ads-studio,
body.apc-calculator-product .apc-product-entry,
body.apc-calculator-product #apc-modal,
body.apc-calculator-product .apc-modal {
    display: none !important;
}

.apc-product-media-fallback {
    direction: rtl;
    width: 100%;
    max-width: 760px;
    margin: 0 0 20px;
    padding: 12px;
    border: 1px solid #dfe5d8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 38, 12, 0.06);
}

.apc-product-media-main {
    overflow: hidden;
    border-radius: 8px;
    background: #f8faf3;
    text-align: center;
}

.apc-product-media-main img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.apc-product-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.apc-product-media-thumb {
    display: block;
    overflow: hidden;
    border: 1px solid #dfe5d8;
    border-radius: 6px;
    background: #fff;
}

.apc-product-media-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.apc-calculator {
    direction: rtl;
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    margin: 22px 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dfe5d8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(18, 38, 12, 0.08);
    color: #1f2933;
    text-align: right;
}

.apc-calculator *,
.apc-calculator *::before,
.apc-calculator *::after {
    box-sizing: border-box;
}

.apc-head {
    padding: 18px 18px 16px;
    border-bottom: 1px solid #e7ecdf;
    background: linear-gradient(135deg, #f8faf3 0%, #eef4e6 100%);
}

.apc-kicker {
    display: inline-block;
    margin-bottom: 7px;
    color: #8a6a17;
    font-size: 12px;
    font-weight: 800;
}

.apc-calculator h3 {
    margin: 0 0 6px !important;
    color: #17330f;
    font-size: 20px !important;
    line-height: 1.45 !important;
    font-weight: 800 !important;
}

.apc-head p {
    margin: 0;
    color: #5f6c57;
    font-size: 13px;
    line-height: 1.8;
}

.apc-field {
    display: grid !important;
    gap: 7px;
    width: 100%;
    margin: 0 !important;
    padding: 13px 16px 0;
    color: #1f2933;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
}

.apc-field span {
    display: block;
}

.apc-field small {
    display: block;
    margin-top: -4px;
    color: #7a8374;
    font-size: 11px;
    font-weight: 600;
}

.apc-field select,
.apc-field input[type="text"],
.apc-field input[type="file"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    border: 1px solid #cfd8c7 !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #1f2933 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

.apc-field select:focus,
.apc-field input[type="text"]:focus,
.apc-field input[type="file"]:focus {
    border-color: #8a6a17 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(138, 106, 23, 0.14) !important;
}

.apc-field.has-error select,
.apc-field.has-error input[type="text"],
.apc-field.has-error input[type="file"] {
    border-color: #dc2626 !important;
    background: #fff7f7 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.apc-error {
    margin-top: 2px;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 700;
}

.apc-reference,
.apc-upload {
    padding-top: 15px;
}

.apc-download-template {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 15px 16px 0;
    padding: 10px 12px;
    border: 1px solid #d9e3d0;
    border-radius: 6px;
    background: #fbfdf8;
    color: #1f2933;
    font-size: 13px;
    font-weight: 800;
}

.apc-download-template a {
    color: #8a6a17;
    text-decoration: underline;
}

.apc-price-box {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 12px;
    margin: 18px 16px 16px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #102b08;
    color: #fff;
}

.apc-price-box.has-error {
    background: #5f0f0f;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.apc-price-box > span {
    color: #dce8d3;
    font-size: 13px;
    font-weight: 700;
}

.apc-price-box strong {
    color: #fff !important;
    font-size: 20px !important;
    line-height: 1.4;
    font-weight: 900;
}

.apc-price-box small {
    grid-column: 1 / -1;
    color: #d8c07a;
    font-size: 12px;
    line-height: 1.7;
}

.apc-notice {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: 6px;
    background: #fff7ed;
    color: #9a3412;
}

body.apc-calculator-product form.cart {
    display: block !important;
}

body.apc-calculator-product form.cart .quantity {
    margin-top: 12px;
}

body.apc-calculator-product form.cart .single_add_to_cart_button {
    width: 100%;
    min-height: 46px;
    margin-top: 12px !important;
    border-radius: 6px !important;
    background: #111 !important;
    color: #fff !important;
    font-weight: 800 !important;
}

@media (min-width: 680px) {
    .apc-product-media-fallback {
    direction: rtl;
    width: 100%;
    max-width: 760px;
    margin: 0 0 20px;
    padding: 12px;
    border: 1px solid #dfe5d8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 38, 12, 0.06);
}

.apc-product-media-main {
    overflow: hidden;
    border-radius: 8px;
    background: #f8faf3;
    text-align: center;
}

.apc-product-media-main img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.apc-product-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.apc-product-media-thumb {
    display: block;
    overflow: hidden;
    border: 1px solid #dfe5d8;
    border-radius: 6px;
    background: #fff;
}

.apc-product-media-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.apc-calculator {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apc-head,
    .apc-reference,
    .apc-upload,
    .apc-price-box {
        grid-column: 1 / -1;
    }
}

@media (max-width: 679px) {
    .apc-price-box {
        grid-template-columns: 1fr;
    }
}

/* Per-product field layout controls introduced in v1.1.13 */
.apc-calculator {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.apc-head,
.apc-price-box,
.apc-calculator > input[type="hidden"],
.apc-calculator > script {
    flex: 0 0 100%;
}

.apc-field-width-full,
.apc-layout-one_column .apc-field,
.apc-layout-one_column .apc-download-template {
    flex: 0 0 100%;
}

.apc-field-width-half {
    flex: 0 0 50%;
}

.apc-field-width-third {
    flex: 0 0 33.333%;
}

.apc-layout-compact .apc-field-width-half,
.apc-layout-compact .apc-field-width-third {
    flex: 0 0 33.333%;
}

.apc-field textarea,
.apc-field input[type="number"],
.apc-field input[type="date"],
.apc-field input[type="email"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    border: 1px solid #cfd8c7 !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #1f2933 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

.apc-field textarea {
    min-height: 92px !important;
    resize: vertical;
}

.apc-field textarea:focus,
.apc-field input[type="number"]:focus,
.apc-field input[type="date"]:focus,
.apc-field input[type="email"]:focus {
    border-color: #8a6a17 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(138, 106, 23, 0.14) !important;
}

.apc-field-help {
    margin-top: 2px !important;
    color: #6b745f !important;
    font-weight: 500 !important;
    line-height: 1.7 !important;
}

.apc-download-template.apc-field-width-half,
.apc-download-template.apc-field-width-third,
.apc-download-template.apc-field-width-full {
    flex-basis: auto;
}

.apc-download-template.apc-field-width-half {
    width: calc(50% - 32px);
}

.apc-download-template.apc-field-width-third {
    width: calc(33.333% - 32px);
}

.apc-download-template.apc-field-width-full {
    width: calc(100% - 32px);
}

@media (max-width: 768px) {
    .apc-field-width-half,
    .apc-field-width-third,
    .apc-layout-compact .apc-field-width-half,
    .apc-layout-compact .apc-field-width-third {
        flex: 0 0 100%;
    }

    .apc-download-template.apc-field-width-half,
    .apc-download-template.apc-field-width-third,
    .apc-download-template.apc-field-width-full {
        width: calc(100% - 32px);
    }
}
