/* =========================================================
   Airtrust — After-sales Services (archive + single)
   Matches the site: dark surfaces, thin borders, blue accent.
   Change the tokens below if your theme colors differ.
   ========================================================= */

.ats {
	--ats-bg: #0b0b0c;
	--ats-surface: #121214;
	--ats-border: #2a2a2e;
	--ats-text: #f2f2f2;
	--ats-muted: #a3a3a8;
	--ats-accent: #1f4b8f;
	--ats-accent-hover: #2a5fb0;
	--ats-radius: 6px;
	--ats-gap: 24px;
	--ats-max: 1440px;

	background: var(--ats-bg);
	color: var(--ats-text);
	direction: rtl;
	text-align: right;
	font-family: inherit;
}

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

.ats img { max-width: 100%; height: auto; display: block; }
.ats a { color: inherit; text-decoration: none; }

.ats-container {
	width: 100%;
	max-width: var(--ats-max);
	margin-inline: auto;
	padding-inline: 32px;
}

/* ---------- Hero ---------- */
.ats-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 460px;
	overflow: hidden;
	background: var(--ats-surface);
	border-bottom: 1px solid var(--ats-border);
}
.ats-hero--single { min-height: 560px; }
.ats-hero--plain { min-height: 300px; }

.ats-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
}
.ats-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to left, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .15) 100%);
}
.ats-hero--single .ats-hero__overlay { background: rgba(0, 0, 0, .55); }

.ats-hero__inner {
	position: relative;
	z-index: 1;
	padding-block: 64px;
}
.ats-hero__inner--center {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.ats-hero__title {
	margin: 0;
	max-width: 760px;
	font-size: clamp(28px, 4vw, 46px);
	font-weight: 700;
	line-height: 1.5;
	color: #fff;
}
.ats-hero__subtitle {
	margin: 16px 0 0;
	max-width: 620px;
	font-size: clamp(15px, 1.4vw, 18px);
	line-height: 1.9;
	color: rgba(255, 255, 255, .85);
}
.ats-hero__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	padding: 12px 20px;
	background: rgba(255, 255, 255, .92);
	border-radius: var(--ats-radius);
}
.ats-hero__logo img { max-height: 44px; width: auto; }

/* ---------- Section + heading (same as "پر فروش های ایرتراست") ---------- */
.ats-section { padding-block: 64px 0; }
.ats-section:last-child { padding-bottom: 80px; }

.ats-heading {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-bottom: 32px;
}
.ats-heading__title {
	margin: 0;
	flex-shrink: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--ats-text);
}
.ats-heading__line {
	flex: 1;
	height: 1px;
	background: var(--ats-border);
}

/* ---------- Archive grid: 3 / 2 / 1 ---------- */
.ats-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--ats-gap);
}

.ats-card {
	display: flex;
	flex-direction: column;
	background: var(--ats-surface);
	border: 1px solid var(--ats-border);
	border-radius: var(--ats-radius);
	overflow: hidden;
	transition: border-color .25s ease, transform .25s ease;
}
.ats-card:hover {
	border-color: #3d3d44;
	transform: translateY(-3px);
}

.ats-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #18181b;
}
.ats-card__img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	transition: transform .5s ease;
}
.ats-card:hover .ats-card__img { transform: scale(1.04); }
.ats-card__placeholder { position: absolute; inset: 0; background: #18181b; }

.ats-card__logo {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	align-items: center;
	padding: 6px 10px;
	background: rgba(255, 255, 255, .92);
	border-radius: 4px;
}
.ats-card__logo img { max-height: 26px; width: auto; }

.ats-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 8px;
	padding: 22px;
}
.ats-card__meta { font-size: 13px; color: var(--ats-muted); }
.ats-card__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.6;
}
.ats-card__title a:hover { color: #8fb4ec; }
.ats-card__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.9;
	color: var(--ats-muted);
}
.ats-card .ats-btn { margin-top: auto; align-self: stretch; }
.ats-card__body > :nth-last-child(2) { margin-bottom: 12px; }

