/* ==========================================================================
   AM Devices - Base styles
   ========================================================================== */

@font-face {
	font-family: "DM Sans";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/DM_Sans/DMSans-Regular.woff2") format("woff2");
}

@font-face {
	font-family: "DM Sans";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/DM_Sans/DMSans-Medium.woff2") format("woff2");
}

@font-face {
	font-family: "DM Sans";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/DM_Sans/DMSans-Bold.woff2") format("woff2");
}

@font-face {
	font-family: "Poppins";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/Poppins/Poppins-Medium.woff2") format("woff2");
}

@font-face {
	font-family: "Poppins";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/Poppins/Poppins-SemiBold.woff2") format("woff2");
}

@font-face {
	font-family: "Poppins";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/Poppins/Poppins-Bold.woff2") format("woff2");
}

:root {
	--am-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--am-font-heading: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--am-container: 1400px;
	--am-gutter: 20px;

	/* Brand palette: #104FA9, #272727, #282828, #ffffff (tints derived from these). */
	--am-primary: #104fa9;
	--am-primary-dark: #272727;
	--am-primary-soft: rgba(16, 79, 169, 0.08);
	--am-accent: #104fa9;
	--am-success: #104fa9;
	--am-danger: #d63b3b; /* form errors only */

	--am-heading: #282828;
	--am-text: #272727;
	--am-text-soft: rgba(39, 39, 39, 0.82);
	--am-muted: rgba(39, 39, 39, 0.6);
	--am-border: rgba(39, 39, 39, 0.12);
	--am-border-strong: rgba(39, 39, 39, 0.24);
	--am-bg: #ffffff;
	--am-bg-soft: rgba(39, 39, 39, 0.04);
	--am-dark: #272727;

	--am-radius: 10px;
	--am-radius-sm: 6px;
	--am-shadow: 0 6px 24px rgba(39, 39, 39, 0.08);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

html.am-scroll-lock {
	overflow: hidden;
}

body {
	margin: 0;
	background: var(--am-bg);
	color: var(--am-text);
	font-family: var(--am-font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--am-primary);
	text-decoration: none;
	transition: color 0.2s;
}

a:hover {
	color: var(--am-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	color: var(--am-heading);
	font-family: var(--am-font-heading);
	font-weight: 600;
	line-height: 1.25;
}

p {
	margin: 0 0 1em;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--am-accent);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.am-skip-link:focus {
	position: fixed !important;
	top: 10px;
	left: 10px;
	z-index: 10000;
	width: auto;
	height: auto;
	padding: 10px 16px;
	clip: auto;
	background: #fff;
	color: var(--am-primary);
	border-radius: var(--am-radius-sm);
	box-shadow: var(--am-shadow);
}

/* ---------- Layout ---------- */

.am-container {
	width: 100%;
	max-width: calc(var(--am-container) + var(--am-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--am-gutter);
}

.am-main {
	min-height: 50vh;
}

.am-section {
	padding-block: 48px;
}

.am-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 40px;
}

.am-layout--full {
	grid-template-columns: minmax(0, 1fr);
}

/* ---------- Page header ---------- */

.am-page-header {
	padding-block: 36px;
	background: var(--am-bg-soft);
	border-bottom: 1px solid var(--am-border);
}

.am-page-header__title {
	margin: 0;
	font-size: clamp(26px, 3vw, 36px);
}

.am-page-header__meta {
	margin: 6px 0 0;
	color: var(--am-muted);
	font-size: 14px;
}

/* ---------- Content ---------- */

.am-entry {
	overflow-wrap: break-word;
}

.am-entry > *:last-child {
	margin-bottom: 0;
}

.am-entry img {
	border-radius: var(--am-radius-sm);
}

.am-card-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

.am-card {
	overflow: hidden;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
	background: #fff;
	transition: box-shadow 0.2s, transform 0.2s;
}

.am-card:hover {
	box-shadow: var(--am-shadow);
	transform: translateY(-2px);
}

.am-card__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.am-card__body {
	padding: 20px;
}

.am-card__title {
	margin: 0 0 8px;
	font-size: 19px;
}

.am-card__title a {
	color: var(--am-text);
}

.am-card__title a:hover {
	color: var(--am-primary);
}

.am-card__excerpt {
	color: var(--am-text-soft);
	font-size: 15px;
}

.am-pagination {
	margin-top: 40px;
}

.am-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.am-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-sm);
	color: var(--am-text);
}

