/*
Theme Name: Гранитная мастерская
Theme URI: https://example.com/
Author: Гранитная мастерская
Description: Тема для сайта гранитной мастерской (Феодосия): каталог изделий без WooCommerce, карточки товаров с галереей и ценой, заявки, мессенджеры, встроенная SEO-оптимизация и микроразметка.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: granit-masterskaya
*/

/* ==========================================================================
   Токены
   ========================================================================== */
:root {
	--bg: #e7eae9;
	--paper: #f3f5f4;
	--stone: #c9d0d0;
	--ink: #1e272b;
	--muted: #4f5e65;
	--accent: #8a3a33;
	--accent-dark: #6f2d27;
	--slab: #2a3337;
	--slab-text: #c8d0d1;
	--line: rgba(30, 39, 43, .2);
	--focus: #1d5b78;
	--font-display: 'Forum', 'Times New Roman', serif;
	--font-body: 'Golos Text', 'Segoe UI', Arial, sans-serif;
	--wrap: 1160px;
	--gap: clamp(16px, 4vw, 32px);
}

/* ==========================================================================
   База
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 1.0625rem/1.6 var(--font-body);
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed !important; left: 8px; top: 8px; z-index: 100; width: auto; height: auto; margin: 0;
	clip: auto; padding: 12px 16px; background: var(--ink); color: #fff;
}

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }

/* ==========================================================================
   Кнопки и формы
   ========================================================================== */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 48px; padding: .6em 1.4em; border: 1px solid transparent; border-radius: 2px;
	font: 500 1rem/1.2 var(--font-body); text-decoration: none; text-align: center; cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); color: #fff; }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--light { border-color: var(--slab-text); color: #eef2f2; background: transparent; }
.btn--light:hover { background: #eef2f2; color: var(--slab); }
.btn--small { min-height: 40px; padding: .4em 1em; font-size: .95rem; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 4px; font-size: .95rem; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="email"], input[type="search"], select, textarea {
	width: 100%; min-height: 48px; padding: .6em .8em; border: 1px solid #7f8c91; border-radius: 2px;
	background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; font-size: .92rem; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.search-form { display: flex; gap: 8px; max-width: 520px; margin: 16px 0; }
.search-form input { flex: 1; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand .custom-logo { max-height: 52px; width: auto; }
.brand__link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--slab); }
.brand__link:hover { color: var(--slab); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font: 400 1.35rem/1.1 var(--font-display); color: var(--ink); }
.brand__city { font-size: .85rem; color: var(--muted); }

.nav-toggle { display: none; width: 48px; height: 48px; border: 1px solid var(--line); background: transparent; border-radius: 2px; cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 22px; height: 2px; background: var(--ink); margin: auto; position: relative; transition: transform .2s;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }
.nav__list a { text-decoration: none; padding: 8px 0; display: inline-block; }
.nav__list .current-menu-item > a, .nav__list a:hover { color: var(--accent); }
.nav__contact { display: flex; align-items: center; gap: 14px; }
.nav__phone { font-weight: 600; text-decoration: none; white-space: nowrap; }

@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 8px; padding: 12px var(--gap) 24px;
		background: var(--bg); border-bottom: 1px solid var(--line);
	}
	.nav.is-open { display: flex; }
	.nav__list { flex-direction: column; gap: 0; }
	.nav__list a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
	.nav__contact { flex-direction: column; align-items: stretch; margin-top: 12px; }
	.nav__phone { font-size: 1.25rem; padding: 8px 0; }
}

/* ==========================================================================
   Секции
   ========================================================================== */
