/*
 * Shop: catalog, product card, product page.
 * Loaded after style.css; overrides the older rules there.
 * Reference: en.blueelephant.co (grey #e8e8e8 tiles, thin type, black CTA).
 */
:root {
	--be-tile: #e8e8e8;
	--be-shop-line: #cfcfcf;
}

/* ------------------------------------------------------------------
   Product card
------------------------------------------------------------------ */
.products .product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--be-tile);
	border: 0;
}

.products .product-card-media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 352 / 419;
	overflow: hidden;
	background: var(--be-tile);
}

/* The whole pair of glasses is visible with margins: never cover-crop. */
.products .product-card-img {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transform: translate(-50%, -50%);
	transition: opacity 0.35s var(--be-ease);
}

/* Drive studio shots are 3:4 with the frame spanning ~90% of the width. */
.products .product-card.is-portrait .product-card-img {
	width: 66%;
	height: auto;
	max-height: 100%;
}

.products .product-card:hover .product-card-main {
	transform: translate(-50%, -50%);
}

.products .product-card-hover {
	opacity: 0;
}

@media (hover: hover) {
	.products .product-card:hover .product-card-hover,
	.products .product-card:focus-within .product-card-hover {
		opacity: 1;
	}
}

.products .card-heart {
	top: 4px;
	right: 4px;
	width: 44px;
	height: 44px;
	color: #666;
}

.products .card-heart .icon {
	width: 18px;
	height: 18px;
}

.products .card-heart:hover {
	color: var(--be-ink);
}

/* Name, colour and price sit under the image (reference). */
.products .product-card-info {
	position: static;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 2px 10px 24px;
	text-align: center;
	background: var(--be-tile);
	opacity: 1;
	pointer-events: auto;
	transform: none;
	transition: none;
}

.products .product-card-name {
	font-size: 1.3rem;
	letter-spacing: 0.06em;
	line-height: 1.35;
	color: #333;
}

.products .product-card-model {
	text-transform: uppercase;
	font-size: 1.3rem;
	letter-spacing: 0.06em;
}

.products .product-card-color {
	font-size: 1.3rem;
	letter-spacing: 0.04em;
	color: #333;
}

.products .product-card-price,
.products .product-card .price {
	margin: 0;
	font-size: 1.2rem;
	letter-spacing: 0.04em;
	color: #333;
}

/* ------------------------------------------------------------------
   Catalog grid
------------------------------------------------------------------ */
.catalog-main {
	max-width: 1440px;
	padding: 0 16px 8rem;
}

.catalog-main .products {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	background: #fff;
}

.catalog-main .product-card,
.catalog-main .product-card:nth-child(4n),
.catalog-main .product-card:nth-child(2n) {
	border-right: 0;
}

.catalog-main .product-card .product-card-info {
	background: var(--be-tile);
}

/* ------------------------------------------------------------------
   Toolbar: category name left, "Фильтры ⌄ | Сортировка ⌄" right
------------------------------------------------------------------ */
.catalog-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 56px;
	padding: 0 4px;
}

.catalog-toolbar .catalog-title,
.woocommerce .catalog-toolbar .catalog-title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 400;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	color: #8a8a8a;
}

.catalog-actions {
	display: flex;
	align-items: center;
	gap: 0;
}

.catalog-actions .filter-toggle,
.catalog-actions .sort-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	font-size: 1.2rem;
	font-weight: 400;
	letter-spacing: 0.05em;
	line-height: 1;
	text-transform: none;
	color: var(--be-ink);
	background: transparent;
	border: 0;
	cursor: pointer;
}

