/**
 * Craftory Box — Modals & lightboxes responsive (< 1000px)
 */

/* ==========================================================================
   ≤1000px
   ========================================================================== */
@media (max-width: 1000px) {
	/* ------------------------------------------------------------------
	   Project modal — «Обговорити проєкт»
	   ------------------------------------------------------------------ */
	.project-modal {
		align-items: center;
		justify-content: center;
		padding: 12px;
	}

	.project-modal__dialog {
		width: 100%;
		max-width: 560px;
		max-height: min(calc(100dvh - 24px), 720px);
		padding: clamp(28px, 6vw, 40px) clamp(20px, 4.5vw, 28px);
		border-radius: 8px;
		text-align: left;
	}

	.project-modal__title {
		font-size: clamp(22px, 5.2vw, 30px);
		text-align: center;
		padding-inline: 28px;
	}

	.project-modal__lead {
		max-width: none;
		font-size: clamp(14px, 3.4vw, 16px);
		text-align: center;
	}

	.project-modal__form {
		width: 100%;
	}

	.project-modal__submit {
		width: 100%;
		min-height: 52px;
	}

	.project-modal__success {
		text-align: center;
		font-size: clamp(15px, 3.6vw, 17px);
	}

	/* ------------------------------------------------------------------
	   Product checkout modal
	   ------------------------------------------------------------------ */
	.product-checkout-modal {
		align-items: center;
		justify-content: center;
		padding: 12px;
	}

	.product-checkout-modal__dialog {
		width: 100%;
		max-width: 640px;
		max-height: min(calc(100dvh - 24px), 720px);
		padding: clamp(24px, 5vw, 32px) clamp(18px, 4vw, 24px);
		border-radius: 8px;
	}

	.product-checkout-modal__title {
		font-size: clamp(22px, 5.2vw, 30px);
		padding-right: 32px;
	}

	.product-checkout-modal__lead {
		font-size: clamp(14px, 3.4vw, 16px);
	}

	.product-checkout-modal__summary {
		padding: 14px;
	}

	.product-checkout-modal__summary-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.product-checkout-modal__summary-row dd {
		text-align: left;
	}

	.product-checkout-modal__option {
		padding: 10px 12px;
	}

	.product-checkout-modal__submit {
		width: 100%;
		min-height: 52px;
	}

	.product-checkout-modal__success,
	.product-checkout-modal__error {
		text-align: center;
	}

	/* ------------------------------------------------------------------
	   Portfolio lightbox
	   ------------------------------------------------------------------ */
	.portfolio-lightbox {
		padding: clamp(12px, 3vw, 20px);
	}

	.portfolio-lightbox__dialog {
		width: 100%;
		max-height: calc(100dvh - 32px);
	}

	.portfolio-lightbox__close {
		top: 0;
		right: 0;
		width: 40px;
		height: 40px;
		background: rgba(0, 0, 0, 0.55);
		border-radius: 50%;
	}

	.portfolio-lightbox__image {
		max-height: calc(100dvh - 120px);
	}

	.portfolio-lightbox__caption {
		font-size: clamp(14px, 3.4vw, 17px);
		margin-top: 12px;
	}
}

/* ==========================================================================
   ≤480px
   ========================================================================== */
@media (max-width: 480px) {
	.project-modal,
	.product-checkout-modal {
		padding: 12px;
	}

	.project-modal__dialog,
	.product-checkout-modal__dialog {
		max-height: calc(100dvh - 24px);
		border-radius: 8px;
		padding: 28px 16px 24px;
	}

	.project-modal__title,
	.product-checkout-modal__title {
		font-size: clamp(20px, 5.8vw, 26px);
	}

	.project-modal__control,
	.product-checkout-modal__control {
		font-size: 16px;
		padding: 12px 14px;
	}

	.project-modal__control--textarea {
		min-height: 100px;
	}

	.portfolio-lightbox {
		padding: 12px;
	}

	.portfolio-lightbox__close {
		top: 4px;
		right: 4px;
	}

	.portfolio-lightbox__image {
		max-height: calc(100dvh - 100px);
	}
}
