/* ==========================================================================
   Amine Phone — home page
   Colours, radius and fonts come from the theme's Customizer variables.
   Hover effects sit on inner elements so they never fight the outer
   element's scroll-reveal transform/delay.
   ========================================================================== */

.aph-home {
	--aph-accent: var(--primary-color, #f15502);
	--aph-accent-soft: color-mix(in srgb, var(--aph-accent) 12%, #fff);
	--aph-ink: #111114;
	--aph-muted: #6b6f76;
	--aph-line: #ececef;
	--aph-surface: #f6f6f8;
	--aph-radius: var(--theme-radius, 14px);
	--aph-ease: cubic-bezier(.2, .7, .2, 1);
	overflow-x: clip;
}

.aph-container {
	max-width: 1388px;
	margin-inline: auto;
	padding-inline: 20px;
	box-sizing: border-box;
}

.aph-section {
	padding-block: 64px;
}

/* ---------- Section heading ---------- */

.aph-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 32px;
}

.aph-head__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--aph-accent);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.aph-head__eyebrow::before {
	content: "";
	width: 26px;
	height: 3px;
	border-radius: 3px;
	background: currentColor;
}

.aph-head__title {
	margin: 8px 0 0;
	color: var(--aph-ink);
	font-size: clamp(22px, 2.4vw, 32px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.01em;
}

.aph-head__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	color: var(--aph-accent);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.aph-head__link svg {
	transition: transform .3s var(--aph-ease);
}

.aph-head__link:hover svg {
	transform: translateX(4px);
}

/* ---------- Hero ---------- */

.aph-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(480px, 74vh, 700px);
	overflow: hidden;
	isolation: isolate;
	background: #0b0b0d;
	color: #fff;
}

.aph-hero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.aph-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	animation: aph-zoom 20s var(--aph-ease) both;
}

.aph-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(8, 8, 10, .94) 0%, rgba(8, 8, 10, .72) 38%, rgba(8, 8, 10, .18) 72%, rgba(8, 8, 10, 0) 100%),
		linear-gradient(0deg, rgba(8, 8, 10, .6) 0%, rgba(8, 8, 10, 0) 45%);
}

.aph-hero__glow {
	position: absolute;
	z-index: 1;
	border-radius: 50%;
	background: var(--aph-accent);
	filter: blur(90px);
	opacity: .45;
	pointer-events: none;
	animation: aph-float 9s ease-in-out infinite alternate;
}

.aph-hero__glow--a {
	width: 380px;
	height: 380px;
	inset-block-start: -120px;
	inset-inline-start: -100px;
}

.aph-hero__glow--b {
	width: 260px;
	height: 260px;
	inset-block-end: -90px;
	inset-inline-start: 34%;
	opacity: .3;
	animation-duration: 12s;
	animation-delay: -4s;
}

.aph-hero__inner {
	width: 100%;
	max-width: 1388px;
	margin-inline: auto;
	padding: 80px 48px;
	box-sizing: border-box;
}

.aph-hero__inner > * {
	max-width: 640px;
	animation: aph-rise .9s var(--aph-ease) both;
}

.aph-hero__inner > :nth-child(2) { animation-delay: .12s; }
.aph-hero__inner > :nth-child(3) { animation-delay: .24s; }
.aph-hero__inner > :nth-child(4) { animation-delay: .36s; }

.aph-hero__badge {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 6px;
	background: var(--aph-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .03em;
	box-shadow: 0 8px 24px color-mix(in srgb, var(--aph-accent) 45%, transparent);
}

.aph-hero__title {
	margin: 22px 0 18px;
	color: #fff;
	font-size: clamp(36px, 5.4vw, 72px);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -.02em;
	text-wrap: balance;
}

.aph-hero__text {
	margin: 0 0 34px;
	color: rgba(255, 255, 255, .84);
	font-size: clamp(16px, 1.35vw, 19px);
	line-height: 1.65;
	max-width: 54ch;
}

.aph-hero__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 16px 32px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--aph-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 12px 30px color-mix(in srgb, var(--aph-accent) 45%, transparent);
	transition: transform .3s var(--aph-ease), box-shadow .3s var(--aph-ease);
}

/* Light sweep across the button every few seconds. */
.aph-hero__btn::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
	transform: translateX(-120%);
	animation: aph-shine 4.5s ease-in-out 1.6s infinite;
}

.aph-hero__btn svg {
	transition: transform .3s var(--aph-ease);
}

.aph-hero__btn:hover {
	color: #fff;
	transform: translateY(-3px);
	box-shadow: 0 18px 38px color-mix(in srgb, var(--aph-accent) 55%, transparent);
}

.aph-hero__btn:hover svg {
	transform: translateX(4px);
}

/* ---------- Categories (5 per row) ---------- */