.am-pagination .page-numbers.current,
.am-pagination .page-numbers:hover {
	border-color: var(--am-primary);
	background: var(--am-primary);
	color: #fff;
}

/* ---------- Buttons & forms ---------- */

.am-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 26px;
	border: 1px solid var(--am-primary);
	border-radius: var(--am-radius-sm);
	background: var(--am-primary);
	color: #fff;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s;
}

.am-btn:hover {
	border-color: var(--am-primary-dark);
	background: var(--am-primary-dark);
	color: #fff;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--am-border-strong);
	border-radius: var(--am-radius-sm);
	background: #fff;
	font-size: 15px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
	min-height: 120px;
	resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--am-primary);
	box-shadow: 0 0 0 3px rgba(16, 79, 169, 0.12);
	outline: 0;
}

/* Search form */
.search-form {
	display: flex;
	gap: 8px;
}

.search-form label {
	flex: 1 1 auto;
}

.search-form .search-submit {
	min-height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--am-radius-sm);
	background: var(--am-primary);
	color: #fff;
	cursor: pointer;
}

/* ---------- Sidebar ---------- */

.am-sidebar .am-widget {
	margin-bottom: 28px;
	padding: 22px;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius);
}

.am-widget__title {
	font-size: 18px;
}

.am-sidebar ul {
	margin: 0;
	padding-left: 18px;
}

/* ---------- 404 / empty ---------- */

.am-empty {
	max-width: 620px;
	margin-inline: auto;
	padding-block: 80px;
	text-align: center;
}

.am-empty__title {
	margin: 10px 0 12px;
	font-size: 28px;
}

.am-empty__text {
	color: var(--am-text-soft);
}

.am-empty .search-form {
	margin: 24px 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.am-layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 575px) {
	:root {
		--am-gutter: 16px;
	}

	.am-section {
		padding-block: 32px;
	}

	.am-page-header {
		padding-block: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* Poppins for headings & UI labels, DM Sans for body copy */
.am-btn,
.search-form .search-submit {
	font-family: var(--am-font-heading);
}

/* ---------- Button variants ---------- */

.am-btn--dark {
	border-color: var(--am-dark);
	background: var(--am-dark);
}

.am-btn--dark:hover {
	border-color: var(--am-primary);
	background: var(--am-primary);
}

.am-btn--block {
	width: 100%;
}

/* ==========================================================================
   Product grid + card (category pages, related products, shortcodes)
   ========================================================================== */

ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

ul.products::before,
ul.products::after {
	display: none;
}

.am-pcard {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 2px solid var(--am-border);
	border-radius: var(--am-radius-sm);
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s;
}

.am-pcard:hover {
	border-color: rgba(16, 79, 169, 0.35);
	box-shadow: var(--am-shadow);
	transform: translateY(-3px);
}

.am-pcard__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 0.85;
	padding: 20px;
	background: #fff;
}

.am-pcard__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.35s ease;
}

.am-pcard:hover .am-pcard__img {
	transform: scale(1.04);
}

.am-pcard__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 0 16px 16px;
}

.am-pcard__title {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
}

