/* LƯỚI THẺ DỊCH VỤ */
.services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 30px;
	padding: 20px 0;
}
.service-card {
	background: #fff;
	border-radius: 12px;
	border: 1px solid #eef2f5;
	padding: 30px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.05);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: transform 0.3s;
}
.service-card:hover {
	transform: translateY(-5px);
}
.card-icon {
	width: 50px;
	height: 50px;
	background: #fff5f5;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
}
.card-icon img {
	border-radius: 50px;
}
.card-title {
	font-size: 20px;
	font-weight: 700;
	color: #111;
	margin-bottom: 15px;
}
.card-desc {
	font-size: 14px;
	color: #666;
	line-height: 1.6;
	margin-bottom: 20px;
}
.card-features {
	list-style: none;
	padding: 0;
	margin: 0 0 25px 0;
}
.card-features li {
	font-size: 14px;
	color: #444;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	padding-left: 0;
}
.card-features li .checkmark {
	color: #e30613;
	font-weight: bold;
	margin-right: 10px;
}
.card-footer {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	border-top: 1px solid #f0f0f0;
	padding-top: 20px;
}
.footer-note {
	font-size: 13px;
	color: #777;
}
.open-quote-modal-btn {
	background: #e30613;
	color: #fff;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.2s;
}
.open-quote-modal-btn:hover {
	background: #b8050f;
}

/* GIAO DIỆN MODAL POPUP */
.quote-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}
.quote-modal.active {
	opacity: 1;
	pointer-events: auto;
}
.modal-content {
	background: #fff;
	width: 100%;
	max-width: 650px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0,0,0,0.2);
	animation: slideDown 0.3s ease;
	max-height: 60vh;
	display: flex;
	flex-direction: column;
}
@keyframes slideDown {
	from { transform: translateY(-20px); }
	to { transform: translateY(0); }
}
.modal-header {
	background: #d90416;
	color: #fff;
	padding: 15px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.header-title-wrapper {
	display: flex;
	align-items: center;
}
.header-icon {
	font-size: 24px;
	margin-right: 12px;
}
.header-text h4 {
	margin: 0;
	font-size: 18px;
	color: #fff;
	font-weight: 700;
}
.header-text p {
	margin: 3px 0 0 0;
	font-size: 12px;
	color: rgba(255,255,255,0.8);
}
.close-modal-btn {
	font-size: 28px;
	cursor: pointer;
	line-height: 1;
	color: #fff;
	opacity: 0.8;
}
.close-modal-btn:hover {
	opacity: 1;
}
.modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

/* CSS BỘ TÍNH TOÁN */
.calc-row {
	margin-bottom: 15px;
}
.calc-row.col-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
.calc-row.col-2 {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}
.calc-row label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #334155;
	margin-bottom: 6px;
	text-transform: uppercase;
}
.calc-row select, .calc-row input[type="number"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 14px;
	color: #334155;
	background-color: #f8fafc;
	box-shadow: unset;
}

/* SLIDER RANGE */
.qty-slider-row {
	margin: 25px 0;
}
.slider-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}
.qty-display {
	font-size: 18px;
	font-weight: 800;
	color: #d90416;
}
.calc-qty-slider {
	width: 100%;
	cursor: pointer;
	accent-color: #d90416;
}
.slider-labels {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: #94a3b8;
	margin-top: 5px;
}

/* HỘP KẾT QUẢ */
.calc-result-box {
	background: #fff5f5;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 25px;
}
.result-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px dashed #fca5a5;
	padding-bottom: 8px;
	margin-bottom: 12px;
}
.result-title {
	font-weight: 800;
	color: #d90416;
	font-size: 13px;
}
.bags-per-kg-badge {
	background: #fee2e2;
	color: #ef4444;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}
.result-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
}
.res-col {
	display: flex;
	flex-direction: column;
}
.res-label {
	font-size: 12px;
	color: #64748b;
	margin-bottom: 4px;
}
.res-value {
	font-size: 20px;
	font-weight: 800;
	color: #d90416;
}
.res-value small {
	font-size: 13px;
	font-weight: normal;
	color: #64748b;
}
.res-subtext {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}

