/* Kostik Hesaplayıcı – SabunYapimi.com */
.kh-hesaplayici {
	--kh-ana: #4a7c59;
	--kh-ana-koyu: #355c41;
	--kh-zemin: #f7f8f5;
	--kh-cizgi: #dfe3da;
	--kh-metin: #2b2f2a;
	--kh-soluk: #6b7268;
	--kh-uyari: #b7791f;
	--kh-hata: #c53030;
	color: var(--kh-metin);
	max-width: 860px;
	margin: 0 auto 2em;
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}
.kh-hesaplayici *, .kh-hesaplayici *::before, .kh-hesaplayici *::after { box-sizing: border-box; }
.kh-hesaplayici [hidden] { display: none !important; }

.kh-baslik { margin: 0 0 .6em; }

.kh-bolum {
	border: 1px solid var(--kh-cizgi);
	border-radius: 10px;
	padding: 1em 1.2em 1.2em;
	margin: 0 0 1em;
	background: #fff;
}
.kh-bolum legend { font-weight: 700; padding: 0 .4em; }

.kh-secenekler { display: flex; flex-wrap: wrap; gap: .4em 1.4em; margin-bottom: .6em; }
.kh-secenekler label { display: inline-flex; align-items: center; gap: .4em; cursor: pointer; margin: 0; font-weight: 400; }
.kh-secenekler input { margin: 0; }

.kh-satir { display: grid; grid-template-columns: 230px 1fr; gap: .3em 1em; align-items: center; margin: .6em 0; }
.kh-satir label { margin: 0; font-weight: 600; }
.kh-satir small { grid-column: 2; color: var(--kh-soluk); font-size: .85em; }
.kh-satir input, .kh-satir select { max-width: 260px; }

.kh-hesaplayici input[type="text"], .kh-hesaplayici select {
	width: 100%;
	height: 42px;
	padding: 0 .7em;
	border: 1px solid var(--kh-cizgi);
	border-radius: 8px;
	background: #fff;
	font-size: 16px; /* iOS yakınlaştırmasını engeller */
	color: inherit;
}
.kh-hesaplayici input:focus, .kh-hesaplayici select:focus { outline: 2px solid var(--kh-ana); outline-offset: 1px; border-color: var(--kh-ana); }

.kh-yag-listesi { display: flex; flex-direction: column; gap: .5em; margin-top: .6em; }
.kh-yag-satir { display: grid; grid-template-columns: 1fr 140px 42px; gap: .5em; align-items: center; }
.kh-miktar { position: relative; display: block; }
.kh-miktar input { padding-right: 2em !important; text-align: right; }
.kh-birim { position: absolute; right: .7em; top: 50%; transform: translateY(-50%); color: var(--kh-soluk); pointer-events: none; }
.kh-sil {
	width: 42px; height: 42px; border: 1px solid var(--kh-cizgi); border-radius: 8px;
	background: #fff; color: var(--kh-soluk); font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.kh-sil:hover { color: var(--kh-hata); border-color: var(--kh-hata); }

.kh-yag-alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6em; margin-top: .8em; }
.kh-yuzde-toplam { font-weight: 600; }
.kh-yuzde-toplam.kh-tamam { color: var(--kh-ana); }
.kh-yuzde-toplam.kh-eksik { color: var(--kh-hata); }