.catalog-actions .filter-toggle::after,
.catalog-actions .sort-toggle::after {
	content: "";
	position: static;
	flex: none;
	width: 5px;
	height: 5px;
	margin: -3px 0 0;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.catalog-actions [aria-expanded="true"]::after {
	transform: rotate(225deg);
	margin-top: 1px;
}

.catalog-actions .filter-toggle:hover,
.catalog-actions .sort-toggle:hover {
	opacity: 0.6;
}

.catalog-actions .catalog-sort {
	position: relative;
	border-left: 1px solid var(--be-shop-line);
}

.catalog-actions .catalog-sort:last-child .sort-toggle {
	padding-right: 4px;
}

.catalog-actions .filter-toggle {
	padding-right: 18px;
}

.sort-list {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 20;
	min-width: 220px;
	margin: 0;
	padding: 6px 0;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.sort-list[hidden] {
	display: none;
}

.sort-list a {
	display: block;
	padding: 12px 18px;
	font-size: 1.2rem;
	letter-spacing: 0.04em;
	color: #333;
}

.sort-list a:hover,
.sort-list a.is-current {
	color: var(--be-ink);
	background: #f3f3f3;
}

.catalog-filters {
	margin-bottom: 16px;
}

/* Old WooCommerce ordering form is no longer rendered; keep stale markup quiet. */
.catalog-order {
	display: none;
}

.woocommerce-pagination {
	margin-top: 4rem;
}

/* ------------------------------------------------------------------
   Catalog: mobile
------------------------------------------------------------------ */
@media (max-width: 768px) {
	.catalog-main {
		padding: 0 0 6rem;
	}

	.catalog-toolbar {
		display: block;
		min-height: 0;
		padding: 0;
		border-bottom: 1px solid #fff;
		background: #fff;
	}

	.catalog-toolbar .catalog-title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.catalog-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		width: 100%;
	}

	.catalog-actions .filter-toggle,
	.catalog-actions .catalog-sort {
		justify-content: center;
		min-height: 48px;
	}

	.catalog-actions .catalog-sort {
		border-left: 1px solid var(--be-shop-line);
	}

	.catalog-actions .filter-toggle,
	.catalog-actions .sort-toggle {
		width: 100%;
		justify-content: center;
		padding: 0 12px;
	}

	.catalog-actions .catalog-sort:last-child .sort-toggle {
		padding-right: 12px;
	}

	.sort-list {
		right: 0;
		left: auto;
		min-width: 100%;
	}

	.catalog-filters {
		margin: 0 8px 8px;
	}

	.catalog-main .products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.catalog-main .product-card:nth-child(odd),
	.catalog-main .product-card:nth-child(even) {
		border-right: 0;
	}

	.products .product-card-media {
		aspect-ratio: 195 / 250;
	}

	.products .product-card-info {
		padding: 0 6px 20px;
		background: var(--be-tile);
	}

	.products .product-card-name,
	.products .product-card-model,
	.products .product-card-color {
		font-size: 1.25rem;
	}
}

/* ------------------------------------------------------------------
   Product page
------------------------------------------------------------------ */
body.single-product,
body.single-product .site-main {
	background: var(--be-tile);
}

.be-single-product .product-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	column-gap: 40px;
	align-items: start;
	max-width: 1440px;
	margin: 0 auto;
	padding: 10px 100px 8rem;
}

.be-single-product .product-gallery-col {
	min-width: 0;
}

/* Desktop: all photos stacked at full size. */
.pg-track {
	display: flex;
	flex-direction: column;
}

.pg-slide {
	margin: 0;
}

.pg-img {
	display: block;
	width: 100%;
	height: auto;
}

.pg-dots {
	display: none;
}

.be-single-product .product-summary-col {
	position: sticky;
	top: calc(var(--be-header-solid) + 20px);
	align-self: start;
	padding-top: 90px;
}

.product-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--be-shop-line);
}

.be-single-product .product_title {
	margin: 0;
	font-size: 1.8rem;
	font-weight: 400;
	letter-spacing: 0.05em;
	line-height: 1.3;
	text-transform: none;
}

.be-single-product .product-heart {
	position: static;
	flex: none;
	width: 44px;
	height: 44px;
	margin: -12px -12px 0 0;
	color: #666;
}

.be-single-product .product-price-row {
	margin-top: 18px;
}

.be-single-product .product-price-row .price {
	font-size: 1.4rem;
	letter-spacing: 0.03em;
}