/* ---------- Buttons (same as "مشاهده محصول") ---------- */
.ats-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 8px 22px;
	font-size: 14px;
	font-weight: 500;
	color: #fff !important;
	background: var(--ats-accent);
	border: 1px solid var(--ats-accent);
	border-radius: var(--ats-radius);
	transition: background-color .2s ease, border-color .2s ease;
}
.ats-btn:hover {
	background: var(--ats-accent-hover);
	border-color: var(--ats-accent-hover);
}
.ats-btn--outline {
	background: transparent;
	border-color: #5a5a60;
}
.ats-btn--outline:hover {
	background: rgba(255, 255, 255, .06);
	border-color: #8a8a90;
}

/* ---------- Pagination ---------- */
.ats-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 48px;
}
.ats-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding-inline: 10px;
	font-size: 14px;
	border: 1px solid var(--ats-border);
	border-radius: var(--ats-radius);
	color: var(--ats-muted);
	transition: all .2s ease;
}
.ats-pagination .page-numbers:hover { color: #fff; border-color: #5a5a60; }
.ats-pagination .page-numbers.current {
	color: #fff;
	background: var(--ats-accent);
	border-color: var(--ats-accent);
}
.ats-empty { color: var(--ats-muted); text-align: center; padding-block: 40px; }

/* ---------- Single: description ---------- */
.ats-content {
	max-width: 860px;
	font-size: 16px;
	line-height: 2.1;
	color: #d6d6da;
}
.ats-content > *:first-child { margin-top: 0; }
.ats-content h2,
.ats-content h3,
.ats-content h4 { color: #fff; line-height: 1.6; margin: 32px 0 12px; }
.ats-content p { margin: 0 0 18px; }
.ats-content ul,
.ats-content ol { padding-right: 22px; padding-left: 0; margin: 0 0 18px; }
.ats-content a { color: #8fb4ec; text-decoration: underline; text-underline-offset: 4px; }
.ats-content img { border-radius: var(--ats-radius); margin-block: 16px; }
.ats-content__cta { margin-top: 28px !important; }
.ats-content__cta a { text-decoration: none; color: #fff; }

/* ---------- Single: downloads ---------- */
.ats-downloads {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}
.ats-download {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 72px;
	padding: 14px 18px;
	background: var(--ats-surface);
	border: 1px solid var(--ats-border);
	border-radius: var(--ats-radius);
	transition: border-color .2s ease, background-color .2s ease;
}
.ats-download:hover {
	border-color: var(--ats-accent);
	background: #15171c;
}
.ats-download__icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	color: #fff;
	background: var(--ats-accent);
	border-radius: var(--ats-radius);
	transition: background-color .2s ease, transform .2s ease;
}
.ats-download:hover .ats-download__icon {
	background: var(--ats-accent-hover);
	transform: translateY(2px);
}
.ats-download__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.ats-download__label {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.6;
	color: var(--ats-text);
	overflow-wrap: anywhere;
}
.ats-download__meta {
	font-size: 12px;
	color: var(--ats-muted);
	text-align: right;
}

/* ---------- Single: gallery ---------- */
.ats-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}
.ats-gallery__item {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border: 1px solid var(--ats-border);
	border-radius: var(--ats-radius);
	background: var(--ats-surface);
	cursor: zoom-in;
}
.ats-gallery__item img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	transition: transform .5s ease, opacity .3s ease;
}
.ats-gallery__item:hover img { transform: scale(1.05); opacity: .9; }

/* ---------- Single: video (iframe) ---------- */
.ats-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border: 1px solid var(--ats-border);
	border-radius: var(--ats-radius);
	background: #000;
}
.ats-video > *,
.ats-video iframe,
.ats-video span,
.ats-video div {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}
.ats-video iframe { border: 0; }

.ats-section--back .ats-container { display: flex; justify-content: center; }

/* ---------- Lightbox ---------- */
.ats-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 72px;
	background: rgba(0, 0, 0, .92);
}
.ats-lightbox[hidden] { display: none; }
.ats-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
}
.ats-lightbox button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	color: #fff;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .2s ease;
}
.ats-lightbox button:hover { background: rgba(255, 255, 255, .18); }
.ats-lightbox__close { top: 16px; left: 16px; }
.ats-lightbox__nav--prev { right: 16px; top: 50%; transform: translateY(-50%); }
.ats-lightbox__nav--next { left: 16px; top: 50%; transform: translateY(-50%); }
body.ats-no-scroll { overflow: hidden; }