.aph-cats__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 28px 24px;
}

.aph-cat {
	display: flex;
	flex-direction: column;
	gap: 12px;
	color: var(--aph-ink);
	text-decoration: none;
}

.aph-cat__media {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--aph-radius);
	background: var(--aph-surface);
	transition: transform .45s var(--aph-ease), box-shadow .45s var(--aph-ease);
}

.aph-cat__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s var(--aph-ease);
}

.aph-cat:hover .aph-cat__media,
.aph-cat:focus-visible .aph-cat__media {
	transform: translateY(-6px);
	box-shadow: 0 18px 36px rgba(17, 17, 20, .12);
}

.aph-cat:hover .aph-cat__img {
	transform: scale(1.06);
}

.aph-cat__name {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.aph-cat__count {
	color: var(--aph-accent);
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- Promises strip ---------- */

.aph-trust {
	padding-block: 8px 24px;
}

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

.aph-trust__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px;
	border: 1px solid var(--aph-line);
	border-radius: var(--aph-radius);
	background: #fff;
}

.aph-trust__icon {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--aph-accent-soft);
	color: var(--aph-accent);
	transition: transform .4s var(--aph-ease), background-color .3s, color .3s;
}

.aph-trust__item:hover .aph-trust__icon {
	transform: rotate(-8deg) scale(1.08);
	background: var(--aph-accent);
	color: #fff;
}

.aph-trust__title {
	display: block;
	color: var(--aph-ink);
	font-size: 15px;
	font-weight: 700;
}

.aph-trust__text {
	display: block;
	margin-top: 3px;
	color: var(--aph-muted);
	font-size: 13px;
	line-height: 1.45;
}

/* ---------- Sub-category slider ---------- */

.aph-subcats {
	background: var(--aph-surface);
}

.aph-slider {
	position: relative;
}

.aph-slider__track {
	--aph-per-view: 8;
	--aph-gap: 18px;
	display: flex;
	gap: var(--aph-gap);
	margin: 0;
	padding: 6px 2px 10px;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.aph-slider__track::-webkit-scrollbar {
	display: none;
}

.aph-subcat {
	flex: 0 0 calc((100% - (var(--aph-per-view) - 1) * var(--aph-gap)) / var(--aph-per-view));
	scroll-snap-align: start;
}

.aph-subcat__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	color: var(--aph-ink);
	text-align: center;
	text-decoration: none;
}

/* Gradient ring that spins in on hover. */
.aph-subcat__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1;
	margin-bottom: 8px;
	padding: 4px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, var(--aph-accent), #ffb27a, var(--aph-accent));
	background-size: 100%;
	box-sizing: border-box;
	transition: transform .45s var(--aph-ease);
}

.aph-subcat__media::before {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: #fff;
}

.aph-subcat__img {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	padding: 10%;
	border-radius: 50%;
	object-fit: contain;
	box-sizing: border-box;
	transition: transform .5s var(--aph-ease);
}

.aph-subcat__link:hover .aph-subcat__media {
	transform: translateY(-5px) rotate(-4deg);
}

.aph-subcat__link:hover .aph-subcat__img {
	transform: scale(1.08) rotate(4deg);
}

.aph-subcat__name {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.aph-subcat__count {
	color: var(--aph-muted);
	font-size: 12px;
}

.aph-slider__nav {
	position: absolute;
	inset-block-start: 38%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--aph-ink);
	box-shadow: 0 8px 24px rgba(17, 17, 20, .14);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity .25s, background-color .25s, color .25s;
}

.aph-slider__nav:hover {
	background: var(--aph-accent);
	color: #fff;
}

.aph-slider__nav:disabled {
	opacity: 0;
	pointer-events: none;
}

.aph-slider__nav--prev { inset-inline-start: -18px; }
.aph-slider__nav--next { inset-inline-end: -18px; }

/* ---------- Discounted products ---------- */

.aph-deals {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: #121214;
}

/* Slow-moving accent glow behind the cards. */
.aph-deals::before {
	content: "";
	position: absolute;
	inset: -40%;
	z-index: -1;
	background:
		radial-gradient(closest-side, color-mix(in srgb, var(--aph-accent) 55%, transparent), transparent) 15% 30% / 45% 55% no-repeat,
		radial-gradient(closest-side, color-mix(in srgb, var(--aph-accent) 30%, transparent), transparent) 85% 75% / 40% 50% no-repeat;
	animation: aph-drift 16s ease-in-out infinite alternate;
}

.aph-deals .aph-head__title {
	color: #fff;
}

.aph-deals .aph-head__eyebrow {
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--aph-accent);
	color: #fff;
	animation: aph-pulse 2.4s ease-in-out infinite;
}

.aph-deals .aph-head__eyebrow::before {
	display: none;
}

.aph-deals .aph-head__link {
	color: #fff;
}

