/*
Theme Name: LuniArt Showcase
Theme URI: https://luniart.ru/
Author: LuniArt
Description: Витринная тема для изделий LuniArt: каталог, галерея, карточки изделий, SEO-разметка и интеграции без изменения плагинов.
Version: 2.0.66
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: luniart-showcase
Requires at least: 6.8
Requires PHP: 8.2
Tested up to: 6.9
*/

/* Accessibility: skip link + visible focus without redesign. */
/* stylelint-disable declaration-no-important -- Legacy overrides. */
@layer foundation, base, layout, components, pages, utilities;

@layer foundation {
.skip-link {
	position: absolute;
	left: 8px;
	top: 8px;
	z-index: 9999;
	padding: 8px 12px;
	border-radius: 10px;
	background: #fff;
	color: #000;
	text-decoration: none;
	transform: translateY(-140%);
	transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
	transform: translateY(0);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 3px;
}

:root {
	--bg: #f6f7fb;
	--surface: #fff;
	--text: #0f172a;
	--muted: #6b7280;
	--line: rgb(15 23 42 / 10%);
	--accent: #2563eb;
	--accent2: #7c3aed;
	--radius: 18px;
	--shadow: 0 18px 45px rgb(15 23 42 / 10%);
	--shadow2: 0 10px 25px rgb(15 23 42 / 8%);
	--max: 1200px;
	--space-xs: 8px;
	--space-sm: 12px;
	--space-md: 16px;
	--space-lg: 24px;
	--space-xl: 32px;

	/* Общий горизонтальный паддинг контейнеров (чтобы хедер = контент) */
	--pad: 24px;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
}

body {
	font-family:
		ui-sans-serif,
		system-ui,
		-apple-system,
		"Segoe UI",
		Roboto,
		Arial,
		"Noto Sans",
		"Liberation Sans",
		sans-serif;
	background:
		radial-gradient(1100px 620px at 15% -10%, rgb(124 58 237 / 10%), transparent 55%),
		radial-gradient(1000px 540px at 110% 0%, rgb(37 99 235 / 10%), transparent 55%),
		var(--bg);
	color: var(--text);
	text-rendering: optimizelegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	line-height: 1.55;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	opacity: 0.95;
}

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

/* Container: align header with blocks below (more breathing space on mobile) */
.container {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 var(--pad);
}

/* Make header/logo align with inner content on small screens */
@media (width <= 560px) {
	:root {
		--pad: 28px;
	}
}

/* Header */

/* Header logo - smaller on desktop, larger on mobile */

/* Mobile: увеличить логотип */

/* Very small screens */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Do not force-highlight CMS current classes; hover owns underline. */

/* Mobile menu (hamburger -> opens panel, no slide-out) */

/* Typography helpers */
.section {
	padding: 30px 0;
}

.section-title {
	margin: 0 0 10px;
	font-size: clamp(22px, 2.4vw, 34px);
	line-height: 1.15;
}

.muted {
	margin: 0 0 14px;
	color: var(--muted);
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 14px;
	border: 1px solid rgb(15 23 42 / 10%);
	background: rgb(255 255 255 / 80%);
	color: rgb(15 23 42 / 92%);
	font-weight: 700;
	cursor: pointer;
}

.btn:not(.btn-primary):hover {
	background: #fff;
	box-shadow: 0 10px 25px rgb(15 23 42 / 8%);
}

.btn-primary {
	border: none;
	background: linear-gradient(135deg, var(--accent), var(--accent2));
	color: #fff;
}

.btn-primary:hover {
	filter: brightness(1.03);
	box-shadow: 0 12px 28px rgb(37 99 235 / 20%);
}

.btn-ghost {
	background: transparent;
}

.btn-mini {
	padding: 8px 12px;
	border-radius: 12px;
	font-weight: 700;
}

/* 404 */
.notfound .nf-card {
	max-width: 860px;
	margin: 0 auto;
	padding: 28px;
	border-radius: calc(var(--radius) + 6px);
	background: rgb(255 255 255 / 82%);
	border: 1px solid rgb(15 23 42 / 8%);
	box-shadow: var(--shadow2);
}

.notfound .nf-title {
	margin: 0;
	font-size: 28px;
	line-height: 1.15;
	font-weight: 900;
}

.notfound .nf-desc {
	margin-top: 0.5rem;
}

.notfound .nf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.notfound .nf-search {
	margin-top: 16px;
	display: flex;
	gap: 12px;
	align-items: center;
}

.notfound .nf-search .f-input {
	flex: 1;
	min-width: 0;
	height: 46px;
}

.notfound .nf-search .btn {
	height: 46px;
	padding: 10px 18px;
	border-radius: 14px;
	white-space: nowrap;
}

.notfound .nf-hint {
	margin-top: 12px;
}

@media (width <= 560px) {
	.notfound .nf-card {
		padding: 18px;
	}

	.notfound .nf-title {
		font-size: 22px;
	}

	.notfound .nf-search {
		flex-direction: column;
		align-items: stretch;
	}

	.notfound .nf-search .btn {
		width: 100%;
	}
}

.f-item {
        min-width: 0;
}

.f-label {
	display: block;
	font-size: 12px;
	color: var(--muted);
	margin: 0 0 6px;
	font-weight: 700;
}

.f-input {
	width: 100%;
	height: 42px;
	padding: 8px 12px;
	border-radius: 14px;
	border: 1px solid rgb(15 23 42 / 10%);
	background: #fff;
	color: var(--text);
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.f-input:focus {
	border-color: rgb(37 99 235 / 35%);
	box-shadow: 0 0 0 4px rgb(37 99 235 / 10%);
}

.f-input:focus-visible {
	outline-color: rgb(37 99 235 / 65%);
}

select.f-input {
	appearance: none;
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: calc(100% - 16px) 50%;
	background-size: 10px 6px;
}

select.f-input::-ms-expand {
	display: none;
}

/* Grid */
.grid {
        display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

/* Status badge */
.badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid rgb(15 23 42 / 8%);
	background: rgb(255 255 255 / 90%);
	color: rgb(15 23 42 / 72%);
}

.badge.in-stock {
	background: rgb(16 185 129 / 10%);
	border-color: rgb(16 185 129 / 20%);
	color: rgb(6 95 70 / 95%);
}

.badge.made-to-order {
	background: rgb(124 58 237 / 10%);
	border-color: rgb(124 58 237 / 20%);
	color: rgb(76 29 149 / 95%);
}

/* Optional global status presentation for product cards. */
body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge,
.gcard .gcard-status .badge-stack--global-media-visual .badge {
	box-sizing: border-box;
	height: 30px;
	min-height: 30px !important;
	padding: 0 11px;
	border: 0 !important;
	border-radius: 8px;
	box-shadow: none !important;
	gap: 7px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge::before,
.gcard .gcard-status .badge-stack--global-media-visual .badge::before {
	content: "";
	display: inline-block !important;
	flex: 0 0 7px;
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: currentcolor;
	box-shadow: none !important;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge::after,
.gcard .gcard-status .badge-stack--global-media-visual .badge::after {
	content: none !important;
	display: none !important;
	box-shadow: none !important;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.in-stock,
.gcard .gcard-status .badge-stack--global-media-visual .badge.in-stock {
	background: rgb(235 250 241 / 94%) !important;
	color: #126b43 !important;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.in-stock::before,
.gcard .gcard-status .badge-stack--global-media-visual .badge.in-stock::before {
	background: #22b86a;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.made-to-order,
.gcard .gcard-status .badge-stack--global-media-visual .badge.made-to-order {
	background: rgb(244 238 252 / 94%) !important;
	color: #51377c !important;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.made-to-order::before,
.gcard .gcard-status .badge-stack--global-media-visual .badge.made-to-order::before {
	background: #8f5de8;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.coming-soon,
.gcard .gcard-status .badge-stack--global-media-visual .badge.coming-soon {
	background: rgb(235 247 253 / 94%) !important;
	color: #23657f !important;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.coming-soon::before,
.gcard .gcard-status .badge-stack--global-media-visual .badge.coming-soon::before {
	background: #43a9d8;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.sold-repeat,
.gcard .gcard-status .badge-stack--global-media-visual .badge.sold-repeat {
	background: rgb(251 246 235 / 94%) !important;
	color: #7a5a20 !important;
}

body.luniart-status-badge-global-visual .gcard .gcard-status .badge-stack .badge.sold-repeat::before,
.gcard .gcard-status .badge-stack--global-media-visual .badge.sold-repeat::before {
	background: #c39a43;
}

/* Collapsible info blocks (Delivery + Payment) */
.info-accordions {
	margin: 18px 0 0;
	width: 100%;
	border-radius: calc(var(--radius) + 6px);
	background: rgb(255 255 255 / 88%);
	border: 1px solid rgb(15 23 42 / 8%);
	box-shadow: var(--shadow2);
	padding: 16px;
}

.info-acc {
	background: rgb(15 23 42 / 2%);
	border: 1px solid rgb(15 23 42 / 6%);
	border-radius: 18px;
	overflow: hidden;
}

.info-acc + .info-acc {
	margin-top: 12px;
}

.info-acc__summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px;
	cursor: pointer;
	user-select: none;
	background: rgb(255 255 255 / 70%);
	transition: background 0.15s ease;
}

.info-acc__summary:hover {
	background: #fff;
}

.info-acc__summary:focus {
	outline: 2px solid rgb(124 58 237 / 35%);
	outline-offset: 2px;
}

.info-acc__summary::-webkit-details-marker {
	display: none;
}

.info-acc__summary::marker {
	content: "";
}

.info-acc__icon {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid rgb(15 23 42 / 6%);
	border-radius: 10px;
}

.info-acc__title {
	font-weight: 700;
}

.info-acc__chev {
	margin-left: auto;
	transition: transform 0.2s ease;
	opacity: 0.7;
}

.info-acc[open] .info-acc__chev {
	transform: rotate(180deg);
}

.info-acc__content {
	padding: 0 14px 14px;
}

.info-acc__content .rte {
	font-size: 14px;
	line-height: 1.6;
}

.info-acc__content .rte h4 {
	margin: 14px 0 8px;
	font-size: 14px;
}

.info-acc__content .rte p {
	margin: 8px 0;
}

.info-acc__content .tg-link {
	color: var(--accent2);
	text-decoration: none;
	text-underline-offset: 2px;
	font-weight: 600;
}

.info-acc__content .tg-link:hover {
	color: var(--accent);
}

.info-acc__content .tg-link:focus-visible {
	outline: 2px solid rgb(124 58 237 / 35%);
	outline-offset: 2px;
	border-radius: 6px;
}

.info-acc__content .rte ul,
.info-acc__content .rte ol {
	margin: 8px 0 8px 20px;
}

.info-acc__content .rte li {
	margin: 6px 0;
}

.info-acc__content .rte a:not(.tg-link),
.content a:not(.tg-link) {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dashed rgb(15 23 42 / 22%);
}

.info-acc__content .rte a:not(.tg-link):hover,
.info-acc__content .rte a:not(.tg-link):focus,
.content a:not(.tg-link):hover,
.content a:not(.tg-link):focus {
	border-bottom-color: rgb(15 23 42 / 40%);
}

/* Ensure Telegram link is visibly clickable even with global link resets */
.info-acc__content .rte a.tg-link {
	color: var(--accent2);
	text-decoration: none;
	text-underline-offset: 2px;
	font-weight: 600;
}

.info-acc__content .rte a.tg-link:hover {
	color: var(--accent);
}

/* ===== Static "Описание" block (non-collapsible) =====
   Make it a solid white card like the characteristics/specs area and
   add spacing so it doesn't stick to the block above.
*/
.info-acc.info-accordions--desc {
	margin-top: 18px;
}

.info-accordions--desc .info-acc--static {
	margin-top: 0;
}

.info-acc--static .info-acc__summary {
	cursor: default;
}

.meta-pill {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgb(15 23 42 / 10%);
	background: #fff;
	font-size: 12px;
	color: rgb(15 23 42 / 78%);
}

.meta-k {
	font-weight: 700;
	color: rgb(15 23 42 / 62%);
}

.meta-v {
	font-weight: 700;
	color: rgb(15 23 42 / 88%);
}

.meta-v a {
	color: inherit;
	text-decoration: none;
	border-bottom: none !important;
}

.meta-v a:hover {
	border-bottom: none !important;
}

.tax-wrap {
	margin-top: 14px;
}

.tax-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 6px 0 10px;
}

.tax-head::before {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, rgb(15 23 42 / 10%), rgb(15 23 42 / 2%));
}

.tax-head span {
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgb(15 23 42 / 55%);
	font-weight: 600;
	white-space: nowrap;
}

.tax {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.tax .tag {
	display: inline-flex;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgb(15 23 42 / 10%);
	background: #fff;
	color: rgb(15 23 42 / 70%);
	font-weight: 600;
	font-size: 12px;
}

.tax .tag a {
	color: inherit;
	text-decoration: none;
}

.tax .tag a:hover {
	text-decoration: none;
}

.sep {
	border: none;
	height: 1px;
	margin: 26px 0;
	background: linear-gradient(90deg, rgb(15 23 42 / 10%), rgb(15 23 42 / 2%), rgb(15 23 42 / 10%));
}

/* Responsive */
@media (width <= 1100px) {
        .grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .grid-related {
                grid-template-columns: repeat(3, minmax(0, 1fr));
        }
}

@media (width <= 720px) {
        .btn {
                width: 100%;
        }

	.grid {
		grid-template-columns: 1fr;
	}

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

@media (width <= 420px) {
        .grid-related {
                grid-template-columns: 1fr;
        }
}

/* === Mobile header spacing + dropdown menu (1.1.8) === */

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}

/* === Filter buttons styled like Telegram CTA === */
.luniart-filters button,
.luniart-filters .btn,
.luniart-filters input[type="submit"] {
	background: linear-gradient(90deg, #3b5cff, #7a3df0);
	color: #fff;
	border: none;
	border-radius: 14px;
	padding: 14px 22px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition:
		transform 0.15s ease,
		box-shadow 0.15s ease,
		opacity 0.15s ease;
	box-shadow: 0 10px 24px rgb(67 82 255 / 25%);
}

.luniart-filters button:hover,
.luniart-filters input[type="submit"]:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 30px rgb(67 82 255 / 35%);
	opacity: 0.95;
}

.luniart-filters button:active,
.luniart-filters input[type="submit"]:active {
	transform: translateY(0);
	box-shadow: 0 8px 18px rgb(67 82 255 / 22%);
}

.luniart-filters .btn-reset {
	background: linear-gradient(90deg, #3b5cff, #7a3df0);
}

/* =========================================================
   Responsive safety pack (no redesign)
   Covers: 320px, tablets, long text, iOS safe-area,
   sticky header + WP admin bar, prevents horizontal scroll
   ========================================================= */

/* WP admin-bar: core already adds html{margin-top:...};
   do NOT shift sticky header, иначе появляется разрыв */

/* Keep anchor jumps compatible with sticky header and admin bar. */
html.admin-bar {
	scroll-padding-top: 32px;
}

@media (width <= 782px) {
	html.admin-bar {
		scroll-padding-top: 46px;
	}
}

/* Keep embedded media from creating accidental mobile overflow. */
img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

/* Long text protection (titles, tags, specs, links) */
.product-title,
.tax .tag {
        overflow-wrap: anywhere;
        word-break: normal;
        hyphens: auto;
}

/* Ultra-small screens (320px): reduce paddings so layout is not "too narrow" */
@media (width <= 360px) {
	:root {
		--pad: 16px;
	}
}

/* Touch targets on mobile */
@media (width <= 520px) {
        .btn {
                min-height: 44px;
        }
}

/* === Safer sticky: avoid breaking by overflow on root === */
html {
	overflow-x: visible;
}

/* stylelint-disable-next-line no-duplicate-selectors -- Root overflow fix. */
body {
	overflow-x: hidden;
}

}
