/* Order request modal - Leave request form (himiya-core) */

.himiya-order-request-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.4em 0.75em;
	margin-right: 0.5em;
	background: var(--primary-color, #17475a);
	color: #fff;
	border: 1px solid var(--primary-color, #17475a);
	border-radius: 3px;
	font-size: 0.9em;
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
}
.himiya-order-request-btn:hover,
.himiya-order-request-btn:focus {
	background: var(--secondary-color, #0b2029);
	border-color: var(--secondary-color, #0b2029);
	color: #fff;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.head-2 {
	width: 100%;
}

.header-info-box .head-2 {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.header-info-box .head-2 form {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.himiya-header-order-request {
	flex: 0 0 auto;
	margin-left: auto;
}

.himiya-header-order-request-btn {
	min-height: 48px;
	margin-right: 0;
	padding: 0.7rem 1.35rem;
	border-radius: 3px;
	font-size: 1.05rem;
	font-weight: 600;
	background: var(--primary-color, #17475a);
	border-color: var(--primary-color, #17475a);
}

.himiya-header-order-request-btn:hover,
.himiya-header-order-request-btn:focus {
	background: var(--secondary-color, #0b2029);
	border-color: var(--secondary-color, #0b2029);
}

@media (max-width: 767px) {
	.header-info-box .head-2 {
		flex-direction: column;
		align-items: stretch;
	}

	.himiya-header-order-request {
		margin-left: 0;
		width: 100%;
	}

	.himiya-header-order-request-btn {
		width: 100%;
		justify-content: center;
	}
}

.himiya-order-request-float {
	position: fixed;
	bottom: 1rem;
	right: 1rem;
	z-index: 9998;
	display: none;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: var(--primary-color, #17475a);
	color: #fff;
	border: none;
	border-radius: 50%;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	text-decoration: none;
	font-size: 0.85rem;
}
.himiya-order-request-float:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
@media (max-width: 768px) {
	.himiya-order-request-float { display: flex; }
}
@media (min-width: 769px) {
	.himiya-order-request-float { display: none !important; }
}

/* Single product page: "Leave request" button replacing the cart button slot. */
.himiya-single-order-request {
	margin: 1em 0 1.25em;
}
.himiya-leave-request-product-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
@media (max-width: 480px) {
	.himiya-single-order-request { width: 100%; }
	.himiya-leave-request-product-btn { width: 100%; }
}

.himiya-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	visibility: hidden;
	opacity: 0;
	transition: visibility 0.25s, opacity 0.25s;
}
.himiya-modal-overlay[aria-hidden="false"] {
	display: flex;
	visibility: visible;
	opacity: 1;
}

.himiya-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 20, 27, 0.72);
	backdrop-filter: blur(3px);
	cursor: pointer;
}

.himiya-modal-wrap {
	position: relative;
	width: 100%;
	max-width: 680px;
	max-height: 90vh;
	overflow: auto;
	background: #fff;
	border: 1px solid #ccd4d5;
	border-top: 5px solid var(--hp-accent, #d19131);
	border-radius: 3px;
	box-shadow: 0 24px 64px rgba(5, 20, 27, 0.34);
}

.himiya-modal {
	position: relative;
	padding: clamp(1.35rem, 4vw, 2.25rem);
}
.himiya-modal-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #40545d;
	display: flex;
	align-items: center;
	justify-content: center;
}
.himiya-modal-close:hover {
	color: #10252e;
	background: #e8eceb;
}

.himiya-sectHead { margin-bottom: 1.25rem; }
.himiya-modal-title {
	margin: 0 0 0.65rem;
	color: #10252e;
	font-size: clamp(1.45rem, 4vw, 2rem);
	letter-spacing: -0.03em;
}
.himiya-modalDescr { margin: 0; font-size: 0.9rem; color: #40545d; line-height: 1.5; }
.himiya-modalDescr--warning {
	margin: 0;
	padding: 0.6rem 0.75rem 0.6rem 1.75rem;
	font-weight: 600;
	color: #de434b;
	background: #fff4f5;
	border-left: 3px solid #de434b;
	border-radius: 3px;
	line-height: 1.45;
	list-style: disc;
}
.himiya-modalDescr--warning li + li {
	margin-top: 0.35rem;
}

/* Grid + base field wrapper */
.himiya-modalForm .himiya-inputGrid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
}
.himiya-inputW { position: relative; }
.himiya-inputW._full { grid-column: 1 / -1; }
.himiya-mb-20 { margin-bottom: 1.25rem; }

.himiya-formInput,
.himiya-formText {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid #aab5b8;
	border-radius: 3px;
	font-size: 1rem;
	font-family: inherit;
	box-sizing: border-box;
}
.himiya-formText { resize: vertical; min-height: 4em; }
.himiya-formInput:focus,
.himiya-formText:focus {
	border-color: var(--primary-color, #17475a);
	box-shadow: 0 0 0 3px rgba(23, 71, 90, 0.11);
	outline: none;
}
.himiya-formInput:invalid:not(:placeholder-shown):not(:focus) { border-color: #b00; }
.himiya-formInput--qty { margin-bottom: 0 !important; }

/* Single-field wrappers with a trailing "?" tip */
.himiya-inputW--withTip > .himiya-formInput,
.himiya-inputW--withTip > .himiya-formText {
	padding-right: 2.25rem;
}
.himiya-inputW--withTip > .himiya-tip {
	position: absolute;
	top: 1.05rem;
	right: 0.55rem;
	transform: translateY(-50%);
}

/* Multi-field row (qty + unit + tip) */
.himiya-fieldRow {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: nowrap;
}
.himiya-fieldRow > .himiya-formInput {
	flex: 0 0 42%;
	min-width: 0;
}
.himiya-fieldRow > .himiya-formInput--unit {
	flex: 0 0 auto;
	width: 7.2rem;
}
.himiya-fieldRow > .himiya-tip {
	flex: 0 0 auto;
}

/* Quantity row: keep qty input and unit select identical in height. */
.himiya-fieldRow--qty {
	align-items: stretch;
}
.himiya-fieldRow--qty > .himiya-formInput--qty,
.himiya-fieldRow--qty > .himiya-formInput--unit {
	height: auto;
	align-self: stretch;
}
.himiya-fieldRow--qty > .himiya-tip,
.himiya-fieldRow--qty > .himiya-orderTotal {
	align-self: center;
}

/* Live order total shown next to qty/unit. */
.himiya-orderTotal {
	margin-left: auto;
	flex: 0 1 auto;
	min-width: 0;
	font-weight: 600;
	color: var(--primary-color, #17475a);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: right;
}
.himiya-orderTotal[hidden] {
	display: none;
}
.himiya-priceField {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	width: 100%;
}
.himiya-priceField > .himiya-formInput {
	width: 100%;
	box-sizing: border-box;
}
.himiya-priceField > .himiya-formInput:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	background-color: #f3f3f3;
}
.himiya-inlineCheckbox--firstPurchase {
	margin: 0;
}

.himiya-fieldRow--checkbox {
	padding: 0.15rem 0;
}

.himiya-inlineCheckbox {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1 1 auto;
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1.3;
}
.himiya-inlineCheckbox input[type="checkbox"] {
	width: 1.1em;
	height: 1.1em;
	flex-shrink: 0;
}

.himiya-fieldHint {
	margin: 0.35rem 0 0;
	font-size: 0.8rem;
	color: #6f6f6f;
	line-height: 1.35;
}

/* Live INN check status under the f_inn input. */
.himiya-inn-status {
	margin: 0.35rem 0 0;
	min-height: 1.1em;
	font-size: 0.85rem;
	line-height: 1.35;
}
.himiya-inn-status[data-state="idle"],
.himiya-inn-status[data-state="short"] { color: transparent; }
.himiya-inn-status[data-state="checking"] {
	color: #6f6f6f;
	font-style: italic;
}
.himiya-inn-status[data-state="success"] {
	color: #0a6e2a;
	font-weight: 600;
}
.himiya-inn-status[data-state="success"]::before {
	content: "\2713\00A0";
}
.himiya-inn-status[data-state="error"] {
	color: #b00020;
}
.himiya-inn-status[data-state="error"]::before {
	content: "\26A0\00A0";
}
.himiya-inn-status[data-state="soft_error"] {
	color: #8a6d00;
}

/* Agreement + submit */
.himiya-agreement {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}
.himiya-agreement input[type="checkbox"] {
	width: 1.2em;
	height: 1.2em;
	margin-top: 0.2em;
	flex-shrink: 0;
}
.himiya-agreement label { cursor: pointer; font-size: 0.9rem; }
.himiya-agreementText { display: inline; }
.himiya-agreementText a {
	color: var(--primary-color, #17475a);
	text-decoration: underline;
}
.himiya-agreementText a:hover,
.himiya-agreementText a:focus {
	color: var(--secondary-color, #0b2029);
}

.himiya-formBtn {
	width: 100%;
	min-height: 50px;
	padding: 0.75rem 1rem;
	background: var(--hp-accent, #d19131);
	color: var(--hp-dark, #0b2029);
	border: 1px solid var(--hp-accent, #d19131);
	border-radius: 3px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	margin-top: 0.5rem;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.himiya-formBtn:hover:not(:disabled),
.himiya-formBtn:focus-visible:not(:disabled) {
	background: var(--hp-dark, #0b2029);
	border-color: var(--hp-dark, #0b2029);
	color: #fff;
	transform: translateY(-1px);
}
.himiya-formBtn:disabled {
	background: var(--hp-surface-muted, #e8eceb);
	border-color: var(--hp-line, #ccd4d5);
	color: var(--hp-steel, #71838a);
	cursor: not-allowed;
	transform: none;
}
.himiya-formBtn.is-loading,
.himiya-formBtn.is-loading:disabled {
	background: var(--hp-accent-dark, #9d6518);
	border-color: var(--hp-accent-dark, #9d6518);
	color: #fff;
	cursor: progress;
	pointer-events: none;
}
.himiya-formBtn.is-loading::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.5em;
	vertical-align: -0.15em;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: himiya-formBtn-spin 0.7s linear infinite;
}
@keyframes himiya-formBtn-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.himiya-formBtn { transition: none; }
	.himiya-formBtn:hover:not(:disabled),
	.himiya-formBtn:focus-visible:not(:disabled) { transform: none; }
	.himiya-formBtn.is-loading::before { animation: none; }
}

.himiya-formMessages {
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	min-height: 1.4em;
}
.himiya-formMessages.error { color: #b00; }
.himiya-formMessages.success { color: #0a0; }

/* Product autocomplete dropdown */
.himiya-product-autocomplete {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 30;
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #ccd4d5;
	border-top: none;
	border-radius: 0 0 3px 3px;
	max-height: 220px;
	overflow-y: auto;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.himiya-product-autocomplete[aria-hidden="true"] { display: none; }
.himiya-product-autocomplete li {
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	border-bottom: 1px solid #eee;
}
.himiya-product-autocomplete li:last-child { border-bottom: none; }
.himiya-product-autocomplete li:hover,
.himiya-product-autocomplete li[aria-selected="true"] { background: #e8eceb; }

/* Tooltip icon: small "?" symbol, not a button */
.himiya-tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 1px solid #b5b5b5;
	border-radius: 50%;
	color: #6f6f6f;
	font-size: 10px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1;
	cursor: help;
	user-select: none;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	vertical-align: middle;
	transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.himiya-tip:hover,
.himiya-tip:focus,
.himiya-tip.is-open {
	background: var(--primary-color, #17475a);
	border-color: var(--primary-color, #17475a);
	color: #fff;
	outline: none;
}
.himiya-tip__mark { pointer-events: none; }

/* Tooltip popup: real DOM element so it is not affected by theme ::after resets. */
.himiya-tip__popup {
	position: absolute;
	bottom: calc(100% + 8px);
	right: -4px;
	z-index: 50;
	min-width: 200px;
	max-width: 280px;
	width: max-content;
	padding: 0.55rem 0.7rem;
	background: #1d1d1d;
	color: #fff;
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	font-size: 0.8rem;
	font-weight: 400;
	line-height: 1.4;
	white-space: pre-line;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.12s ease;
}
.himiya-tip__popup::after {
	content: '';
	position: absolute;
	top: 100%;
	right: 8px;
	border: 6px solid transparent;
	border-top-color: #1d1d1d;
}
.himiya-tip:hover .himiya-tip__popup,
.himiya-tip:focus .himiya-tip__popup,
.himiya-tip.is-open .himiya-tip__popup {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

@media (max-width: 480px) {
	.himiya-modalForm .himiya-inputGrid { grid-template-columns: 1fr; }
	.himiya-fieldRow > .himiya-formInput--unit { width: 4.5rem; }
	.himiya-tip__popup {
		right: auto;
		left: -4px;
		max-width: min(82vw, 320px);
	}
	.himiya-tip__popup::after {
		right: auto;
		left: 8px;
	}
}