/* ---------- Hero slider (archive page) ---------- */
.ats-slider {
	display: block;
	min-height: 0;
	padding: 0;
}
.ats-slider__track {
	position: relative;
	display: grid;
	min-height: 520px;
}
.ats-slide {
	grid-area: 1 / 1;
	position: relative;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .8s ease, visibility 0s linear .8s;
}
.ats-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
	transition: opacity .8s ease, visibility 0s;
}
.ats-slide .ats-hero__bg { transform: scale(1.04); transition: transform 7s ease-out; }
.ats-slide.is-active .ats-hero__bg { transform: scale(1); }
.ats-slide:not(:has(.ats-hero__bg)) { background: var(--ats-surface); }

.ats-slide .ats-hero__inner > * {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .6s ease, transform .6s ease;
}
.ats-slide.is-active .ats-hero__inner > * { opacity: 1; transform: none; }
.ats-slide.is-active .ats-hero__inner > *:nth-child(2) { transition-delay: .12s; }
.ats-slide.is-active .ats-hero__inner > *:nth-child(3) { transition-delay: .24s; }
.ats-hero__btn { margin-top: 28px; }

/* Dots — same as the home slider */
.ats-slider__dots {
	position: absolute;
	bottom: 24px;
	left: 50%;
	z-index: 3;
	display: flex;
	gap: 10px;
	transform: translateX(-50%);
}
.ats-slider__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .45);
	cursor: pointer;
	transition: width .3s ease, background-color .3s ease;
}
.ats-slider__dot.is-active { width: 26px; background: #fff; }

/* Arrows — prev on the right edge, next on the left edge (RTL) */
.ats-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	color: #fff;
	background: rgba(0, 0, 0, .35);
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	cursor: pointer;
	transform: translateY(-50%);
	backdrop-filter: blur(4px);
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ats-slider__arrow:hover {
	color: #111;
	background: #fff;
	border-color: #fff;
}
.ats-slider__arrow--prev { right: 24px; }
.ats-slider__arrow--next { left: 24px; }
.ats-slider.is-multi .ats-hero__inner { padding-inline: 96px; }

@media (max-width: 1024px) {
	.ats-slider__track { min-height: 420px; }
}
@media (max-width: 767px) {
	.ats-slider__track { min-height: 380px; }
	.ats-slider.is-multi .ats-hero__inner { padding-inline: 56px; padding-bottom: 56px; }
	.ats-slider__arrow { width: 36px; height: 36px; }
	.ats-slider__arrow svg { width: 16px; height: 16px; }
	.ats-slider__arrow--prev { right: 10px; }
	.ats-slider__arrow--next { left: 10px; }
	.ats-slider__dots { bottom: 20px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.ats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ats-downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ats-hero { min-height: 380px; }
	.ats-hero--single { min-height: 440px; }
}

@media (max-width: 767px) {
	.ats-container { padding-inline: 16px; }
	.ats-grid { grid-template-columns: 1fr; gap: 16px; }
	.ats-downloads { grid-template-columns: 1fr; gap: 10px; }
	.ats-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.ats-hero { min-height: 300px; }
	.ats-hero--single { min-height: 340px; }
	.ats-hero__inner { padding-block: 40px; }
	.ats-hero__overlay { background: rgba(0, 0, 0, .58); }
	.ats-section { padding-top: 44px; }
	.ats-section:last-child { padding-bottom: 56px; }
	.ats-heading { gap: 16px; margin-bottom: 22px; }
	.ats-heading__title { font-size: 16px; }
	.ats-card__body { padding: 18px; }
	.ats-content { font-size: 15px; line-height: 2; }
	.ats-lightbox { padding: 64px 12px; }
	.ats-lightbox__nav { top: auto !important; bottom: 12px; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.ats * { transition: none !important; }
}