/* THIẾT KẾ PHẦN FORM LIÊN HỆ TRONG MODAL */
.contact-section {
	border-top: 1px solid #e2e8f0;
	padding-top: 20px;
}
.contact-title {
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 15px;
}
.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 12px;
}
@media (max-width: 480px) {
	.form-row {
		grid-template-columns: 1fr;
	}
	.result-body {
		grid-template-columns: 1fr;
	}
}
.contact-info-form input[type="text"],
.contact-info-form input[type="tel"],
.contact-info-form textarea {
	width: 100%;
	padding: 22px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	background-color: #fff;
	box-shadow: unset;
}
.red-submit-btn {
	width: 100%;
	background: #d90416 !important;
	color: #fff !important;
	border: none !important;
	padding: 14px 20px !important;
	border-radius: 6px !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	cursor: pointer;
	transition: background 0.2s;
	text-transform: uppercase;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.red-submit-btn:hover {
	background: #b8050f !important;
}


/* ICON TRÊN THẺ CARD */
.card-features li .card-check-icon {
	color: #e30613;
	font-size: 15px;
	margin-right: 10px;
	display: inline-block;
	vertical-align: middle;
}

/* MODAL CHÍNH */
.quote-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	/* Thiết lập z-index cực lớn để đè lên mọi menu của Flatsome và Admin bar */
	z-index: 99999999 !important; 
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	padding: 20px;
	box-sizing: border-box;
}

.quote-modal.active {
	opacity: 1;
	pointer-events: auto;
}

/* HỘP NỘI DUNG MODAL */
.modal-content {
	background: #fff;
	width: 100%;
	max-width: 650px;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	/* Khống chế chiều cao tối đa của modal tránh tràn màn hình */
	max-height: 70vh; 
	overflow: hidden;
}

/* CHỈ CUỘN TRONG PHẦN BODY */
.modal-body {
	padding: 20px;
	overflow-y: auto; /* Tạo thanh cuộn nội dung chỉ riêng phần này */
	flex: 1;
}

.modal-header {
	background: #d90416;
	color: #fff;
	padding: 15px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0; /* Header cố định, không bị méo khi co dãn */
}

.header-title-wrapper {
	display: flex;
	align-items: center;
}

.header-icon {
	font-size: 20px;
	margin-right: 12px;
	color: #fff;
}

.close-modal-btn {
	font-size: 18px;
	cursor: pointer;
	color: #fff;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.close-modal-btn:hover {
	opacity: 1;
}







/* CONTAINER CHÍNH CỦA FORM */
.contact-info-form {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-top: 15px;
	width: 100%;
}

/* Hàng chia đôi (Họ tên & SĐT) */
.form-row-half {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	width: 100%;
}

/* Hàng tràn viền rộng 100% (Ghi chú & Nút bấm) */
.form-row-full {
	width: 100%;
}

/* Đảm bảo các wrapper tự sinh của Contact Form 7 chiếm trọn chiều rộng */
.contact-info-form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

/* Kiểu dáng chung cho các ô input và textarea */
.contact-info-form input[type="text"],
.contact-info-form input[type="tel"],
.contact-info-form textarea {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	padding: 22px 16px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 14px;
	background-color: #fff;
	color: #333;
	transition: border-color 0.2s, box-shadow 0.2s;
}

/* Hiệu ứng khi nhấn chọn (Focus) */
.contact-info-form input:focus,
.contact-info-form textarea:focus {
	border-color: #d90416;
	box-shadow: 0 0 0 3px rgba(217, 4, 22, 0.1);
	outline: none;
}

/* Định dạng riêng cho ô Ghi chú */
.contact-info-form textarea {
	height: 100px;
	resize: vertical; /* Cho phép co dãn chiều cao theo chiều dọc */
}

/* NÚT BẤM GỬI MÀU ĐỎ */
.submit-row {
	margin-top: 10px;
}

.red-submit-btn {
	width: 100% !important;
	background: #d90416 !important;
	color: #fff !important;
	border: none !important;
	padding: 14px 20px !important;
	border-radius: 6px !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	cursor: pointer;
	text-transform: uppercase;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: background 0.2s, transform 0.1s;
}

.red-submit-btn:hover {
	background: #b8050f !important;
}

.red-submit-btn:active {
	transform: scale(0.98);
}

.red-submit-btn i {
	font-size: 14px;
}

/* Responsive cho điện thoại di động */
@media (max-width: 576px) {
	.form-row-half {
		grid-template-columns: 1fr; /* Chuyển thành 1 hàng dọc trên màn hình nhỏ */
		gap: 15px;
	}
}