.section { padding: clamp(40px, 7vw, 88px) 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section__head h2 { margin: 0; }
.more { font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: .3em; }
.meta { color: var(--muted); font-size: .95rem; }
.notice { padding: 20px; border: 1px dashed #7f8c91; color: var(--muted); }

.crumbs { margin-bottom: 20px; font-size: .92rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: '/'; margin: 0 .6em; color: #8d999d; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ==========================================================================
   Каталог
   ========================================================================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.chips a {
	display: inline-block; padding: .45em 1em; border: 1px solid var(--line); border-radius: 999px;
	text-decoration: none; background: var(--paper); min-height: 40px; line-height: 1.6;
}
.chips a:hover { border-color: var(--ink); color: var(--ink); }
.chips a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 32px; }
.filters .field { margin: 0; min-width: 190px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 40px 24px; }

.item { display: flex; flex-direction: column; }
.item__img { display: block; aspect-ratio: 4 / 3; background: var(--stone); overflow: hidden; border-radius: 2px; }
.item__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.item:hover .item__img img { transform: scale(1.03); }
.item__body { padding-top: 14px; }
.item__cat { margin: 0 0 2px; font-size: .88rem; color: var(--muted); }
.item__title { margin: 0 0 4px; font-size: 1.4rem; }
.item__title a { text-decoration: none; }
.item__title a:hover { color: var(--accent); }
.item__size { margin: 0; font-size: .95rem; color: var(--muted); }
.item__price { margin: 8px 0 0; font-weight: 600; font-size: 1.1rem; }

.catalog-cta { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }

.navigation.pagination { margin-top: 40px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); text-decoration: none; background: var(--paper); }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ==========================================================================
   Карточка изделия
   ========================================================================== */
.product__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .product__grid { grid-template-columns: 1fr; } }

.gallery__main { aspect-ratio: 4 / 3; background: var(--stone); overflow: hidden; border-radius: 2px; }
.gallery__img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.gallery__thumbs button { display: block; width: 100%; padding: 0; border: 2px solid transparent; background: var(--stone); cursor: pointer; aspect-ratio: 1; overflow: hidden; border-radius: 2px; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--ink); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product__price { font: 400 2rem/1.1 var(--font-display); margin: 0 0 20px; }
.specs { margin: 0 0 24px; border-top: 1px solid var(--line); }
.specs > div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs dt { flex: 0 0 110px; color: var(--muted); }
.specs dd { margin: 0; }
.product__note { margin-top: 16px; font-size: .95rem; color: var(--muted); }

.product__desc, .product__order, .product__related { margin-top: clamp(40px, 6vw, 72px); }
.product__order { max-width: 560px; }
.product__related h2, .product__desc h2 { margin-bottom: 20px; }

/* ==========================================================================
   Акции, шаги, контакты
   ========================================================================== */
.promos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.promo { padding: 28px; background: var(--bg); border: 1px solid var(--line); border-radius: 2px; }
.promo h3 { margin-bottom: .4em; }
.promo p { margin: 0; color: var(--muted); }

.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .contacts { grid-template-columns: 1fr; } }
.info { margin: 0 0 20px; }
.info dt { color: var(--muted); font-size: .92rem; margin-top: 14px; }
.info dd { margin: 0; font-size: 1.1rem; }
.info dd a { font-size: .95rem; margin-left: .4em; }
.info dd a:first-child { margin-left: 0; font-size: inherit; }
.messengers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.lead__title { margin-bottom: 16px; }
.lead__msg { padding: 12px 14px; margin-bottom: 16px; border-radius: 2px; }
.lead__msg--ok { background: #dcebdc; color: #1c3d20; }
.lead__msg--err { background: #f2dcd9; color: #5a1c16; }

.map { margin-top: clamp(32px, 5vw, 56px); border: 1px solid var(--line); background: var(--stone); }
.map iframe { display: block; border: 0; width: 100%; height: 380px; }

/* ==========================================================================
   Текстовые страницы, записи
   ========================================================================== */
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose img { border-radius: 2px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .9rem; color: var(--muted); }
.post-thumb { margin-bottom: 24px; }
.posts { display: grid; gap: 32px; }

/* ==========================================================================
   Подвал и нижняя панель на телефоне
   ========================================================================== */
.site-footer { background: var(--slab); color: #cdd5d6; padding: clamp(32px, 5vw, 56px) 0 24px; }
.site-footer a { color: #eef2f2; }
.site-footer a:hover { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__name { font: 400 1.5rem/1.2 var(--font-display); color: #eef2f2; margin-bottom: 8px; }
.site-footer address { font-style: normal; }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.footer-menu li + li { margin-top: 6px; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(200, 208, 209, .2); font-size: .9rem; color: #98a5a8; }
.site-footer__bottom p { margin: 0; }

.dock { display: none; }
@media (max-width: 760px) {
	body { padding-bottom: 72px; }
	.dock {
		display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
		background: var(--bg); border-top: 1px solid var(--line);
	}
	.dock .btn { flex: 1; }
	html { scroll-padding-top: 76px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