.product-total-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-top: 36px;
	font-size: 1.2rem;
	letter-spacing: 0.05em;
}

.product-total-label {
	text-transform: uppercase;
	font-size: 1.1rem;
	letter-spacing: 0.08em;
}

.product-total-value {
	font-style: italic;
}

.product-total-value .price,
.product-total-value .amount {
	font-size: 1.2rem;
}

.be-single-product .product-buy {
	margin-top: 22px;
}

.be-single-product .product-buy form.cart {
	margin: 0;
	padding: 0;
}

.woocommerce div.product .product-buy .single_add_to_cart_button {
	margin: 0;
}

.woocommerce div.product .product-buy .single_add_to_cart_button {
	min-width: 148px;
	height: 37px;
	min-height: 37px;
	padding: 0 28px;
	font-size: 1.2rem;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #fff;
	background: #2c2c2c;
	border-radius: 0;
}

.woocommerce div.product .product-buy .single_add_to_cart_button:hover {
	background: #000;
}

.be-single-product .product-accordions {
	margin-top: 70px;
	border-top: 1px solid var(--be-shop-line);
}

.be-single-product .product-accordion {
	border-bottom: 1px solid var(--be-shop-line);
}

.be-single-product .product-accordion summary {
	min-height: 44px;
	padding: 15px 0;
	font-size: 1.1rem;
	letter-spacing: 0.08em;
	color: #555;
}

.be-single-product .product-accordion[open] summary {
	color: var(--be-ink);
}

.be-single-product .accordion-body {
	padding: 4px 0 24px;
	font-size: 1.15rem;
	line-height: 1.5;
	color: #222;
}

.be-single-product .accordion-body p {
	margin: 0;
}

.be-single-product .accordion-body.product-facts p + p {
	margin-top: 1px;
}

.be-single-product .product-accordion[hidden] {
	display: none;
}

/* Detail section: infographics and campaign shot, stacked and centred. */
.product-details {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0;
	background: #fff;
}

.product-detail-img {
	display: block;
	width: 100%;
	max-width: 860px;
	height: auto;
}

.be-single-product .related.products {
	max-width: 1440px;
	margin: 0 auto;
	padding: 4rem 16px 2rem;
	background: #fff;
}

.be-single-product .related.products > h2 {
	margin: 0 0 2.4rem;
	font-size: 1.4rem;
	letter-spacing: 0.12em;
}

.be-single-product .related.products .products {
	gap: 1px;
}

@media (max-width: 1100px) {
	.be-single-product .product-layout {
		grid-template-columns: minmax(0, 1fr) 260px;
		column-gap: 28px;
		padding: 10px 40px 6rem;
	}
}

/* Mobile: swipe slider with dots, info below. */
@media (max-width: 900px) {
	.be-single-product .product-layout {
		display: block;
		padding: 0 0 4rem;
	}

	.pg {
		position: relative;
	}

	.pg-track {
		flex-direction: row;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.pg-track::-webkit-scrollbar {
		display: none;
	}

	.pg-slide {
		flex: 0 0 100%;
		scroll-snap-align: center;
	}

	.pg-dots {
		display: flex;
		justify-content: center;
		margin-top: 2px;
	}

	.pg-dot {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 28px;
		height: 44px;
		padding: 0;
		background: transparent;
	}

	.pg-dot span {
		display: block;
		width: 7px;
		height: 7px;
		background: #b9b9b9;
		border-radius: 50%;
	}

	.pg-dot.is-active span {
		background: var(--be-ink);
	}

	.be-single-product .product-summary-col {
		position: static;
		padding: 14px 20px 0;
	}

	.be-single-product .product-total-row {
		margin-top: 22px;
	}

	.woocommerce div.product .product-buy .single_add_to_cart_button {
		width: 100%;
		height: 48px;
		min-height: 48px;
	}

	.be-single-product .product-buy form.cart {
		display: block;
	}

	.be-single-product .product-accordions {
		margin-top: 36px;
	}

	.be-single-product .related.products {
		padding: 3rem 0 1rem;
	}
}
