.calculator-formula {
    clear: both;
    margin: 32px 0 0;
    padding: 16px;
    overflow-x: auto;
    border: 1px solid #c3d7ed;
    border-radius: 8px;
    background: #f7fbff;
}

.calculator-formula h3 {
    margin: 0 0 12px;
    color: #02375a;
    font-size: 16px;
}

.calculator-formula table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13px;
}

.calculator-formula th,
.calculator-formula td {
    padding: 8px 10px;
    border: 1px solid #c3d7ed;
    text-align: left;
}

.calculator-formula thead,
.calculator-formula tfoot {
    background: #dcecff;
}

.calculator-formula td:last-child,
.calculator-formula th:last-child {
    text-align: right;
    white-space: nowrap;
}

.calculator-formula .formula-row td:first-child { font-weight: 700; }

/* Highlight only calculated amounts that add to the price. */
.calculator-formula .formula-value-changed { color: #e11d48; font-weight: 700; }
.calculator-formula .formula-value-final { color: #0563df; font-weight: 800; }
.calculator-formula a { color: #0563df; font-weight: 700; text-decoration: underline; }

.calculator-formula .formula-row.is-calculated td { background: #fff4e5; }
.calculator-formula .formula-row.is-calculated td:first-child { color: #c2410c; }

.calculator-formula-note {
    clear: both;
    margin: 10px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
}

		.radio-input input[type=radio] {
			display: none;
		}

		.radio-input input[type=radio]+label {
			color: #333;
			font-family: Arial, sans-serif;
			font-size: 14px;
		}

		.radio-input input[type=radio]+label span {
			display: inline-block;
			width: 30px;
			height: 30px;
			margin: -1px 4px 0 0;
			vertical-align: middle;
			cursor: pointer;
			border-radius: 50%;
			border: 2px solid #ddd;
			box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
			background-repeat: no-repeat;
			background-position: center;
			text-align: center;
			line-height: 44px;
		}

		.radio-input input[type=radio]+label span .selected {
			opacity: 0;
			transition: all 0.3s ease;
		}

		.radio-input input[type=radio]#grade-pvc+label span {
			border-radius: 50%;
			border: 2px solid #ddd;
		}

		.radio-input input[type=radio]#grade-pu+label span {
			border-radius: 50%;
			border: 2px solid #ddd;
		}


		.radio-input input[type=radio]#color-green+label span {
			background-color: #2ecc71;
		}

		.radio-input input[type=radio]#color-blue+label span {
			background-color: #3498db;
		}

		.radio-input input[type=radio]#color-black+label span {
			background-color: #000;
		}

		.radio-input input[type=radio]#color-white+label span {
			background-color: #fff;
		}

		.radio-input input[type=radio]:checked+label span img {
			opacity: 1;
		}

		.radio-input input[type=radio]:checked+label span .grade-image {
			border: 1px solid #ccc
		}

		.radio-input input[type=radio]+label span .grade-image {
			border-radius: 50%;
			display: block;
			width: 40px;
			height: 40px;
			object-fit: cover;
		}

		.button-group {
			flex-grow: 1;
			margin: auto;
		}

		.button-group input[type="radio"] {
			display: none;
		}

		label span {
			font-size: 10px !important;
		}

		label {
			padding: 10px !important;
		}

		.button-group label {
			display: inline-block;
			padding: 10px 20px;
			cursor: pointer;
			border: 1px solid rgb(146, 173, 223);
			background-color: #fff;
			color: black;
			border-radius: 15px;
			transition: all ease 0.2s;
			text-align: center;
			flex-grow: 1;
			flex-basis: 0;
			width: 90px;
			font-size: 13px;
			margin: 5px;
			box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
		}

		.button-group input[type="radio"]:checked+label {
			background-color: white;
			color: #02375a;
			border: 2px solid #ff0000;
		}

		fieldset {
			border: 0;
			display: flex;
			flex-direction: column;
		}

		.conveyor_header {
			display: grid;
			grid-template-columns: 1fr 1fr;
			gap: 1%;
		}

		@media (max-width: 768px) {
			.conveyor_header {
				grid-template-columns: 1fr;
				gap: 0%;
				display: flex;
				flex-direction: column;
				align-items: center;
			}

			.header_image {
				width: 100%;
			}

			.option_conveyor {
				font-size: 12px;
			}

			.image-line span {
				font-size: 10px;
			}

			.arrow-width,
			.arrow-height,
			.arrow-length {
				font-size: 7px !important;
			}

			.arrow-height {
				padding: 0;
			}
		}

		.detail_conveyor {
			margin-top: 15px;
		}

		.price_conveyor {
			font-size: 30px;
			margin-bottom: 20px;
		}



		/* ======================================================================================= */

		.option_conveyor_mobile {
			display: grid;
			line-height: 1.2;
			position: relative
		}

		.radio {
			display: inline-flex;
			flex-direction: row;
			position: relative;
			width: fit-content;
			height: fit-content;
			background: #fff;
			border-radius: 8px;
			box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
			overflow: hidden;
			border: 1px solid #ddd;
			padding: 5px 10px;
		}

		.radio .option {
			padding: 5px 10px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			background: #f9f9f9;
			border-bottom: 1px solid #ddd;
			cursor: pointer;
			transition: background 0.3s ease-in-out;
			white-space: nowrap;
		}

		.radio .option:last-child {
			border-bottom: none;
		}

		.radio .option:hover {
			background: #007bff;
		}

		.radio input {
			opacity: 0;
			position: absolute;
			left: -99999px;
		}

		.radio input:checked+label {
			background: #007bff;
			color: white;
			font-weight: bold;
		}

		button {
			box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
			padding: 15px;
			background-color: #171717;
			color: #fff;
			font-weight: bolder;
			border-radius: 10px;
		}

		.select-conveyor {
			appearance: none;
			outline: 10px red;
			border: 0;
			box-shadow: none;
			flex: 1;
			padding: 0 1em;
			color: #fff;
			background-color: rgb(146, 173, 223);
			background-image: none;
			cursor: pointer;
		}

		.select-conveyor::-ms-expand {
			display: none;
		}

		.select-conveyor {
			position: relative;
			padding: 20px;
			width: 200px;
			border-radius: 5px;
		}

		/* Arrow */
		.select-conveyor::after {
			content: '\25BC';
			position: absolute;
			top: 0;
			right: 0;
			padding: 0.9em;
			background-color: rgb(146, 173, 223);
			transition: .25s all ease;
			pointer-events: none;
		}

		/* Transition */
		.select-conveyor:hover::after {
			color: #f39c12;
		}

		.select-conveyor select {
			background-color: #007bff !important;
			color: #fff !important;
			border: none;
			position: absolute;
			width: 97% !important;
			top: 4px;
			left: 4px;
		}



		.group-2 {
			display: flex;
			margin-top: 10px;
			gap: 1%;
		}

		.custom-icon {
			position: absolute;
			z-index: 999;
			color: #fff;
			right: 10px;
			top: 10px;
		}

		@media (max-width: 768px) {
			.option_conveyor_mobile {
				font-size: 10px;
			}

			.select-conveyor {

				width: 100px;
			}

			.select-conveyor::after {
				padding: 1.4em;
			}

			.detail_conveyor {
				order: -4;
				margin: 10px;
			}

			.price_conveyor {
				order: -3;
				margin: 0;
			}
		}

		/* ========================= Cart ========================= */
		#cart-list {
			width: 100%;
		}

		.cart-header {
			display: grid;
			grid-template-columns: 50% 15% 10% 15% 10%;
			font-weight: bold;
			margin: 0 !important;

			background: #007bff;
			color: #fff;
			padding: 10px !important;
			margin-bottom: 4px;
			border-radius: 8px;
		}

		.cart-item {
			position: relative;
			display: grid;
			grid-template-columns: 50% 15% 10% 15% 10%;
			background: #fff;
			margin: 5px 0 !important;
			border-radius: 8px;
			box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
			overflow: hidden;
			border: 1px solid #ddd;
			padding: 10px !important;
		}


		.remove-from-cart {
			background-color: #FF0000;
			color: white;
			padding: 5px 20px;
			cursor: pointer;
			border: none;
			border-radius: 5px;
		}

		.cart-header span,
		.cart-item span {
			display: inline-block;
			padding: 3px;
			text-align: center;
			font-size: 14px;
		}

		.cart-header span {
			border-left: 1px solid;
		}

		.cart-header span:last-child {
			border-right: 1px solid;
		}

		.cart-summary {
			display: grid;
			grid-template-columns: 75% 15% 10%;

		}

		.cart-summary span {
			padding: 10px;
		}

		.cart-summary span:nth-child(2),
		.cart-summary span:nth-child(3) {
			box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
			border-radius: 10px;
		}

		.cart-summary span:nth-child(2) {
			background: #007bff;
			color: #fff;
		}

		.cart-summary span:nth-child(3) {
			text-align: center;
		}

		.img-thumbnail {
			position: relative;
			width: 100%;
		}

		.group-img-thumbnail {
			display: grid;
			grid-template-columns: 6% 20% 74%;
			position: relative;
			padding-top: 25px;
		}

		.group-img-thumbnail .img-thumbnail:first-child {
			height: auto;
			left: 50%;
			top: 10px;
		}

		.arrow-image {
			position: absolute;
			top: -10px;
			left: 0 !important;
			width: 100% !important;
			height: auto;
			z-index: 2;
			pointer-events: none;
		}

		.arrow-height {
			position: absolute;
			bottom: 40%;
			right: 50%;
			padding: 2px 0;
			background: white;
			font-weight: bold;
			font-size: 10px;
			writing-mode: sideways-lr;
			z-index: 3
		}

		.arrow-width {
			position: absolute;
			top: -30px;
			left: 50%;
			background: white;
			font-weight: bold;
			font-size: 10px;
			z-index: 3;
		}


		.arrow-length {
			position: absolute;
			top: -18px;
			left: 50%;
			transform: translateX(-50%);
			background: white;
			font-weight: bold;
			padding: 0px 10px;
			font-size: 12px;
			z-index: 3;
		}

		.main-image {
			display: block;
			width: 100%;
			height: auto;
			z-index: 1;
		}
        /* สไตล์ Radio Buttons สำหรับสี */
        .belt-radio-input input[type=radio] { display: none; }
        .belt-radio-input input[type=radio]+label span {
            display: inline-block; width: 35px; height: 35px;
            margin: 2px; vertical-align: middle; cursor: pointer;
            border-radius: 50%; border: 2px solid #ddd;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: all 0.2s;
        }

        /* สีที่เลือกได้ (เขียว) */
        .belt-radio-input input[type=radio]:checked+label span {
            border: 3px solid #007bff;
            transform: scale(1.1);
        }

        /* สีที่ถูก Disabled (เลือกไม่ได้) */
        .belt-radio-input input[type=radio]:disabled+label span {
            cursor: not-allowed;
            opacity: 0.3; /* ทำให้ดูจางลง */
            filter: grayscale(0.8); /* ทำให้ออกสีเทาๆ */
        }

        .belt-radio-input input[type=radio]#belt-color-green+label span { background-color: #2ecc71; }
        .belt-radio-input input[type=radio]#belt-color-black+label span { background-color: #000; }
        .belt-radio-input input[type=radio]#belt-color-white+label span { background-color: #fff; border: 1px solid #ccc; }
        .belt-radio-input input[type=radio]#belt-color-blue+label span  { background-color: #3498db; }

        /* ส่วนอื่นๆ ของ UI */
        .belt-radio {
            display: inline-flex; flex-wrap: wrap; background: #fff;
            border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1);
            border: 1px solid #ddd; padding: 5px;
        }
        .belt-radio input { display: none; }
        .belt-radio label {
            padding: 8px 15px; cursor: pointer; font-size: 13px;
            transition: background 0.3s; border-radius: 4px;
        }
        .belt-radio input:checked+label { background: #007bff; color: white; font-weight: bold; }
        .belt-conveyor-header { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .belt-main-preview { width: 100%; border-radius: 10px; overflow: hidden; background: #f8f9fa; border: 1px solid #eee; }
        .belt-main-preview img { width: 100%; height: auto; display: block; }
        .belt-price-final { color: #ff0000; font-weight: bold; font-size: 32px; }
        .belt-select-wrap select { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #ddd; }
        
        @media (max-width: 768px) { .belt-conveyor-header { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
    .header_image { width: 70%; }
    .arrow-width { left: 20%; }
}

/* Conveyor calculator: two-panel product configurator */
#priceForm .conveyor_header {
    grid-template-columns: 1fr 1fr;
    gap: 1%;
    align-items: stretch;
}

#priceForm .option_conveyor_mobile {
    min-width: 0;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

#priceForm .option_conveyor_mobile {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
    line-height: 1.35;
}

#priceForm .option_conveyor_mobile > * { min-width: 0; }
#priceForm .detail_conveyor,
#priceForm [ass="detail_conveyor"] { order: -2; width: 100%; margin: 0; color: #475569; font-size: 13px; }

#priceForm .conveyor-step {
    display: block;
    width: 100%;
    margin: 6px 0 4px;
    padding: 0 !important;
    color: #000000;
    font-size: 14px;
    font-weight: 700;
}

#priceForm .conveyor-dimensions,
#priceForm .group-2 { display: grid; width: 100%; gap: 12px; margin: 0; }
#priceForm .conveyor-dimensions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#priceForm .group-2 { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
#priceForm .conveyor-dimensions > div,
#priceForm .group-2 > div { min-width: 0; }

#priceForm .conveyor-dimensions > div > label {
    display: block;
    padding: 0 !important;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
}

#priceForm .select-conveyor {
    width: 100%;
    height: 42px;
    margin-top: 5px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}
#priceForm .select-conveyor::after { display: none; }
#priceForm .select-conveyor select {
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100%;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent !important;
    color: #0f172a !important;
    font-size: 13px;
}