/* ICON TRÊN THẺ CARD */
.card-features li .card-check-icon {
	color: #e30613;
	font-size: 15px;
	margin-right: 10px;
	display: inline-block;
	vertical-align: middle;
}

/* NỀN ĐEN PHỦ TOÀN BỘ MÀN HÌNH */
.ktp-quote-modal {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	background: rgba(0, 0, 0, 0.6) !important;
	display: flex !important; 
	align-items: center !important;
	justify-content: center !important;
	z-index: 999999999 !important; /* Đè tuyệt đối lên Header và Admin bar */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	padding: 20px;
	box-sizing: border-box !important;
}

.ktp-quote-modal.active {
	opacity: 1 !important;
	pointer-events: auto !important;
}

/* KHUNG NỘI DUNG POPUP - TRÁNH TRÙNG LẶP BOOTSTRAP */
.ktp-modal-container {
	background: #fff !important;
	width: 100% !important;
	max-width: 650px !important;
	border-radius: 12px !important;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
	display: flex !important;
	flex-direction: column !important;
	max-height: 60vh !important; /* Tránh tràn viền trên dưới */
	overflow: hidden !important;
	border: none !important;
}

/* HEADER POPUP CỐ ĐỊNH */
.ktp-modal-header {
	background: #d90416 !important;
	color: #fff !important;
	padding: 15px 20px !important;
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	flex-shrink: 0 !important;
	border: none !important;
}

/* PHẦN THÂN CÓ THỂ CUỘN - ĐÃ FIX LỖI SAFARI/IPHONE KHÔNG CUỘN */
.ktp-modal-body {
	padding: 20px !important;
	overflow-y: auto !important;
	flex: 1 !important;
	-webkit-overflow-scrolling: touch !important; /* Vuốt cuộn mượt trên iPhone */
	background: #fff !important;
}

.ktp-close-modal-btn {
	font-size: 18px !important;
	cursor: pointer !important;
	color: #fff !important;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.ktp-close-modal-btn:hover {
	opacity: 1;
}

/* ĐỊNH DẠNG SELECT DROPDOWN TRÊN ĐIỆN THOẠI */
.ktp-modal-body select {
	width: 100% !important;
	padding: 8px 30px 8px 12px !important; /* Tránh đè lên mũi tên */
	border: 1px solid #cbd5e1 !important;
	border-radius: 6px !important;
	font-size: 14px !important;
	background-color: #f8fafc !important;
	color: #334155 !important;
	/* Xử lý mũi tên riêng cho Safari iOS */
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	background-image: url("data:image/svg+xml;utf8,<svg fill='%23334155' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
	background-repeat: no-repeat !important;
	background-position: calc(100% - 10px) 50% !important;
	text-overflow: ellipsis !important;
	white-space: nowrap !important;
	overflow: hidden !important;
}

/* ĐỊNH DẠNG INPUT KÍCH THƯỚC */
.calc-row input[type="number"] {
	width: 100% !important;
	padding: 8px 12px !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 6px !important;
	font-size: 14px !important;
	background-color: #f8fafc !important;
	color: #334155 !important;
}

/* TỐI ƯU GIAO DIỆN TRÊN MOBILE */
@media (max-width: 576px) {
	.ktp-quote-modal {
		padding: 10px !important; /* Thu hẹp khoảng cách viền màn hình */
	}

	.ktp-modal-container {
		max-height: 70vh !important; /* Mở rộng tối đa khung modal trên điện thoại */
		border-radius: 8px !important;
	}

	.ktp-modal-body {
		padding: 15px !important;
	}

	/* Gộp 2 ô chọn "Độ dày" và "Số màu" thành 1 cột dọc để không bị cắt chữ */
	.calc-row.col-2 {
		grid-template-columns: 1fr !important;
		gap: 12px !important;
	}

	/* Giữ nguyên 3 cột kích thước nhưng thu nhỏ kích cỡ nhãn */
	.calc-row.col-3 {
		grid-template-columns: 1fr 1fr 1fr !important;
		gap: 8px !important;
	}

	.calc-row.col-3 label {
		font-size: 10px !important;
		white-space: nowrap !important;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.calc-row.col-3 input {
		font-size: 13px !important;
		padding: 8px !important;
	}

	.ktp-modal-body select {
		font-size: 13px !important;
	}
	
	.open-quote-modal-btn {
		width: 100%;
		margin: 0;
	}
}