/* Konfigurátor ohybů kolejnic – frontend styly.
   Navazuje na design e-shopu (zelená #6dab3c, Roboto, zaoblené pilulky). */

:root {
	--ohyb-green: #6dab3c;
	--ohyb-green-d: #5a9a30;
	--ohyb-ink: #363636;
	--ohyb-ink2: #8e8e8e;
	--ohyb-border: #d1d1d1;
	--ohyb-red: #ef4444;
}

/* ---- spouštěč a souhrn pod polem délky (uvnitř boxu „Délka kolejnice") ---- */
/* Plná šířka = ve flex-wrap kontejneru .number-input-wrap se zalomí na nový řádek. */
.ohyb-trigger-wrap { margin-top: 9px; flex-basis: 100%; width: 100%; }
.ohyb-add-link {
	display: inline-block;
	font-weight: 700;
	font-size: 14px;
	color: var(--ohyb-green);
	text-decoration: none;
	cursor: pointer;
}
.ohyb-add-link:hover { color: var(--ohyb-green-d); text-decoration: underline; }

.ohyb-seg-sum { margin-top: 6px; font-weight: 700; font-size: 15px; color: var(--ohyb-ink); }
.ohyb-parts { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #dcdcd0; font-size: 14px; line-height: 1.5; color: #555; }
.ohyb-parts-h { font-size: 12px; color: var(--ohyb-ink2); margin-bottom: 4px; }
.ohyb-tot { margin-top: 6px; font-weight: 700; color: var(--ohyb-ink); }
.ohyb-actions { margin-top: 10px; display: flex; gap: 18px; }
.ohyb-actions a { font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; }
.ohyb-edit { color: var(--ohyb-green); }
.ohyb-remove { color: var(--ohyb-red); }

.ohyb-preview-icon {
	margin-left: 8px; width: 36px; height: 36px; vertical-align: middle;
	border: 1px solid var(--ohyb-border); background: #fff; border-radius: 50%;
	color: var(--ohyb-ink2); cursor: pointer; display: inline-flex;
	align-items: center; justify-content: center; padding: 0;
}
.ohyb-preview-icon:hover { color: var(--ohyb-green); border-color: var(--ohyb-green); }

input.ohyb-locked { background: #efefef !important; color: #888 !important; }

/* ---- modal overlay ---- */
body.ohyb-modal-open { overflow: hidden; }
.ohyb-overlay {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(20, 20, 30, .5);
	display: flex; align-items: center; justify-content: center; padding: 20px;
	font-family: Roboto, Arial, sans-serif;
}
.ohyb-modal {
	position: relative; background: #fff; border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	width: 880px; max-width: 100%; max-height: 92vh; overflow: auto;
	padding: 40px 40px 32px; color: #555; box-sizing: border-box;
}
.ohyb-modal h2 { margin: 0 0 4px; font-size: 20px; color: var(--ohyb-ink); font-weight: 700; }
.ohyb-close {
	position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
	border: 1px solid var(--ohyb-border); background: #fff; border-radius: 50%;
	font-size: 18px; line-height: 1; color: var(--ohyb-ink2); cursor: pointer;
}
.ohyb-close:hover { color: var(--ohyb-ink); }
.ohyb-lead { margin: 18px 0 4px; font-weight: 700; font-size: 13px; color: #555; }
.ohyb-sub { margin: 4px 0 0; font-size: 13px; color: #777; }
.ohyb-back { display: inline-block; margin-bottom: 14px; font-weight: 700; font-size: 14px; color: #555; text-decoration: none; cursor: pointer; }
.ohyb-back:hover { color: var(--ohyb-ink); }

/* ---- modal 1: tvary ---- */
.ohyb-shapes { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 20px; }
.ohyb-shape { cursor: pointer; }
.ohyb-shape-box {
	background: rgba(227, 230, 231, .6); border-radius: 8px; height: 116px;
	display: flex; align-items: flex-start; justify-content: center; padding: 10px 16px 0;
	transition: outline .1s, background .1s;
}
.ohyb-shape:hover .ohyb-shape-box { background: #eef4e7; outline: 2px solid var(--ohyb-green); outline-offset: 2px; }
.ohyb-shape-cap { margin-top: 10px; font-weight: 700; font-size: 14px; color: #555; }

/* ---- modal 2: rozměry ---- */
.ohyb-m2grid { margin-top: 14px; display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
.ohyb-m2lab { font-weight: 700; font-size: 14px; color: #555; margin: 16px 0 8px; }
.ohyb-m2lab:first-of-type { margin-top: 14px; }
.ohyb-m2pill { display: flex; align-items: center; background: #fff; border: 1px solid var(--ohyb-border); border-radius: 24px; padding: 10px 18px; width: 100%; box-sizing: border-box; }
.ohyb-m2pill input { border: 0; outline: 0; width: 100%; font-weight: 700; font-size: 18px; color: var(--ohyb-ink); background: transparent; }
.ohyb-m2pill .unit { font-size: 15px; color: var(--ohyb-ink2); }
.ohyb-preview { background: #efefef; border-radius: 8px; padding: 16px; position: relative; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.ohyb-preview-svg { width: 100%; }
.ohyb-preview-svg svg { width: 100%; height: auto; display: block; }
.ohyb-tot-badge { position: absolute; right: 16px; bottom: 12px; font-weight: 700; font-size: 13px; color: #555; }

.ohyb-warn {
	margin-top: 18px;
	padding: 12px 16px;
	border: 1px solid #f0c0c0;
	background: #fdf1f1;
	border-radius: 8px;
	color: #b3261e;
	font-size: 13px;
	line-height: 1.5;
	font-weight: 500;
}
.ohyb-confirm-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.ohyb-m2foot { margin-top: 28px; display: flex; align-items: center; justify-content: flex-end; gap: 24px; flex-wrap: wrap; }
.ohyb-price { text-align: left; border-right: 2px solid #afafaf; padding-right: 24px; }
.ohyb-price .lab { font-size: 14px; color: #555; }
.ohyb-price .big { margin-top: 6px; font-size: 26px; color: #4ab900; font-weight: 500; }
.ohyb-price .big small { font-size: 14px; color: #555; font-weight: 400; margin-left: 5px; }
.ohyb-confirm {
	height: 48px; padding: 0 34px; border: 0; border-radius: 24px; cursor: pointer; color: #fff;
	font-weight: 700; font-size: 14px; letter-spacing: .03em;
	background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .02)), var(--ohyb-green);
	box-shadow: 0 6px 16px rgba(109, 171, 60, .35);
}
.ohyb-confirm:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .02)), var(--ohyb-green-d); }

/* ---- lightbox ---- */
.ohyb-modal-lightbox { width: 560px; padding: 0; }
.ohyb-lb-h { padding: 18px 24px; border-bottom: 1px solid #eee; }
.ohyb-lb-h h2 { font-size: 18px; }
.ohyb-lb-b { padding: 24px; }
.ohyb-lb-b svg { width: 100%; height: auto; }

/* ---- responzivita ---- */
@media (max-width: 700px) {
	.ohyb-modal { padding: 28px 18px 24px; }
	.ohyb-shapes { grid-template-columns: 1fr 1fr; gap: 16px 12px; }
	.ohyb-shape-box { height: 96px; }
	.ohyb-m2grid { grid-template-columns: 1fr; gap: 18px; }
	.ohyb-preview { min-height: 200px; }
	.ohyb-m2foot { flex-direction: column; align-items: stretch; }
	.ohyb-price { border-right: 0; border-bottom: 2px solid #afafaf; padding: 0 0 14px; }
	.ohyb-confirm { width: 100%; }
}
