/**
 * Category and product cards
 * @package Elmaslar
 */

.home-section__link-arrow,
.category-card__arrow {
	display: inline-block;
	width: 0.875rem;
	height: 0.875rem;
	background-color: currentColor;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 12H19M19 12L13 6M19 12L13 18' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
}

[dir="rtl"] .home-section__link-arrow,
[dir="rtl"] .category-card__arrow {
	transform: scaleX(-1);
}

.category-card {
	height: 100%;
	scroll-snap-align: start;
}

.category-card__link {
	position: relative;
	display: block;
	height: 100%;
	color: inherit;
	text-decoration: none;
	border-radius: 12px;
	overflow: hidden;
	background: var(--elmaslar-color-white);
	box-shadow: 0 8px 32px rgba(26, 26, 26, 0.06);
	transition:
		transform 0.35s var(--elmaslar-ease),
		box-shadow 0.35s var(--elmaslar-ease);
}

.category-card__link:hover,
.category-card__link:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 16px 40px rgba(26, 26, 26, 0.1);
	text-decoration: none;
}

.category-card__media {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.category-card__img,
.category-card__placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--elmaslar-ease);
}

.category-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(circle at 20% 20%, rgba(201, 162, 39, 0.22) 0%, transparent 45%),
		linear-gradient(145deg, #efe7da 0%, #f8f4ed 55%, #e8ddd0 100%);
}

.category-card__media--spices .category-card__placeholder {
	background:
		radial-gradient(circle at 75% 25%, rgba(139, 26, 26, 0.18) 0%, transparent 42%),
		linear-gradient(145deg, #eadfce 0%, #f6efe4 100%);
}

.category-card__media--tea .category-card__placeholder {
	background:
		radial-gradient(circle at 30% 70%, rgba(139, 26, 26, 0.15) 0%, transparent 40%),
		linear-gradient(145deg, #e8f0e6 0%, #f4f7f2 100%);
}

.category-card__media--turkish-delight .category-card__placeholder {
	background:
		radial-gradient(circle at 70% 30%, rgba(201, 162, 39, 0.25) 0%, transparent 45%),
		linear-gradient(145deg, #f3e8ef 0%, #faf3f7 100%);
}

.category-card__media--nuts .category-card__placeholder {
	background:
		radial-gradient(circle at 25% 35%, rgba(201, 162, 39, 0.2) 0%, transparent 42%),
		linear-gradient(145deg, #ede4d6 0%, #f7f0e6 100%);
}

.category-card__media--coffee .category-card__placeholder {
	background:
		radial-gradient(circle at 80% 60%, rgba(139, 26, 26, 0.2) 0%, transparent 40%),
		linear-gradient(145deg, #e6ddd4 0%, #f2ebe3 100%);
}

.category-card__placeholder-icon {
	width: 3rem;
	height: 3rem;
	border: 2px solid rgba(201, 162, 39, 0.45);
	border-radius: 50%;
}

.category-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(26, 26, 26, 0.72) 0%, rgba(26, 26, 26, 0.08) 55%, transparent 100%);
}

.category-card__link:hover .category-card__img,
.category-card__link:focus-visible .category-card__img {
	transform: scale(1.08);
}

.category-card__content {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 1;
	padding: 1.25rem;
	color: var(--elmaslar-color-white);
}

.category-card__title {
	margin: 0 0 0.25rem;
	font-family: var(--elmaslar-font-display);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
}

.category-card__count {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	opacity: 0.85;
}

.category-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	color: var(--elmaslar-color-gold);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.category-card__arrow {
	background-color: var(--elmaslar-color-gold);
}

.product-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: 12px;
	background: var(--elmaslar-color-white);
	box-shadow: 0 8px 32px rgba(26, 26, 26, 0.06);
	overflow: hidden;
	transition:
		transform 0.35s var(--elmaslar-ease),
		box-shadow 0.35s var(--elmaslar-ease);
}

.product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 40px rgba(26, 26, 26, 0.1);
}

.product-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--elmaslar-color-beige);
}

.product-card__image-link {
	display: block;
	height: 100%;
}

.product-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--elmaslar-ease);
}

.product-card:hover .product-card__img {
	transform: scale(1.05);
}

.product-card__placeholder {
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 30% 30%, rgba(201, 162, 39, 0.18) 0%, transparent 45%),
		linear-gradient(145deg, #efe7da 0%, #f8f4ed 100%);
}

