/**
 * Mafron Core — front-end styles for products, cart and quote form.
 * Every colour falls back to a literal so the plugin still looks right
 * if it is activated on a theme other than Mafron International.
 */

.maf-icon {
	width: 1em;
	height: 1em;
	flex: none;
}

/* ------------------------------------------------------------------ buttons */

.maf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 13px 24px;
	border: 1px solid transparent;
	border-radius: 4px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, transform .12s, box-shadow .2s;
}

.maf-btn:hover { transform: translateY(-1px); }
.maf-btn:active { transform: translateY(0); }
.maf-btn:focus-visible {
	outline: 2px solid var(--maf-gold, #c08d2d);
	outline-offset: 3px;
}

.maf-btn--gold {
	background: var(--maf-gold, #c08d2d);
	color: #fff;
	box-shadow: 0 6px 18px rgba(192, 141, 45, .22);
}
.maf-btn--gold:hover {
	background: var(--maf-gold-600, #a8761f);
	color: #fff;
	box-shadow: 0 10px 24px rgba(192, 141, 45, .28);
}

.maf-btn--outline {
	background: transparent;
	border-color: var(--maf-line, #e2dacd);
	color: var(--maf-ink, #171717);
}
.maf-btn--outline:hover {
	border-color: var(--maf-gold, #c08d2d);
	color: var(--maf-gold-600, #a8761f);
}

.maf-btn--dark {
	background: var(--maf-dark, #1c1c1c);
	color: #fff;
}
.maf-btn--dark:hover { background: #000; color: #fff; }

.maf-btn--lg { padding: 16px 30px; font-size: 14px; }

.maf-btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.maf-btn.is-added {
	background: #1f7a4d;
	box-shadow: none;
}
.maf-btn.is-added:hover { background: #1a6741; }

.maf-textlink {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--maf-gold-600, #a8761f);
	text-decoration: none;
	transition: gap .2s, color .2s;
}
.maf-textlink:hover { gap: 13px; color: var(--maf-gold, #c08d2d); }
.maf-textlink.is-disabled { color: #9c9c9c; pointer-events: none; }

.maf-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 13px;
	color: #8a8a8a;
	cursor: pointer;
}
.maf-link-btn:hover { color: #b32d2e; }

/* -------------------------------------------------------------- add to quote */

.maf-add-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.maf-add-wrap .maf-btn { flex: 1 1 auto; }

.maf-btn.is-loading .maf-icon { animation: maf-pulse .8s infinite; }

@keyframes maf-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .25; }
}

/* --------------------------------------------------------------- quantity */

.maf-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--maf-line, #e2dacd);
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.maf-qty__btn {
	width: 36px;
	height: 42px;
	border: 0;
	background: transparent;
	font-size: 17px;
	line-height: 1;
	color: var(--maf-ink, #171717);
	cursor: pointer;
	transition: background-color .15s;
}
.maf-qty__btn:hover { background: var(--maf-bg-soft, #faf7f2); }

.maf-qty__input {
	width: 56px;
	height: 42px;
	border: 0;
	border-left: 1px solid var(--maf-line, #e2dacd);
	border-right: 1px solid var(--maf-line, #e2dacd);
	text-align: center;
	font: inherit;
	font-weight: 600;
	background: transparent;
	-moz-appearance: textfield;
}
.maf-qty__input::-webkit-outer-spin-button,
.maf-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.maf-qty__input:focus { outline: none; }

/* ------------------------------------------------------------ product grid */

.maf-product-grid {
	display: grid;
	gap: 26px;
	grid-template-columns: repeat(var(--maf-cols, 4), minmax(0, 1fr));
}

.maf-cols-1 { --maf-cols: 1; }
.maf-cols-2 { --maf-cols: 2; }
.maf-cols-3 { --maf-cols: 3; }
.maf-cols-4 { --maf-cols: 4; }

.maf-product-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow .25s, transform .25s, border-color .25s;
}
.maf-product-card:hover {
	transform: translateY(-4px);
	border-color: rgba(192, 141, 45, .4);
	box-shadow: 0 18px 40px rgba(28, 28, 28, .1);
}

.maf-product-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--maf-bg-soft, #f6f2eb);
}
.maf-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s ease;
}
.maf-product-card:hover .maf-product-card__media img { transform: scale(1.05); }

.maf-product-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
	flex: 1;
}

.maf-product-card__cat {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--maf-gold-600, #a8761f);
}

.maf-product-card__title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
	font-weight: 700;
}
.maf-product-card__title a {
	color: var(--maf-ink, #171717);
	text-decoration: none;
}
.maf-product-card__title a:hover { color: var(--maf-gold-600, #a8761f); }

.maf-product-card__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.65;
	color: var(--maf-muted, #6e6e6e);
}

.maf-product-card__meta {
	list-style: none;
	margin: 0;
	padding: 12px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	border-top: 1px dashed var(--maf-line, #ece5d9);
	font-size: 12px;
	color: var(--maf-muted, #6e6e6e);
}
.maf-product-card__meta li { display: flex; flex-direction: column; gap: 2px; }
.maf-product-card__meta strong { color: var(--maf-ink, #171717); font-size: 13px; }

.maf-product-card .maf-add-wrap { margin-top: auto; padding-top: 14px; }

/* ------------------------------------------------------------ category cards */

.maf-cat-cards {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(var(--maf-cols, 4), minmax(0, 1fr));
}

.maf-cat-card {
	position: relative;
	background: #fff;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow .25s, transform .25s;
}
.maf-cat-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 20px 44px rgba(28, 28, 28, .12);
}

.maf-cat-card__media {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--maf-bg-soft, #f6f2eb);
}
.maf-cat-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .55s ease;
}
.maf-cat-card:hover .maf-cat-card__media img { transform: scale(1.06); }

.maf-cat-card__icon {
	position: absolute;
	top: calc(66.66% - 30px);
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 60px;
	display: grid;
	place-items: center;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 6px 20px rgba(28, 28, 28, .14);
	color: var(--maf-ink, #171717);
	z-index: 2;
}
.maf-cat-card__icon .maf-icon { width: 26px; height: 26px; }

.maf-cat-card__body {
	padding: 42px 22px 26px;
	text-align: center;
}

.maf-cat-card__title {
	margin: 0 0 10px;
	font-size: 19px;
	font-weight: 700;
}
.maf-cat-card__title a { color: var(--maf-ink, #171717); text-decoration: none; }
.maf-cat-card__title a:hover { color: var(--maf-gold-600, #a8761f); }

.maf-cat-card__text {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.65;
	color: var(--maf-muted, #6e6e6e);
}

.maf-cat-card__body .maf-textlink { justify-content: center; }

/* --------------------------------------------------------------- catalogs */

.maf-catalogs {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.maf-catalog-card {
	display: flex;
	background: #fff;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 6px;
	overflow: hidden;
	transition: box-shadow .25s, transform .25s;
}
.maf-catalog-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 16px 34px rgba(28, 28, 28, .11);
}

.maf-catalog-card__media {
	flex: 0 0 38%;
	background: var(--maf-bg-soft, #f6f2eb);
}
.maf-catalog-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.maf-catalog-card__body {
	flex: 1;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.maf-catalog-card__title {
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
	font-weight: 700;
	color: var(--maf-ink, #171717);
}
.maf-catalog-card__title span { display: block; font-weight: 700; }

.maf-catalog-card__text {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--maf-muted, #6e6e6e);
}

.maf-catalog-card .maf-textlink { margin-top: auto; }

/* ------------------------------------------------------------------- cart */

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

.maf-cart__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

.maf-cart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--maf-ink, #171717);
}
.maf-cart__head h2 {
	margin: 0;
	font-size: 22px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.maf-cart__badge {
	display: inline-grid;
	place-items: center;
	min-width: 28px;
	height: 28px;
	padding: 0 8px;
	border-radius: 14px;
	background: var(--maf-gold, #c08d2d);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.maf-cart__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.maf-cart__item {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) auto;
	gap: 18px;
	align-items: start;
	padding: 22px 0;
	border-bottom: 1px solid var(--maf-line, #ece5d9);
	transition: opacity .2s, transform .2s;
}
.maf-cart__item.is-removing { opacity: 0; transform: translateX(-12px); }

.maf-cart__thumb {
	display: block;
	width: 88px;
	height: 88px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--maf-bg-soft, #f6f2eb);
}
.maf-cart__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.maf-cart__info { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.maf-cart__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--maf-ink, #171717);
	text-decoration: none;
	line-height: 1.35;
}
.maf-cart__title:hover { color: var(--maf-gold-600, #a8761f); }

.maf-cart__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 12px;
	color: var(--maf-muted, #6e6e6e);
}

.maf-cart__note input {
	width: 100%;
	max-width: 360px;
	padding: 8px 11px;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 4px;
	font: inherit;
	font-size: 13px;
	background: var(--maf-bg-soft, #faf8f4);
}
.maf-cart__note input:focus {
	outline: none;
	border-color: var(--maf-gold, #c08d2d);
	background: #fff;
}

.maf-cart__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.maf-cart__remove {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 4px;
	background: #fff;
	color: #9a9a9a;
	cursor: pointer;
	transition: color .18s, border-color .18s, background-color .18s;
}
.maf-cart__remove:hover { color: #b32d2e; border-color: #e6b7b7; background: #fdf5f5; }
.maf-cart__remove .maf-icon { width: 17px; height: 17px; }

.maf-cart__continue {
	display: inline-block;
	margin-top: 22px;
	font-size: 14px;
	color: var(--maf-muted, #6e6e6e);
	text-decoration: none;
}
.maf-cart__continue:hover { color: var(--maf-gold-600, #a8761f); }

.maf-cart__empty {
	text-align: center;
	padding: 60px 20px 70px;
	max-width: 520px;
	margin: 0 auto;
}
.maf-cart__empty-icon {
	width: 82px;
	height: 82px;
	margin: 0 auto 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--maf-bg-soft, #f6f2eb);
	color: var(--maf-gold, #c08d2d);
}
.maf-cart__empty-icon .maf-icon { width: 34px; height: 34px; }
.maf-cart__empty h2 { margin: 0 0 12px; font-size: 26px; }
.maf-cart__empty p { margin: 0 0 26px; color: var(--maf-muted, #6e6e6e); line-height: 1.7; }

/* -------------------------------------------------------------- quote form */

.maf-quote-form {
	background: #fff;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 10px;
	padding: 30px;
	box-shadow: 0 18px 44px rgba(28, 28, 28, .07);
	position: sticky;
	top: 110px;
}

.maf-quote-form__title { margin: 0 0 8px; font-size: 22px; }
.maf-quote-form__intro { margin: 0 0 22px; font-size: 14px; line-height: 1.65; color: var(--maf-muted, #6e6e6e); }

.maf-field-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.maf-field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.maf-field--full { grid-column: 1 / -1; }

.maf-field label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--maf-ink-2, #3d3d3d);
}

.maf-req { color: #c0392b; }

.maf-field input,
.maf-field textarea,
.maf-field select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--maf-line, #e2dacd);
	border-radius: 4px;
	font: inherit;
	font-size: 15px;
	background: var(--maf-bg-soft, #fbf9f5);
	color: var(--maf-ink, #171717);
	transition: border-color .18s, background-color .18s, box-shadow .18s;
}
.maf-field textarea { resize: vertical; min-height: 96px; }

.maf-field input:focus,
.maf-field textarea:focus {
	outline: none;
	border-color: var(--maf-gold, #c08d2d);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(192, 141, 45, .14);
}

.maf-field.has-error input,
.maf-field.has-error textarea { border-color: #c0392b; background: #fdf6f5; }

.maf-field__error { font-size: 12px; color: #c0392b; text-transform: none; letter-spacing: 0; }
.maf-field__error:empty { display: none; }

.maf-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.maf-quote-form__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--maf-line, #ece5d9);
}
.maf-quote-form__summary { margin: 0; font-size: 14px; color: var(--maf-muted, #6e6e6e); }
.maf-quote-form__summary strong { color: var(--maf-ink, #171717); font-size: 17px; }

.maf-quote-form__note {
	margin: 16px 0 0;
	font-size: 12px;
	line-height: 1.6;
	color: #9a9a9a;
}

.maf-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: maf-spin .7s linear infinite;
}
.maf-btn.is-loading .maf-spinner { display: inline-block; }
.maf-btn.is-loading .maf-btn__label { opacity: .7; }

@keyframes maf-spin { to { transform: rotate(360deg); } }

.maf-alert {
	padding: 13px 16px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.55;
	margin-bottom: 18px;
}
.maf-alert--error { background: #fdf1f0; border-left: 3px solid #c0392b; color: #8e2b21; }

.maf-quote-success {
	text-align: center;
	background: #fff;
	border: 1px solid var(--maf-line, #ece5d9);
	border-radius: 10px;
	padding: 44px 30px;
	box-shadow: 0 18px 44px rgba(28, 28, 28, .07);
}
.maf-quote-success__icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 20px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: #eaf6ef;
	color: #1f7a4d;
}
.maf-quote-success__icon .maf-icon { width: 34px; height: 34px; }
.maf-quote-success h2 { margin: 0 0 12px; font-size: 26px; }
.maf-quote-success p { margin: 0 0 12px; color: var(--maf-muted, #6e6e6e); line-height: 1.7; }
.maf-quote-success__ref { font-size: 15px; }
.maf-quote-success__ref strong { color: var(--maf-gold-600, #a8761f); letter-spacing: .04em; }

/* ------------------------------------------------------------------ toasts */

.maf-toasts {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.maf-toast {
	min-width: 220px;
	max-width: 340px;
	padding: 13px 18px;
	border-radius: 6px;
	background: var(--maf-dark, #1c1c1c);
	color: #fff;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .28s, transform .28s;
}
.maf-toast.is-in { opacity: 1; transform: translateY(0); }
.maf-toast--success { border-left: 3px solid var(--maf-gold, #c08d2d); }
.maf-toast--error { border-left: 3px solid #e05a4d; }

.maf-empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--maf-muted, #6e6e6e);
	background: var(--maf-bg-soft, #faf8f4);
	border-radius: 8px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
	.maf-cart__grid { grid-template-columns: 1fr; }
	.maf-quote-form { position: static; }
	.maf-cols-4 { --maf-cols: 3; }
	.maf-catalogs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
	.maf-cols-3, .maf-cols-4 { --maf-cols: 2; }
	.maf-cart__item { grid-template-columns: 72px minmax(0, 1fr); }
	.maf-cart__thumb { width: 72px; height: 72px; }
	.maf-cart__actions { grid-column: 1 / -1; justify-content: space-between; }
	.maf-quote-form { padding: 24px 20px; }
}

@media (max-width: 560px) {
	.maf-cols-2, .maf-cols-3, .maf-cols-4 { --maf-cols: 1; }
	.maf-field-grid { grid-template-columns: 1fr; }
	.maf-catalogs { grid-template-columns: 1fr; }
	.maf-toasts { left: 16px; right: 16px; bottom: 16px; }
	.maf-toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	.maf-btn, .maf-product-card, .maf-cat-card, .maf-catalog-card,
	.maf-toast, .maf-cart__item, .maf-product-card__media img, .maf-cat-card__media img {
		transition: none !important;
		animation: none !important;
	}
}
