/**
 * TERMIMAL main front-end styles
 * Design tokens primarily live in theme.json; this file adds component-level polish.
 */

/* Product grid refinements */
.termimal-product-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.termimal-product-card .wp-block-post-featured-image {
	margin-bottom: 1rem;
}

.termimal-product-card .wp-block-post-title {
	margin-bottom: 0.5rem;
}

.termimal-product-card .wp-block-post-excerpt {
	color: var(--wp--preset--color--gray-400, #A3A3A3);
	font-size: 0.9375rem;
	flex-grow: 1;
}

/* Single product gallery (when rendered via shortcode / template) */
.termimal-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
	margin: 2rem 0;
}

.termimal-gallery img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

/* Related products list */
.termimal-related-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.5rem;
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 0;
}

/* Subtle terminal cursor blink (decorative, respects reduced motion) */
@keyframes termimal-blink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0; }
}

.termimal-cursor::after {
	content: "▌";
	margin-left: 2px;
	animation: termimal-blink 1s step-end infinite;
	color: var(--wp--preset--color--primary, #00F0FF);
}

@media (prefers-reduced-motion: reduce) {
	.termimal-cursor::after {
		animation: none;
	}
}

/* Button polish */
.wp-block-button__link {
	font-weight: 600;
	letter-spacing: -0.01em;
}

/* Meta chips (status, year, tech, category) */
.termimal-chip {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	font-size: 0.8125rem;
	font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	border-radius: 999px;
	background: var(--wp--preset--color--gray-800, #1A1A1A);
	border: 1px solid var(--wp--preset--color--gray-700, #2A2A2A);
	color: var(--wp--preset--color--gray-400, #A3A3A3);
	text-decoration: none;
}

.termimal-chip.termimal-status-live {
	color: var(--wp--preset--color--accent, #00FF9D);
	border-color: rgba(0, 255, 157, 0.35);
}

.termimal-chip.termimal-status-beta {
	color: var(--wp--preset--color--primary, #00F0FF);
	border-color: rgba(0, 240, 255, 0.35);
}

.termimal-chip.termimal-status-coming_soon {
	color: var(--wp--preset--color--secondary, #7B61FF);
	border-color: rgba(123, 97, 255, 0.35);
}

.termimal-chip.termimal-cat:hover {
	border-color: var(--wp--preset--color--primary, #00F0FF);
	color: var(--wp--preset--color--primary, #00F0FF);
}

/* —— Bilingual fonts —— */
/* English default: Audiowide */
body.lang-en,
body.lang-en .has-body-font-family,
body.lang-en .has-display-font-family {
	font-family: "Audiowide", system-ui, sans-serif;
}

/* Persian: Vazirmatn (readable for body + headings) */
body.lang-fa,
body.lang-fa .has-body-font-family,
body.lang-fa .has-display-font-family,
body.lang-fa .has-persian-font-family {
	font-family: "Vazirmatn", system-ui, sans-serif;
}

body.dir-rtl {
	direction: rtl;
	text-align: right;
}

body.dir-rtl .termimal-filters__row,
body.dir-rtl .termimal-cta-row,
body.dir-rtl .termimal-meta-bar {
	flex-direction: row-reverse;
}

/* Language switcher */
.termimal-lang-switcher {
	margin-inline-start: 1rem;
}
.termimal-lang-switcher__list {
	display: flex;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
}
.termimal-lang-switcher__item a {
	display: inline-block;
	padding: 0.3rem 0.65rem;
	font-size: 0.75rem;
	border-radius: 6px;
	border: 1px solid var(--wp--preset--color--gray-700, #2A2A2A);
	color: var(--wp--preset--color--gray-400, #A3A3A3);
	text-decoration: none;
	letter-spacing: 0.02em;
}
.termimal-lang-switcher__item.is-active a,
.termimal-lang-switcher__item a:hover {
	border-color: var(--wp--preset--color--primary, #00F0FF);
	color: var(--wp--preset--color--primary, #00F0FF);
}

/* Query Loop cards */
.termimal-product-card {
	overflow: hidden;
	border-radius: 16px !important;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #0c0c0e !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
}
.termimal-product-card .wp-block-post-featured-image,
.termimal-product-card .termimal-card-media {
	margin: 0 !important;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}
.termimal-product-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.termimal-product-card .wp-block-post-title {
	padding: 1rem 1.15rem 0.25rem;
	margin: 0;
	font-size: 1.15rem !important;
}
.termimal-product-card .wp-block-post-excerpt {
	padding: 0 1.15rem 1.15rem;
	color: #a3a3a3;
	font-size: 0.9rem;
}
.termimal-card-media {
	position: relative;
}
.termimal-card-media .termimal-badges {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 2;
}

/* Single product — clean hierarchy, no visual clutter */
.termimal-single-product .termimal-single-title {
	margin-top: 0.5rem;
	margin-bottom: 0.75rem;
}
.termimal-single-product .termimal-single-lead {
	max-width: 40rem;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1.5rem;
}
.termimal-single-hero-image {
	position: relative;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.termimal-single-body .termimal-meta-bar {
	justify-content: center;
}
.termimal-single-body .termimal-cta-row {
	justify-content: center;
}
.termimal-cta {
	border-radius: 10px !important;
	padding: 0.65rem 1.25rem !important;
	font-weight: 600;
	text-decoration: none;
}
.termimal-cta--primary {
	background: #00f0ff !important;
	color: #000 !important;
}
/* Hide accidental duplicate H1 inside post content (old product-hero pattern) */
.termimal-single-body .wp-block-post-title,
.termimal-single-body h1.wp-block-heading:first-child {
	display: none;
}

/* Dynamic particle canvas */
.termimal-particles-canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 0;
}
body > *:not(.termimal-particles-canvas) {
	position: relative;
	z-index: 1;
}
/* Keep admin bar above */
#wpadminbar { z-index: 99999; }

/* Header account links */
.termimal-account-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.termimal-account-nav__item a {
	color: #e5e5e5;
	text-decoration: none;
	font-size: 0.875rem;
}
.termimal-account-nav__item a:hover {
	color: #00f0ff;
}
.termimal-account-nav__cta a {
	display: inline-block;
	padding: 0.35rem 0.75rem;
	border-radius: 8px;
	background: #00f0ff;
	color: #000 !important;
	font-weight: 600;
}
.termimal-account-nav__user span {
	color: #a3a3a3;
	font-size: 0.8rem;
}
.termimal-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(12px);
	background: rgba(5, 5, 7, 0.85) !important;
}
.termimal-header__nav {
	gap: 1rem !important;
}
.termimal-archive__hero {
	margin-bottom: 0.5rem;
}
.termimal-footer .termimal-auth--newsletter {
	max-width: 100%;
	margin: 1rem 0 0;
	padding: 0;
	border: none;
	background: transparent;
}
.termimal-footer .termimal-auth__title { display: none; }


/* Profile page panel */
.termimal-page--profile .termimal-profile-panel,
.termimal-profile-panel {
	max-width: 100%;
	margin: 0 auto;
	padding: 1.75rem;
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(12, 12, 14, 0.92);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.termimal-profile-panel__title {
	margin-top: 0;
	margin-bottom: 1.25rem;
	font-size: 1.35rem;
	font-family: var(--wp--preset--font-family--display, system-ui);
}
.termimal-profile-panel .termimal-contact__input,
.termimal-profile-panel .termimal-contact__textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	background: #0a0a0c;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	color: #f5f5f5;
	padding: 0.65rem 0.85rem;
}
.termimal-profile-panel .termimal-contact__input:focus,
.termimal-profile-panel .termimal-contact__textarea:focus {
	outline: 2px solid rgba(0, 240, 255, 0.45);
	border-color: rgba(0, 240, 255, 0.35);
}
.termimal-profile-panel .termimal-contact__submit {
	background: #00f0ff;
	color: #000;
	border: none;
	border-radius: 10px;
	padding: 0.65rem 1.25rem;
	font-weight: 600;
	cursor: pointer;
}
.termimal-profile-comments li {
	transition: border-color 0.15s ease;
}
.termimal-profile-comments li:hover {
	border-color: rgba(0, 240, 255, 0.35) !important;
}
.termimal-profile-hero {
	text-align: center;
}

/* Single product cover */
.termimal-single-product .termimal-single-hero-image,
.termimal-single-product .wp-block-post-featured-image.termimal-single-hero-image {
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1.5rem;
	border-radius: 16px;
	overflow: hidden;
	background: #111;
	aspect-ratio: 16 / 9;
}
.termimal-single-product .termimal-single-hero-image img,
.termimal-single-product .wp-block-post-featured-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
}
.termimal-single-hero-image--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	border: 1px dashed rgba(0, 240, 255, 0.35);
	background:
		radial-gradient(circle at 30% 40%, rgba(0, 240, 255, 0.08), transparent 55%),
		#0c0c0e;
}
.termimal-cover-empty-label {
	color: #a3a3a3;
	font-size: 0.9rem;
}
.termimal-single-product .termimal-single-title {
	margin-top: 0.5rem;
	margin-bottom: 1.25rem;
}
/* Hide accidental second excerpt if a saved template still includes it */
.termimal-single-product .termimal-single-lead {
	display: none;
}


/* Single product: never show cover/featured image */
.termimal-single-product .wp-block-post-featured-image,
.termimal-single-product .termimal-single-hero-image {
	display: none !important;
}

/* Product archive redesign */
.termimal-archive__hero {
	text-align: center;
	margin-bottom: 0.5rem;
}
.termimal-archive__eyebrow {
	letter-spacing: 0.12em;
	margin-bottom: 0.35rem !important;
}
.termimal-archive__lead {
	max-width: 36rem;
	margin-left: auto !important;
	margin-right: auto !important;
}
.termimal-archive-grid .termimal-product-card {
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
	border: 1px solid rgba(255, 255, 255, 0.06);
}
.termimal-archive-grid .termimal-product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 240, 255, 0.15);
	border-color: rgba(0, 240, 255, 0.25);
}
.termimal-product-card__body .termimal-card-cta a {
	color: #00F0FF;
	text-decoration: none;
	font-weight: 600;
}
.termimal-product-card__body .termimal-card-cta a:hover {
	text-decoration: underline;
}
.termimal-archive-empty {
	border: 1px dashed rgba(255, 255, 255, 0.12);
	border-radius: 16px;
	background: rgba(0, 0, 0, 0.2);
}
.termimal-pagination {
	margin-top: 2.5rem;
}