#priceForm .radio { display: flex; width: 100%; min-height: 38px; padding: 0; overflow: visible; border: 0; box-shadow: none; background: transparent; gap: 8px; }
#priceForm .radio label {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    padding: 7px 10px !important;
    border: 1px solid #dbe4ef;
    border-radius: 5px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
#priceForm .radio label span { color: #9b9b9b; font-size: 11px; margin-left: 4px; }
#priceForm .radio input:checked + label { border-color: #0563df; background: #0563df; color: #fff; }

#priceForm .price_conveyor {
    order: 20;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 70px;
    margin: 8px -24px -24px;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
#priceForm .price_conveyor > label:first-child { margin-right: auto; color: #0f172a; font-size: 14px; font-weight: 700; }
#priceForm #price { margin-right: 12px; }
#priceForm #discountedPrice { color: #ef1111 !important; font-size: 24px !important; }
#priceForm .radio-input { display: flex; gap: 4px; }

@media (max-width: 900px) { #priceForm .conveyor_header { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    #priceForm .option_conveyor_mobile { padding: 16px; }
    #priceForm .conveyor-dimensions,
    #priceForm .group-2 { grid-template-columns: 1fr; }
    #priceForm .radio { flex-wrap: wrap; }
    #priceForm .radio label { flex: 1 1 45%; }
    #priceForm .price_conveyor { margin: 8px -16px -16px; padding: 12px 16px; }
}