.product-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.625rem;
	padding: 1.125rem;
}

.product-card__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
}

.product-card__title a {
	color: inherit;
	text-decoration: none;
}

.product-card__title a:hover,
.product-card__title a:focus-visible {
	color: var(--elmaslar-color-deep-red);
}

.product-card__excerpt {
	margin: 0;
	color: var(--elmaslar-color-muted);
	font-size: 0.9375rem;
	line-height: 1.6;
}

.product-card__rating {
	line-height: 1;
}

.product-card__rating .star-rating {
	font-size: 0.875rem;
}

.product-card__price {
	color: var(--elmaslar-color-deep-red);
	font-size: 1.0625rem;
	font-weight: 600;
}

.product-card__price del {
	color: var(--elmaslar-color-muted);
	font-weight: 400;
	font-size: 0.875rem;
}

.product-card__stock {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
}

.product-card__stock--out {
	color: var(--elmaslar-color-deep-red);
}

.product-card__actions {
	margin-top: auto;
	padding-top: 0.5rem;
}

.product-card__actions .button,
.product-card__actions .btn {
	width: 100%;
}

.product-card__actions .added_to_cart {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
}

.product-card--featured-large {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 100%;
	height: 100%;
	overflow: hidden;
	box-shadow: 0 12px 48px rgba(26, 26, 26, 0.08);
}

.product-card--featured-large .product-card__media {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
	height: 100%;
	width: 100%;
}

.product-card--featured-large .product-card__img,
.product-card--featured-large .product-card__placeholder {
	height: 100%;
}

.product-card--featured-large .product-card__badge {
	z-index: 3;
}

.product-card--featured-large .product-card__body {
	position: relative;
	z-index: 2;
	margin-top: auto;
	padding: clamp(1.25rem, 3vw, 2rem);
	background: linear-gradient(180deg, rgba(26, 26, 26, 0) 0%, rgba(26, 26, 26, 0.78) 72%, rgba(26, 26, 26, 0.92) 100%);
	color: var(--elmaslar-color-white);
}

.product-card--featured-large .product-card__title {
	font-family: var(--elmaslar-font-display);
	font-size: clamp(1.375rem, 2.5vw, 1.75rem);
}

.product-card--featured-large .product-card__title a,
.product-card--featured-large .product-card__excerpt,
.product-card--featured-large .product-card__price,
.product-card--featured-large .product-card__price del {
	color: inherit;
}

.product-card--featured-large .product-card__excerpt {
	color: rgba(255, 255, 255, 0.82);
}

.product-card--featured-large .product-card__price del {
	opacity: 0.75;
}

.product-card--featured-large .product-card__view {
	width: auto;
	border-color: rgba(255, 255, 255, 0.85);
	background: transparent;
	color: var(--elmaslar-color-white);
}

.product-card--featured-large .product-card__view:hover,
.product-card--featured-large .product-card__view:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	border-color: var(--elmaslar-color-white);
	color: var(--elmaslar-color-white);
}

.home-featured__primary {
	min-height: 100%;
}

.product-card--featured-small {
	height: 100%;
}

.product-card--featured-small .product-card__media {
	aspect-ratio: 1 / 1;
}

.product-card--featured-small .product-card__body {
	padding: 0.875rem;
}

.product-card--featured-small .product-card__title {
	font-size: 0.9375rem;
}

.product-card--featured-small .product-card__price {
	font-size: 0.9375rem;
}

.product-card__img--placeholder {
	object-fit: contain;
	padding: 1.25rem;
	background: linear-gradient(145deg, #efe7da 0%, #f8f4ed 100%);
}

@media (max-width: 1023px) {
	.product-card--featured-large {
		min-height: 22rem;
	}
}

.product-card--demo {
	opacity: 0.92;
}

.star-rating {
	overflow: hidden;
	position: relative;
	width: 5.4em;
	height: 1em;
	line-height: 1;
}

.star-rating::before {
	content: "★★★★★";
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	color: #ddd;
	letter-spacing: 0.12em;
	font-size: 0.875rem;
}

.star-rating span {
	overflow: hidden;
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	padding-top: 1.5em;
}

.star-rating span::before {
	content: "★★★★★";
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	color: var(--elmaslar-color-gold);
	letter-spacing: 0.12em;
	font-size: 0.875rem;
}