.aph-deals .qt-product-carousel {
	max-width: none;
	margin: 0;
	padding: 0;
}

.aph-deals .product-badge-discount {
	animation: aph-pulse 2.4s ease-in-out infinite;
}

/* ---------- New products (5 per row) ---------- */

.aph-new__grid.latest-products-grid {
	grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	gap: 24px !important;
	max-width: none;
}

.aph-new__more {
	margin: 40px 0 0;
	text-align: center;
}

.aph-btn {
	display: inline-flex;
	align-items: center;
	padding: 14px 32px;
	border: 2px solid var(--aph-accent);
	border-radius: 999px;
	color: var(--aph-accent);
	font-weight: 700;
	text-decoration: none;
	transition: background-color .3s, color .3s, transform .3s var(--aph-ease);
}

.aph-btn:hover {
	background: var(--aph-accent);
	color: #fff;
	transform: translateY(-2px);
}

/* ---------- Right-to-left (Arabic) ---------- */

/* Text sits on the right, so the hero darkens from the right. */
[dir="rtl"] .aph-hero__media::after {
	background:
		linear-gradient(270deg, rgba(8, 8, 10, .94) 0%, rgba(8, 8, 10, .72) 38%, rgba(8, 8, 10, .18) 72%, rgba(8, 8, 10, 0) 100%),
		linear-gradient(0deg, rgba(8, 8, 10, .6) 0%, rgba(8, 8, 10, 0) 45%);
}

/* Arrows point the reading direction. */
[dir="rtl"] .aph-hero__btn svg,
[dir="rtl"] .aph-head__link svg,
[dir="rtl"] .aph-slider__nav svg {
	transform: scaleX(-1);
}

[dir="rtl"] .aph-hero__btn:hover svg,
[dir="rtl"] .aph-head__link:hover svg {
	transform: scaleX(-1) translateX(4px);
}

/* Arabic has no letter case; the uppercase eyebrow spacing only suits Latin. */
[dir="rtl"] .aph-head__eyebrow {
	letter-spacing: 0;
}

/* ---------- Scroll reveal (home.js adds .is-in) ---------- */

.aph-js [data-aph-reveal] {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .75s var(--aph-ease), transform .75s var(--aph-ease);
	transition-delay: calc(var(--aph-i, 0) * 90ms);
}

.aph-js [data-aph-reveal].is-in {
	opacity: 1;
	transform: none;
}

/* ---------- Keyframes ---------- */

@keyframes aph-rise {
	from { opacity: 0; transform: translateY(26px); }
	to { opacity: 1; transform: none; }
}

@keyframes aph-zoom {
	from { transform: scale(1.12); }
	to { transform: scale(1); }
}

@keyframes aph-float {
	from { transform: translate3d(0, 0, 0); }
	to { transform: translate3d(60px, 40px, 0); }
}

@keyframes aph-shine {
	0%, 60% { transform: translateX(-120%); }
	100% { transform: translateX(120%); }
}

@keyframes aph-drift {
	from { transform: translate3d(-4%, -2%, 0) rotate(0deg); }
	to { transform: translate3d(4%, 3%, 0) rotate(8deg); }
}

@keyframes aph-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.06); }
}

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

@media (max-width: 1099px) {
	.aph-cats__grid,
	.aph-new__grid.latest-products-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}

	.aph-trust__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.aph-slider__track {
		--aph-per-view: 5;
	}
}

@media (max-width: 768px) {
	.aph-section {
		padding-block: 44px;
	}

	.aph-head {
		margin-bottom: 22px;
	}

	.aph-hero {
		min-height: 520px;
		align-items: flex-end;
	}

	.aph-hero__inner {
		padding: 56px 20px 48px;
	}

	.aph-hero__media::after {
		background: linear-gradient(0deg, rgba(8, 8, 10, .95) 0%, rgba(8, 8, 10, .75) 45%, rgba(8, 8, 10, .25) 100%);
	}

	.aph-hero__text {
		margin-bottom: 26px;
	}

	.aph-cats__grid,
	.aph-new__grid.latest-products-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 16px 12px !important;
	}

	.aph-cat__name {
		font-size: 14px;
	}

	.aph-trust__list {
		gap: 10px;
	}

	.aph-trust__item {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		padding: 16px;
	}

	.aph-trust__icon {
		width: 44px;
		height: 44px;
	}

	.aph-slider__track {
		--aph-per-view: 3.4;
		--aph-gap: 14px;
	}

	.aph-slider__nav {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aph-home *,
	.aph-home *::before,
	.aph-home *::after {
		animation: none !important;
		transition: none !important;
	}

	.aph-js [data-aph-reveal] {
		opacity: 1;
		transform: none;
	}

	.aph-slider__track {
		scroll-behavior: auto;
	}
}
