/* Price calculator on a WordPress page (shortcode [vdperanto_calculator]).
   Replaces the stand-alone /calculator/configure.html, whose summary panel was position:fixed with
   a hard-coded height of 650px (top 100px) and lost its submit button on screens lower than 750px. */
.it-calc { color: #292121; }
.it-calc *, .it-calc *::before, .it-calc *::after { box-sizing: border-box; }
.it-calc-note { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: #737f85; }

.it-calc-form { display: flex; align-items: flex-start; gap: 24px; margin: 0; }
.it-calc-grid { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.it-calc-side { flex: 0 0 250px; width: 250px; align-self: stretch; }

/* module cards */
.it-calc .price-container { display: flex; flex-direction: column; border: 1px solid #dfe5e8; border-radius: 6px; background: #fff; }
.it-calc .price-title-container { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 14px; border-bottom: 1px solid #edf0f2; background: #f5fafb; border-radius: 6px 6px 0 0; }
.it-calc .price-title-text { font-size: 18px; line-height: 1.25; font-weight: 600; }
.it-calc .price-title-text a { color: #2997ab; text-decoration: none; }
.it-calc .price-title-text a:hover, .it-calc .price-title-text a:focus { text-decoration: underline; }
.it-calc .price-title-checkbox { flex: 0 0 auto; line-height: 0; }
.it-calc .price-title-checkbox input { width: 22px; height: 22px; margin: 0; cursor: pointer; accent-color: #2997ab; }
.it-calc .price-topics { flex: 1 1 auto; padding: 10px 14px; }
.it-calc .price-topics p { margin: 0; padding: 3px 0; font-size: 15px; line-height: 1.45; color: #4f5a60; }
.it-calc .price-price { padding: 10px 14px; border-top: 1px solid #edf0f2; font-size: 18px; font-weight: 600; text-align: center; color: #292121; }
.it-calc .price-price-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; padding: 10px 14px; border-top: 1px solid #edf0f2; }
.it-calc .price-qty-title { font-size: 15px; color: #4f5a60; }
.it-calc .price-qty-input input { width: 52px; height: 34px; padding: 4px 6px; border: 1px solid #c5ced3; border-radius: 4px; font-size: 16px; text-align: center; color: #292121; background: #fff; }
.it-calc .price-qty-result input { width: 96px; height: 34px; padding: 4px 6px; border: 0; background: transparent; font-size: 18px; font-weight: 600; text-align: center; color: #292121; }
.it-calc .price-qty-result input[hidden] { display: none; }

/* summary + order form */
.it-calc .cashingcart-container { position: sticky; top: 16px; padding: 16px; border-radius: 6px; background: #e4f1f4; }
.it-calc-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 0; }
.it-calc .cashingcart-title { font-size: 15px; color: #4f5a60; }
.it-calc .cashingcart-summ { font-size: 17px; font-weight: 600; white-space: nowrap; color: #292121; }
.it-calc-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid #bcd9df; }
.it-calc-total .cashingcart-title { font-size: 17px; font-weight: 600; color: #292121; }
.it-calc-total .cashingcart-summ { font-size: 22px; color: #1f7f90; }
.it-calc .cashingcart-summ span { color: inherit; }
.it-calc-fields { margin-top: 12px; }
.it-calc label.cashingcart-input { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 400; color: #4f5a60; }
.it-calc label.cashingcart-input input { display: block; width: 100%; height: 36px; margin-top: 3px; padding: 6px 10px; border: 1px solid #b9c9ce; border-radius: 4px; font-size: 15px; color: #292121; background: #fff; }
.it-calc .cashingcart-submit { margin-top: 12px; }
.it-calc .btn-order { display: block; width: 100%; min-height: 42px; padding: 10px 12px; border: 0; border-radius: 5px; background: #2997ab; color: #fff; font-family: Montserrat, "Droid Sans", Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; white-space: normal; cursor: pointer; }
.it-calc .btn-order:hover, .it-calc .btn-order:focus { background: #217d8e; }
.it-calc .btn-order[disabled] { opacity: .6; cursor: default; }
.it-calc-msg { margin-top: 8px; font-size: 15px; line-height: 1.35; }
.it-calc-msg:empty { display: none; }
.it-calc-msg.is-ok { color: #1c6b34; }
.it-calc-msg.is-error { color: #b3261e; }
.it-calc input:focus-visible { outline: 2px solid #2997ab; outline-offset: 1px; }

/* the panel must never be taller than the window: tighten it on low screens */
@media (min-width: 768px) and (max-height: 620px) {
	.it-calc .cashingcart-container { top: 8px; padding: 10px 14px; }
	.it-calc-sum { padding: 2px 0; }
	.it-calc-fields { margin-top: 6px; }
	.it-calc label.cashingcart-input { margin-bottom: 4px; }
	.it-calc label.cashingcart-input input { height: 30px; margin-top: 1px; }
	.it-calc .cashingcart-submit { margin-top: 8px; }
	.it-calc .btn-order { min-height: 36px; padding: 7px 10px; }
}
@media (min-width: 768px) and (max-height: 480px) {
	.it-calc .cashingcart-container { position: static; }
}

@media (max-width: 1199px) {
	.it-calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.it-calc-side { flex-basis: 230px; width: 230px; }
}
@media (max-width: 767px) {
	.it-calc-form { display: block; }
	.it-calc-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.it-calc-side { width: auto; margin-top: 16px; }
	.it-calc .cashingcart-container { position: static; }
	.it-calc .price-qty-input input, .it-calc label.cashingcart-input input { font-size: 16px; }
}

/* phones: total fixed to the bottom of the screen (the order panel is below all the cards) */
.it-calc-bar { display: none; }
@media (max-width: 767px) {
	.it-calc-bar:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; /* right 64px: the theme scroll-to-top button sits in that corner */ padding: 8px 64px 8px 15px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid #bcd9df; box-shadow: 0 -2px 8px rgba(0, 0, 0, .12); transition: transform .2s ease; }
	.it-calc-bar.is-off { transform: translateY(110%); }
	.it-calc-bar-sum { font-size: 15px; color: #292121; white-space: nowrap; }
	.it-calc-bar-total { font-size: 18px; color: #1f7f90; }
	.it-calc-bar-btn, .it-calc-bar-btn:hover, .it-calc-bar-btn:focus { flex: 0 0 auto; min-height: 40px; padding: 10px 18px; border-radius: 5px; background: #2997ab; color: #fff; font-family: Montserrat, "Droid Sans", Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 700; line-height: 20px; text-decoration: none; }
	.it-calc { padding-bottom: 8px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
	.it-calc-bar { transition: none; }
}