.kh-dugme {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 0 1.2em; border-radius: 8px; border: 1px solid var(--kh-ana);
	background: var(--kh-ana); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.kh-dugme:hover { background: var(--kh-ana-koyu); border-color: var(--kh-ana-koyu); color: #fff; }
.kh-dugme:disabled { opacity: .6; cursor: wait; }
.kh-dugme.kh-ikincil { background: #fff; color: var(--kh-ana); }
.kh-dugme.kh-ikincil:hover { background: var(--kh-zemin); color: var(--kh-ana-koyu); }
.kh-dugme.kh-sepet { background: #c76b2a; border-color: #c76b2a; }
.kh-dugme.kh-sepet:hover { background: #a85820; border-color: #a85820; }

.kh-islemler { display: flex; flex-wrap: wrap; gap: .6em; margin: 1em 0; }

.kh-uyari-kutu {
	border-left: 4px solid var(--kh-uyari);
	background: #fdf8ee;
	padding: .8em 1em;
	border-radius: 6px;
	margin: 1em 0;
	font-size: .95em;
}
.kh-uyari-kutu ul { margin: .4em 0 0 1.2em; padding: 0; }
.kh-uyari-kutu li { margin: .2em 0; }
.kh-guvenlik { border-left-color: var(--kh-hata); background: #fdf1f1; }
.kh-hata { border-left-color: var(--kh-hata); background: #fdf1f1; color: var(--kh-hata); }
.kh-basari { border-left-color: var(--kh-ana); background: #eef5f0; }

.kh-sonuc { background: var(--kh-zemin); border: 1px solid var(--kh-cizgi); border-radius: 10px; padding: 1.2em; }
.kh-sonuc:empty { display: none; }
.kh-tarif-basligi { margin: 0 0 .8em; }
.kh-sonuc h4 { margin: 1.4em 0 .6em; }

.kh-ozet { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6em; margin-bottom: 1em; }
.kh-kart { background: #fff; border: 1px solid var(--kh-cizgi); border-radius: 8px; padding: .7em .9em; }
.kh-kart span { display: block; font-size: .82em; color: var(--kh-soluk); }
.kh-kart strong { font-size: 1.35em; }
.kh-kart.kh-vurgu { border-color: var(--kh-ana); background: #eef5f0; }
.kh-kart.kh-vurgu strong { color: var(--kh-ana-koyu); }

.kh-tablo { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; margin: 0; }
.kh-tablo th, .kh-tablo td { padding: .55em .8em; border-bottom: 1px solid var(--kh-cizgi); text-align: left; }
.kh-tablo th:not(:first-child), .kh-tablo td:not(:first-child) { text-align: right; white-space: nowrap; }
.kh-tablo thead th { background: #eef1ea; font-size: .88em; }
.kh-tablo tr.kh-ara td { border-top: 2px solid var(--kh-cizgi); }

.kh-detay { color: var(--kh-soluk); font-size: .9em; margin: .6em 0 0; }
.kh-not { color: var(--kh-soluk); font-size: .82em; margin: 1em 0 0; }

.kh-ozellikler { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7em 1.4em; }
.kh-ozellik-ust { display: flex; justify-content: space-between; gap: .5em; font-size: .92em; }
.kh-ozellik-ust small { color: var(--kh-soluk); }
.kh-cubuk { position: relative; height: 10px; background: #e6e9e2; border-radius: 5px; margin-top: .3em; overflow: hidden; }
.kh-aralik { position: absolute; top: 0; bottom: 0; background: rgba(74, 124, 89, .22); }
.kh-dolgu { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 4px; background: var(--kh-ana); }
.kh-ozellik.kh-dusuk .kh-dolgu, .kh-ozellik.kh-yuksek .kh-dolgu { background: var(--kh-uyari); }

.kh-sepet-mesaj a { font-weight: 600; }

@media (max-width: 640px) {
	.kh-bolum { padding: .9em; }
	.kh-satir { grid-template-columns: 1fr; }
	.kh-satir small { grid-column: 1; }
	.kh-satir input, .kh-satir select { max-width: none; }
	.kh-yag-satir { grid-template-columns: 1fr 100px 42px; }
	.kh-islemler .kh-dugme { flex: 1 1 100%; }
}

/* Yazdırma: yalnızca tarif sonucu */
@media print {
	body.kh-yazdiriliyor * { visibility: hidden !important; }
	body.kh-yazdiriliyor .kh-yazdirilan .kh-yazdir-alani,
	body.kh-yazdiriliyor .kh-yazdirilan .kh-yazdir-alani * { visibility: visible !important; }
	body.kh-yazdiriliyor .kh-yazdirilan .kh-yazdir-alani { position: absolute; left: 0; top: 0; width: 100%; }
	body.kh-yazdiriliyor .kh-form { display: none !important; }
	.kh-sonuc { border: 0; background: #fff; padding: 0; }
	.kh-kart, .kh-tablo { break-inside: avoid; }
	.kh-cubuk, .kh-dolgu, .kh-aralik { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