.am-pcard__title a {
	display: -webkit-box;
	overflow: hidden;
	color: var(--am-heading);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.am-pcard__title a:hover {
	color: var(--am-primary);
}

.am-pcard__code {
	margin: 0 0 8px;
	overflow: hidden;
	color: var(--am-text-soft);
	font-size: 15px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.am-pcard__price {
	margin: 0 0 8px;
	color: var(--am-primary);
	font-family: var(--am-font-heading);
	font-size: 18px;
	font-weight: 600;
}

.am-pcard__price del {
	margin-right: 6px;
	color: var(--am-muted);
	font-size: 14px;
	font-weight: 400;
}

.am-pcard__price ins {
	text-decoration: none;
}

.am-pcard__actions {
	margin-top: auto;
	padding-top: 8px;
}

.am-pcard__actions .am-btn {
	min-height: 46px;
	font-size: 15px;
}

/* Load More: cards fade + slide in, staggered */
.am-pcard--enter {
	animation: am-card-in 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
	animation-delay: calc(var(--am-i, 0) * 60ms);
}

@keyframes am-card-in {
	from {
		opacity: 0;
		transform: translateY(28px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 1100px) {
	ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.am-pcard__media {
		padding: 14px;
	}

	.am-pcard__body {
		padding: 0 12px 12px;
	}

	.am-pcard__title,
	.am-pcard__code {
		font-size: 14px;
	}

	.am-pcard__actions .am-btn {
		min-height: 42px;
		padding: 0 8px;
		font-size: 14px;
		white-space: nowrap;
	}
}

@media (max-width: 359px) {
	ul.products {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-pcard,
	.am-pcard__img {
		transition: none;
	}

	.am-pcard--enter {
		animation: none;
	}
}

/* ==========================================================================
   404
   ========================================================================== */

.am-404 {
	padding-block: 90px 100px;
	background: linear-gradient(180deg, var(--am-primary-soft), rgba(16, 79, 169, 0) 70%);
}

.am-404__inner {
	max-width: 720px;
	margin-inline: auto;
	text-align: center;
}

.am-404__code {
	margin: 0;
	background: linear-gradient(135deg, var(--am-primary), var(--am-dark));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-family: var(--am-font-heading);
	font-size: clamp(96px, 18vw, 180px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.04em;
}

.am-404__title {
	margin: 14px 0 12px;
	font-size: clamp(24px, 3vw, 34px);
}

.am-404__text {
	max-width: 520px;
	margin: 0 auto 28px;
	color: var(--am-text-soft);
	font-size: 17px;
}

.am-404__search {
	display: flex;
	gap: 8px;
	max-width: 520px;
	margin: 0 auto 22px;
	padding: 6px;
	border: 1px solid var(--am-border-strong);
	border-radius: 999px;
	background: #fff;
	box-shadow: var(--am-shadow);
}

.am-404__search input[type="search"] {
	flex: 1 1 auto;
	min-height: 46px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
}

.am-404__search .am-btn {
	min-height: 46px;
	border-radius: 999px;
}

.am-404__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 36px;
}

.am-404__cats-title {
	margin: 0 0 12px;
	color: var(--am-muted);
	font-family: var(--am-font-heading);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.am-404__cats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.am-404__cats a {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--am-border-strong);
	border-radius: 999px;
	background: #fff;
	color: var(--am-text);
	font-size: 14px;
	transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.am-404__cats a:hover {
	border-color: var(--am-primary);
	background: var(--am-primary);
	color: #fff;
}

@media (max-width: 575px) {
	.am-404 {
		padding-block: 56px 64px;
	}

	.am-404__search {
		flex-direction: column;
		border-radius: var(--am-radius);
	}

	.am-404__search input[type="search"],
	.am-404__search .am-btn {
		border-radius: var(--am-radius-sm);
	}
}

/* ==========================================================================
   Contact Form 7 - plugin CSS is disabled (inc/am-devices-core.php),
   so everything the forms need lives here.
   ========================================================================== */

/* CF7 6.x wraps its hidden inputs in a <fieldset>: without this it shows as an empty box above the form */
fieldset.hidden-fields-container,
.wpcf7 .hidden-fields-container {
	display: none !important;
}

.wpcf7 .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.wpcf7-form-control-wrap {
	position: relative;
	display: block;
}

.wpcf7 [inert] {
	opacity: 0.6;
}

/* Turnstile widget: drop the plugin's inline negative margin */
.wpcf7 .cf7-cf-turnstile {
	margin: 0 !important;
	line-height: 0;
}

/* ---------- Fields (both forms) ---------- */

.contact_page_form .wpcf7-form-control:not(.wpcf7-submit),
.custom_form-wrapper .wpcf7-form-control:not(.wpcf7-submit) {
	width: 100%;
	min-height: 52px;
	padding: 13px 16px;
	border: 1px solid var(--am-border-strong);
	border-radius: 8px;
	background: #fff !important;
	color: var(--am-text);
	font-family: var(--am-font);
	font-size: 15px;
	line-height: 1.5;
	transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

/* CF7 renders rows="10": fixed start height, user can still resize */
.contact_page_form textarea.wpcf7-form-control:not(.wpcf7-submit),
.custom_form-wrapper textarea.wpcf7-form-control:not(.wpcf7-submit) {
	height: 150px;
	min-height: 110px;
	resize: vertical;
}

.contact_page_form .wpcf7-form-control:not(.wpcf7-submit):hover,
.custom_form-wrapper .wpcf7-form-control:not(.wpcf7-submit):hover {
	border-color: rgba(16, 79, 169, 0.45);
}

.contact_page_form .wpcf7-form-control:not(.wpcf7-submit):focus,
.custom_form-wrapper .wpcf7-form-control:not(.wpcf7-submit):focus {
	border-color: none;
	background: #fff;
	box-shadow: 0 0 0 4px rgba(16, 79, 169, 0.12);
	outline: 0;
}

.wpcf7-form-control::placeholder {
	color: #222222;
	opacity: 1;
}

.wpcf7 .wpcf7-form-control.wpcf7-not-valid:not(.wpcf7-submit) {
	border-color: var(--am-danger);
}

.wpcf7 .wpcf7-form-control.wpcf7-not-valid:not(.wpcf7-submit):focus {
	box-shadow: 0 0 0 4px rgba(214, 59, 59, 0.12);
}

.wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	color: var(--am-danger);
	font-size: 13px;
	line-height: 1.4;
}

/* ---------- Submit (all CF7 forms) ---------- */

.wpcf7 .wpcf7-submit {
	min-width: 180px;
	min-height: 52px;
	padding: 0 32px;
	border: 1px solid var(--am-primary);
	border-radius: 8px;
	background: var(--am-primary);
	color: #fff;
	font-family: var(--am-font-heading);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.wpcf7 .wpcf7-submit:hover,
.wpcf7 .wpcf7-submit:focus-visible {
	border-color: var(--am-dark);
	background: var(--am-dark);
	box-shadow: 0 8px 20px rgba(39, 39, 39, 0.18);
	transform: translateY(-1px);
}

.wpcf7 .wpcf7-submit:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

.wpcf7 .wpcf7-spinner {
	display: none;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 2px solid var(--am-border-strong);
	border-top-color: var(--am-primary);
	border-radius: 50%;
	animation: am-cf7-spin 0.8s linear infinite;
}

.wpcf7 form.submitting .wpcf7-spinner {
	display: inline-block;
}

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

/* ---------- Response message ---------- */

.wpcf7 form .wpcf7-response-output {
	margin: 20px 0 0;
	padding: 12px 16px;
	border: 1px solid var(--am-border-strong);
	border-left-width: 4px;
	border-radius: var(--am-radius-sm);
	font-size: 15px;
}

.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output {
	display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--am-primary);
	background: var(--am-primary-soft);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
	border-color: var(--am-danger);
	background: rgba(214, 59, 59, 0.06);
}

/* ---------- Contact page form (labels) - .contact_page_form ---------- */

.contact_page_form {
	display: grid;
	gap: 20px;
	width: 100%;
}

.contact_page_form-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.contact_page_form-row--full {
	grid-template-columns: minmax(0, 1fr);
}

.contact_page_form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.contact_page_form-group label {
	color: var(--am-heading);
	font-family: var(--am-font-heading);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
}

.contact_page_form-group label span {
	margin-left: 2px;
	color: var(--am-primary);
}

.contact_page_form-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* ---------- Compact form (placeholders) - .custom_form-wrapper ---------- */

.custom_form-wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	width: 100%;
}

.custom_form-group {
	min-width: 0;
}

.custom_form-full {
	grid-column: 1 / -1;
}

.custom_form-wrapper .wpcf7-form-control:not(.wpcf7-submit) {
	border-color: transparent;
	background: #f3f5f9;
}

.custom_form-submit {
	display: flex;
	align-items: center;
	gap: 12px;
}

.custom_form-submit .wpcf7-submit {
	flex: 1 1 auto;
}

@media (max-width: 767px) {
	.contact_page_form-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.contact_page_form .wpcf7-submit {
		width: 100%;
	}
}

@media (max-width: 575px) {
	.custom_form-wrapper {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpcf7 .wpcf7-submit {
		transition: none;
		transform: none;
	}
}
