/* Valenciani Made-to-order — front-end styles (namespace: vmto-)
   Palette matches the site theme: accent #e91e63, body text #333333. */

:root {
	--vmto-primary: #e91e63;
	--vmto-primary-dark: #d81b60;
	--vmto-primary-soft: rgba(233, 30, 99, 0.28);
	--vmto-text: #333333;
	--vmto-bg: #ffffff;
	--vmto-dark: #000000;
	--vmto-border: #e3e3e3;
	--vmto-error: #b3261e;
}

/* --- Trigger button ------------------------------------------------------
   Mirrors the ttksw label-swatch look (border, radius, padding, type size);
   neutral #333 text at rest, pink when selected/hovered. */
.vmto-trigger {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 5px;
	box-sizing: border-box;
	color: var(--vmto-dark);
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	justify-content: center;
	letter-spacing: 0.03em;
	line-height: 1;
	margin: 0;
	min-width: 40px;
	padding: 10px 12px;
	white-space: nowrap;
}

.vmto-trigger:hover,
.vmto-trigger:focus-visible {
	border-color: var(--vmto-dark);
	outline: 2px solid var(--vmto-dark);
	outline-offset: 2px;
}

.vmto-trigger--selected {
	background: var(--vmto-primary);
	border-color: var(--vmto-primary);
	color: #fff;
}

/* Wrapper used when the button is moved into the ttksw swatch list so it
   shares the exact row of size labels. */
.vmto-swatch-item {
	align-items: center;
	display: flex;
	list-style: none;
}

/* --- Modal ---------------------------------------------------------------- */

.vmto-modal {
	bottom: 0;
	left: 0;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 999999;
}

.vmto-modal[aria-hidden="true"],
.vmto-modal:not(.vmto-open) {
	display: none;
}

.vmto-modal__overlay {
	background: rgba(0, 0, 0, 0.55);
	bottom: 0;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

.vmto-modal__panel {
	background: var(--vmto-bg);
	border-radius: 10px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
	box-sizing: border-box;
	left: 50%;
	max-height: calc(100vh - 40px);
	max-width: 460px;
	overflow-y: auto;
	padding: 28px 28px 24px;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
}

.vmto-modal__title {
	color: var(--vmto-text);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0.04em;
	margin: 0 0 4px;
}

.vmto-modal__close {
	background: none;
	border: 0;
	color: #757575;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	padding: 4px 8px;
	position: absolute;
	right: 12px;
	top: 10px;
}

.vmto-modal__close:hover {
	color: var(--vmto-primary);
}

.vmto-note-hint {
	color: #000000;
	font-size: 13px;
	line-height: 1.4;
	margin: 0 0 16px;
}

.vmto-form__row {
	margin: 0 0 14px;
}

.vmto-form__row label {
	color: var(--vmto-text);
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	margin: 0 0 6px;
}

.vmto-required {
	color: var(--vmto-primary);
}

.vmto-form__row input[type="text"],
.vmto-form__row textarea {
    background: #fff;
    border: 1px solid var(--vmto-border) !important;
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--vmto-text) !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    padding: 10px 12px !important;
    width: 100%;
}

.vmto-form__row input[type="text"]:focus,
.vmto-form__row textarea:focus {
	border-color: var(--vmto-primary-soft) !important;
	outline: 2px solid var(--vmto-primary-soft) !important;
	outline-offset: 0;
}

.vmto-form__row textarea {
	resize: vertical;
}

.vmto-invalid {
	border-color: var(--vmto-error) !important;
}

.vmto-form__error {
	background: #fbeaea;
	border: 1px solid #e5b5b5;
	border-radius: 6px;
	color: #8f1d1d;
	font-size: 13px;
	line-height: 1.4;
	margin: 0 0 14px;
	padding: 10px 12px;
}

.vmto-hidden {
	display: none !important;
}

/* Wide ADD TO BAG button */
.vmto-form__submit {
	background: var(--vmto-primary);
	border: 1px solid var(--vmto-primary);
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	display: block;
	font-size: 14px;
	letter-spacing: 0.14em;
	padding: 14px 12px;
	text-transform: uppercase;
	width: 100%;
}

.vmto-form__submit:hover,
.vmto-form__submit:focus {
	background: var(--vmto-primary-dark);
	outline: none;
}

/* Page scroll lock while the modal is open. */
body.vmto-modal-lock {
	overflow: hidden;
}

/* --- Locked state (made-to-order item already in the cart) -----------------
   Attribute swatches are dimmed and inert; only the quantity, the
   Made-to-order trigger (to re-open / edit measurements) and the add-to-cart
   button stay interactive. Prefer dimming over hiding: no layout jump and
   the customer can still see what is unavailable. */
.vmto-locked .ttksw-swatch,
.vmto-locked .variations select {
	opacity: 0.35;
	pointer-events: none;
}

.vmto-locked a.reset_variations {
	display: none !important;
}

.vmto-locked-note {
	color: var(--vmto-text);
	font-size: 13px;
	letter-spacing: 0.02em;
	line-height: 1.4;
	margin: -4px 0 14px;
}

.vmto-locked-note::before {
	color: var(--vmto-primary);
	content: "\2713\0020";
	font-weight: 700;
}

/* --- Small screens -------------------------------------------------------- */

@media (max-height: 899.98px) and (min-width: 601px) {
	.vmto-form {
		column-gap: 14px;
		display: grid;
		grid-template-columns: 1fr 1fr;
	}
	.vmto-form__row:has(input[name="vmto_weight"]),
	.vmto-form__row:has(textarea),
	.vmto-form__error,
	.vmto-form__submit {
		grid-column: 1 / -1;
	}
}
@media (min-height: 650px) and (max-height: 800px){
    .vmto-modal__panel {
        top: 56%;
    }
    textarea#vmto_field_note {
        height: 50px;
    }
}
@media (max-height: 650px){
    .vmto-modal__panel {
        max-height: calc(100vh - 200px);
        top: 55%;
        border-radius: 0;
    }
}

@media (max-width: 767px) {
    .vmto-modal__panel {
        padding: 20px 18px 18px;
        width: 80%;
        max-height: calc(100vh - 200px);
    }
    .vmto-form__submit {
        font-size: 13px;
        letter-spacing: 0;
    }
}
