/* Kailash styles, enqueued by functions.php with the file time as version (YOOtheme loads custom.css with its own version, so edits stay cached in browsers). */

/* Catalog filter: the offcanvas toggle "Фильтр" in one row with the product count and sorting. */
:has(> .kl-filter-icon) {
	display: flex;
	align-items: flex-start;
	column-gap: 20px;
}
.kl-filter-icon {
	flex: none;
	margin: 0 !important;
	position: relative; /* above the negative grid margin of the next block, which caught the clicks */
	z-index: 1;
}
.kl-filter-icon + * {
	flex: 1;
	min-width: 0;
	margin-top: 0 !important;
}

/* Category strip (menu «Полоса категорий» in the Top position): one row, scrolls sideways on small screens. */
@media (max-width: 959px) {
	.kl-category-bar .uk-subnav {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.kl-category-bar .uk-subnav > * {
		flex: none;
	}
}

/* Footer menu «Футер: Коллекции»: one menu in two columns. */
.kl-footer-columns {
	column-count: 2;
	column-gap: 40px;
}

/* Подборки и сортировка (builder/kailash_seo_nav): sections of a dropdown side by side, links on one line. */
.kl-seo-nav .uk-dropdown-nav a,
.kl-seo-nav .uk-nav-header {
	white-space: nowrap;
}
@media (min-width: 960px) {
	.kl-seo-nav .uk-dropdown.uk-dropdown {
		width: auto;
	}
	.kl-seo-nav .kl-seo-sections {
		flex-wrap: nowrap;
	}
	.kl-seo-nav .kl-seo-sections > * {
		flex: none;
	}
}

/* Product page «Путь артефакта» (description list .kl-timeline): vertical line with a dot per event. */
.kl-timeline > li {
	position: relative;
	margin-top: 0;
	padding: 0 0 20px 28px;
	border-left: 1px solid #3a3631;
}
.kl-timeline > li:last-child {
	padding-bottom: 0;
}
.kl-timeline > li::before {
	content: '';
	position: absolute;
	left: -4px;
	top: 5px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #D6BB91;
}

/* Page «История коллекции» (section .kl-history, script .claude/scripts/pages/about-pages.php): year on the
   left, events on a vertical line with a dot each, like «Путь артефакта». Rows sit without margins so the line is continuous. */
.kl-history .uk-grid + .uk-grid {
	margin-top: 0;
}
.kl-history .kl-history-event > * {
	position: relative;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-left: 40px;
	border-left: 1px solid #3a3631;
}
.kl-history .kl-history-event > * + * {
	padding-top: 15px;
}
.kl-history .kl-history-event > :last-child {
	padding-bottom: 60px;
}
.kl-history .uk-grid:last-child .kl-history-event > :last-child {
	padding-bottom: 0;
}
.kl-history .kl-history-event > :first-child::before {
	content: '';
	position: absolute;
	left: -6px;
	top: 8px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #D6BB91;
}
.kl-history .kl-history-photo img {
	max-width: 520px;
	width: 100%;
}
@media (max-width: 959px) {
	.kl-history .kl-history-year {
		margin-bottom: 8px;
	}
}

/* Product grid on phones: no side gaps, photos reach the screen edges (container padding 15px, column gap 15px). */
@media (max-width: 639px) {
	.uk-grid:has(> .kailash-product) {
		margin-left: -30px;
		margin-right: -15px;
	}
	.kailash-product > :not(:first-child) {
		padding: 0 10px;
	}
}

/* Labels on the catalog photo (kailash-core «Метки на фото») and «Эксклюзив» (gold). */
.kl-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.uk-label.kl-label-exclusive {
	background: #D6BB91;
	color: #191817;
}

/* «Фичи товара» (kailash-core): outlined pills; on the catalog photo with an opaque background. */
.kl-features {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.kl-features > span {
	padding: 2px 10px;
	border: 1px solid #3a3631;
	border-radius: 500px;
	font-size: 12px;
	line-height: 18px;
}
.uk-inline-clip .kl-features > span {
	background: #191817;
	color: #F4F0E8;
}

/* Product page «Посмотреть и услышать рассказ» (grid .kl-videos): play button on the poster, the video opens in the lightbox. */
.kl-videos .uk-card-media-top {
	position: relative;
}
.kl-videos .uk-card-media-top::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border: 1px solid #F4F0E8;
	border-radius: 50%;
	background: #191817 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23F4F0E8' d='M7 5l8 5-8 5z'/%3E%3C/svg%3E") center / 22px no-repeat;
}

/* «Резерв» after the price (kailash-core status.php): gold outline, readable on any background. */
.uk-label.kl-label-reserve {
	background: #191817;
	border: 1px solid #D6BB91;
	color: #D6BB91;
}

/* Disabled «Оформить заказ» of a reserved artifact: opaque muted colours, no pointer. */
.button.alt.single_add_to_cart_button:disabled {
	border-color: #3a3631;
	background: #3a3631;
	color: #b3aa9c;
	cursor: not-allowed;
}

/* Home slider of exclusives (panel slider .kl-exclusive-slider): labels from the item content sit on the photo, as in catalog cards. */
.kl-exclusive-slider .el-item {
	position: relative;
}
.kl-exclusive-slider .kl-badges {
	position: absolute;
	top: 15px;
	left: 15px;
}
.kl-exclusive-slider .el-content {
	position: static;
	margin: 0;
}

/* Home hero (Product Index): columns without a gap so the portrait is as wide as in the mockup; the name gets a vertical line.
   Phones: text on top, then the name on the left and the portrait on the right, pulled up under the text. */
.kl-hero-name {
	padding: 4px 0 4px 16px;
	border-left: 2px solid #b3aa9c;
}
@media (min-width: 960px) {
	.kl-hero-text {
		padding-right: 40px;
	}
	.kl-hero-name {
		margin-left: 20px;
		padding: 6px 0 6px 24px;
	}
}
@media (max-width: 959px) {
	.kl-hero-text {
		position: relative;
		z-index: 1;
		padding-top: 20px;
	}
	.kl-hero-text p {
		font-size: 15px;
	}
	.kl-hero-name-col {
		order: 1;
		position: relative;
		z-index: 1;
	}
	/* Portrait smaller than the column and lower by the same amount: the head starts below the hero text. */
	.kl-hero-portrait {
		order: 2;
		margin-top: -48px !important;
	}
	.kl-hero-portrait img {
		display: block;
		width: 82%;
		margin-left: auto;
	}
	.kl-hero-name {
		white-space: nowrap;
	}
	/* Catalog section (filter row «Подборки» / sorting): smaller gaps above and below the divider and the filter row. */
	.uk-section:has(.kailash-product):has(hr) > .uk-container > :is(.uk-grid-margin, .uk-grid-margin-medium):not(:first-child) {
		margin-top: 15px;
	}
	.kl-hero-name .uk-h3 {
		font-size: 18px;
	}
	.kl-hero-name .uk-text-muted {
		font-size: 13px;
	}
}

/* Product page features under the short description (text element .kl-product-features): larger pills, as in the mockup. */
.kl-product-features .kl-features {
	gap: 10px;
}
.kl-product-features .kl-features > span {
	padding: 6px 16px;
	border-color: #6b5d48;
	background: #24211e;
	color: #F4F0E8;
	font-size: 14px;
	line-height: 20px;
}

/* Catalog cards on phones: «Резерв» on its own line under the price. */
@media (max-width: 959px) {
	.kailash-product .kl-label-reserve {
		display: table;
		margin-top: 4px;
	}
}

/* Phones: lower mobile header (80px -> 60px) and category strip (padding 20px -> 12px). */
@media (max-width: 959px) {
	.tm-header-mobile .uk-navbar-item,
	.tm-header-mobile .uk-navbar-toggle,
	.tm-header-mobile .uk-logo {
		min-height: 60px;
	}
	.tm-top.uk-section-xsmall {
		padding-top: 12px;
		padding-bottom: 12px;
	}
}

/* Home page 1: no breadcrumbs in the hero (only «Главная»); pagination pages (body.paged) keep «Главная / Страница N». */
.home:not(.paged) .kl-hero-text .uk-breadcrumb {
	display: none;
}

/* Catalog cards on desktop: «Резерв» on the photo under the labels (kailash-core «Фичи и резерв на фото»), not after the price. */
.kl-photo-reserve {
	margin-top: 6px;
}
@media (min-width: 960px) {
	.kailash-product .woocommerce-Price-amount ~ .kl-label-reserve {
		display: none;
	}
}

/* Catalog toolbar dropbar (SEO page groups): a bit darker than the page so the open list stands out.
   The dropbar opens at the bottom of the toolbar row, so the row's bottom padding is the gap under the group names. */
.kl-seo-nav .uk-dropbar,
.tm-header .uk-navbar-dropbar {
	background: #100f0e;
}
.kl-seo-nav > .uk-grid {
	padding-bottom: 12px;
}

/* Footer section «Обсудим» (.kl-contact, above the Banner on every page): label and messenger icons in one line;
   the portrait stands on the section bottom (no overlap with the previous section: it differs per page). */
.kl-contact .kl-contact-label,
.kl-contact .kl-contact-social {
	display: inline-block;
	vertical-align: middle;
}
.kl-contact .kl-contact-label {
	margin-right: 24px;
}
.kl-contact .kl-contact-portrait img {
	display: block;
	margin: 0 auto;
	max-height: 520px;
	width: auto;
}
@media (min-width: 960px) {
	.kl-contact .kl-contact-portrait {
		margin-top: -100px;
	}
}
@media (max-width: 959px) {
	.kl-contact .kl-contact-portrait img {
		max-height: 380px;
	}
}

/* Messengers in brand colours (.kl-messengers: «Обсудим» buttons and the chat button list), matched by
   aria-label. The footer socials stay plain. */
.kl-messengers a[aria-label="Telegram"] { --kl-brand: #0088cc; --kl-brand-hover: #006c9f; }
.kl-messengers a[aria-label="WeChat"] { --kl-brand: #07c160; --kl-brand-hover: #06a050; }
.kl-messengers a[aria-label="WhatsApp"] { --kl-brand: #25d366; --kl-brand-hover: #1da851; }
.kl-messengers a[aria-label="Viber"] { --kl-brand: #7360f2; --kl-brand-hover: #5c49d0; }
.kl-messengers a[aria-label="Почта"] { --kl-brand: #ea4335; --kl-brand-hover: #c33227; }
.kl-contact-social.kl-messengers a.uk-icon-button {
	width: 44px;
	height: 44px;
	border: none;
	background: var(--kl-brand);
	color: #fff;
}
.kl-contact-social.kl-messengers a.uk-icon-button:hover {
	background: var(--kl-brand-hover);
	color: #fff;
}
.kl-messengers .kl-messenger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-right: 12px;
	border-radius: 50%;
	background: var(--kl-brand);
	color: #fff;
}
.kl-messengers a:hover .kl-messenger-icon {
	background: var(--kl-brand-hover);
}
.kl-messengers .kl-messenger-icon svg {
	width: 18px;
	height: 18px;
}

/* Native select popups (sorting, «Способ связи» at checkout): the site is dark, so the browser draws
   the option list dark too; option colours for browsers that ignore color-scheme. */
select {
	color-scheme: dark;
}
select option {
	background: #191817;
	color: #F4F0E8;
}

/* Long product description collapsed by js/read-more.js: first ~360px with a fade, link «Читать полностью» below. */
.kl-description.kl-collapsed {
	max-height: 360px;
	overflow: hidden;
	mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.kl-read-more {
	display: inline-block;
	margin-top: 15px;
}

/* Product gallery on phones and tablets: edge to edge (container padding 15px, 30px from 640px);
   thumbnails keep the side padding. */
@media (max-width: 959px) {
	.tm-element-woo-images {
		margin-left: -15px;
		margin-right: -15px;
	}
	.woocommerce div.product .tm-element-woo-images .flex-control-thumbs {
		padding: 0 15px;
	}
	.tm-element-woo-images .woocommerce-product-gallery__image img {
		border-radius: 0;
	}
}
@media (min-width: 640px) and (max-width: 959px) {
	.tm-element-woo-images {
		margin-left: -30px;
		margin-right: -30px;
	}
	.woocommerce div.product .tm-element-woo-images .flex-control-thumbs {
		padding: 0 30px;
	}
}

/* Footer section (.kl-footer) on phones and tablets: space under the copyright. */
@media (max-width: 959px) {
	.kl-footer.uk-section {
		padding-bottom: 30px !important; /* the section has uk-padding-remove-bottom */
	}
}

/* Service video in the slideshow of the template «Услуга» (js/service-video.js): whole video, player controls. */
.kl-service-gallery video.kl-service-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
}

/* Footer list of services (column «Сакральные практики»): looks like the footer menus, one line per item. */
.uk-list.kl-footer-list > :nth-child(n+2) { margin-top: 0; }
.kl-footer-list .el-link {
	display: block;
	padding: 5px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Photo placeholder in catalog cards and product carousels: a tinted square with an outline of mountains and the sun until the photo loads
   (YOOtheme reserves the square by width/height of the image, the photo covers the background). */
.kailash-product .uk-inline-clip:has(> picture),
.uk-slider-items .uk-inline-clip:has(> picture) {
	background: rgba(255, 255, 255, 0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg stroke='%23fff' stroke-opacity='0.14' fill='none' stroke-width='2.5' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M8 72L32 44L40 54L56 34L88 72Z'/%3E%3Ccircle cx='74' cy='28' r='7'/%3E%3C/g%3E%3C/svg%3E") center / 30% no-repeat;
}

/* Browser autofill: Chrome and Safari paint a filled field light blue with black text.
   Keep the field's own background (the repaint is delayed by a very long transition) and the site text color. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
	-webkit-text-fill-color: #F4F0E8;
	caret-color: #F4F0E8;
	transition: background-color 600000s 0s, color 600000s 0s;
}
