/* CM Jewelry Core: forms, catalog embeds, testimonials. Uses theme presets when present. */

:root {
	--cmjc-navy: var(--wp--preset--color--navy, #10143c);
	--cmjc-indigo: var(--wp--preset--color--indigo, #151d6e);
	--cmjc-ink: var(--wp--preset--color--ink, #222);
	--cmjc-line: rgba(16, 20, 60, 0.18);
	--cmjc-bg: #fff;
}

/* ---------- Forms ---------- */

.cmjc-form__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.25rem;
}

.cmjc-field {
	flex: 1 1 calc(var(--cmjc-w, 100%) - 1.25rem);
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.cmjc-field--submit {
	flex-basis: 100%;
}

/* Labels stay in the DOM for screen readers; visually the forms use
   placeholders, as the original Elementor forms did. */
.cmjc-field__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.cmjc-form input::placeholder,
.cmjc-form textarea::placeholder {
	color: #6b6f80;
	opacity: 1;
}

.cmjc-req {
	color: #b3261e;
}

.cmjc-form input:not([type="file"]),
.cmjc-form select,
.cmjc-form textarea,
.cmjc-form .cmjc-submit {
	box-sizing: border-box;
}

/* Field metrics copied from Elementor Pro's form widget defaults + the site's
   overrides: 40px min-height, 15px text, 0 1rem padding, 1px navy@30% border,
   10px column gap, 20px row gap. */
.cmjc-form input:not([type="file"]),
.cmjc-form select,
.cmjc-form textarea {
	width: 100%;
	min-height: 40px;
	padding: 0 1rem;
	border: 1px solid rgba(16, 20, 60, 0.3);
	border-radius: 0;
	background: var(--cmjc-bg);
	color: var(--cmjc-ink);
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
}

.cmjc-form input:focus,
.cmjc-form select:focus,
.cmjc-form textarea:focus {
	outline: 2px solid var(--cmjc-indigo);
	outline-offset: -2px;
}

.cmjc-form textarea {
	min-height: 120px;
	padding: 0.5rem 1rem;
	resize: vertical;
}

/* Submit: Elementor "sm" button — 15px, 12px 24px, navy with navy border,
   inverts to white/navy on hover. Left-aligned at natural width. */
.cmjc-field--submit {
	flex-basis: 100%;
	align-items: flex-start;
}

.cmjc-form .cmjc-submit {
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	border: 1px solid var(--cmjc-navy);
	border-radius: 0;
	background: var(--cmjc-navy);
	color: #fff;
	transition: all 0.2s;
}

.cmjc-form .cmjc-submit:hover {
	background: #fff;
	color: var(--cmjc-navy);
}

.cmjc-form input[type="file"] {
	font-size: 0.9rem;
}

.cmjc-field__hint {
	font-size: 0.75rem;
	opacity: 0.65;
}

.cmjc-form__grid {
	gap: 20px 10px;
}

.cmjc-field {
	flex: 1 1 calc(var(--cmjc-w, 100%) - 10px);
}

.cmjc-submit {
	cursor: pointer;
}

.cmjc-submit[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.cmjc-hp {
	position: absolute !important;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cmjc-recaptcha-note {
	margin-top: 0.75rem;
	font-size: 0.75rem;
	opacity: 0.65;
}

.cmjc-notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--cmjc-navy);
	background: rgba(16, 20, 60, 0.05);
	font-size: 0.95rem;
}

.cmjc-notice--error {
	border-left-color: #b3261e;
	background: rgba(179, 38, 30, 0.06);
}

/* Compact (newsletter) variant: input, then a full-width button below it,
   like the old footer form. */

.cmjc-form--compact .cmjc-form__grid {
	flex-direction: column;
	gap: 0.5rem;
}

.cmjc-form--compact .cmjc-field,
.cmjc-form--compact .cmjc-field--submit {
	flex: 0 0 auto;
	flex-basis: auto;
	gap: 0;
}

.cmjc-form--compact input[type="email"] {
	padding: 0.6rem 0.9rem;
	font-size: 0.85rem;
}

.cmjc-form--compact .cmjc-submit {
	width: 100%;
	padding: 0.6rem 1.25rem;
	font-size: 0.85rem;
}

.cmjc-form--compact .cmjc-recaptcha-note {
	display: none;
}

/* ---------- Catalog embed ---------- */

.cmjc-embed {
	width: 100%;
	min-height: var(--cmjc-min-h, 1200px);
}

.cmjc-embed__frame {
	display: block;
	width: 100%;
	min-height: var(--cmjc-min-h, 1200px);
	border: 0;
}

/* ---------- Testimonials ---------- */

.cmjc-testimonials {
	position: relative;
}

.cmjc-testimonials__track {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding: 0.25rem 0 1rem;
}

.cmjc-testimonials__track::-webkit-scrollbar {
	display: none;
}

.cmjc-testimonial {
	flex: 0 0 min(100%, 360px);
	scroll-snap-align: start;
	margin: 0;
	padding: 1.75rem;
	background: var(--wp--preset--color--cloud, #f9f9f9);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.cmjc-testimonial__stars {
	color: #c9a227;
	letter-spacing: 0.1em;
	font-size: 0.95rem;
}

.cmjc-testimonial__quote {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 1rem;
	line-height: 1.6;
	flex: 1 1 auto;
}

.cmjc-testimonial__quote p:last-child {
	margin-bottom: 0;
}

.cmjc-testimonial__who {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.cmjc-testimonial__photo {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

.cmjc-testimonial__name {
	font-weight: 600;
	color: var(--cmjc-navy);
}

.cmjc-testimonial__role {
	font-size: 0.85rem;
	opacity: 0.7;
}

.cmjc-testimonials__nav {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.cmjc-testimonials button.cmjc-testimonials__btn {
	width: 40px;
	height: 40px;
	min-height: 0;
	border: 1px solid var(--cmjc-line);
	background: #fff;
	color: var(--cmjc-navy);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	padding: 0;
	box-shadow: none;
}

.cmjc-testimonials button.cmjc-testimonials__btn:hover {
	background: var(--cmjc-navy);
	color: #fff;
}
