/* ErgoCraft — доповнення для WordPress / WooCommerce (основні стилі — style.css) */

/* адмін-бар не перекриває sticky-хедер */
.admin-bar .header { top: 32px; }
@media (max-width: 782px) { .admin-bar .header { top: 46px; } }

.mega__col-title { display: block; color: inherit; text-decoration: none; }

/* пошук у хедері */
.header-search { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: #fff; border-top: 1px solid rgba(33, 37, 41, .1); box-shadow: 0 20px 40px rgba(0, 0, 0, .08); }
.header-search[hidden] { display: none; }
.header-search__inner { display: flex; align-items: center; gap: 14rem; height: 72rem; }
.header-search__inner > .icon { width: 22rem; height: 22rem; flex: none; }
.header-search__input { flex: 1; height: 100%; border: 0; outline: 0; background: none; font: 400 18rem/1.2 Inter, sans-serif; }
.header-search__close { display: flex; padding: 6rem; background: none; border: 0; cursor: pointer; }
.header-search__close .icon { width: 22rem; height: 22rem; }

/* повідомлення форм */
.form-note { margin: 12rem 0 0; font-size: 14rem; }
.form-note--ok { color: #3c7a4a; }
.form-note--error { color: #b3261e; }
.empty-note { padding: 40rem 0; font-size: 16rem; opacity: .7; }

/* хлібні крихти + повідомлення Woo */
.page-head__text { max-width: 720rem; margin-top: 12rem; font-size: 15rem; line-height: 1.6; opacity: .8; }
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-notices-wrapper { margin: 16rem 0; }
[role="alert"]:focus, [role="alert"]:focus-visible { outline: none; }

/* інлайн-плашки (помилки, інфо, повідомлення без JS) */
.woocommerce-message, .woocommerce-error, .woocommerce-info {
	position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6rem 16rem;
	margin: 0 0 12rem; padding: 16rem 20rem 16rem 54rem; list-style: none;
	font-size: 14rem; line-height: 1.5; color: #212529;
	background: #F6F6F3; border: 0; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(33, 37, 41, .06);
}
.woocommerce-message::before, .woocommerce-error::before, .woocommerce-info::before {
	content: ""; position: absolute; left: 18rem; top: 15rem; width: 22rem; height: 22rem; border-radius: 50%;
	background: #796F51 center / 12rem no-repeat;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.woocommerce-info::before { background-color: #212529; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 5.2v3.6M6 3.2v.1' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.woocommerce-error { background: #FBF1EC; box-shadow: inset 0 0 0 1px rgba(215, 79, 14, .18); flex-direction: column; align-items: flex-start; }
.woocommerce-error::before { background-color: #D74F0E; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 3.2v3.6M6 8.7v.1' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.woocommerce-error li + li { margin-top: 4rem; }
.woocommerce-message .button, .woocommerce-info .button, .woocommerce-error .button {
	order: 2; margin-left: auto; min-height: 0; padding: 0; background: none; border: 0;
	font: 600 12rem/1.4 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #212529;
	text-decoration: underline; text-underline-offset: 4px;
}
.woocommerce-message .button:hover, .woocommerce-info .button:hover { background: none; color: #796F51; }
.sys-hero .woocommerce-message, .module-hero .woocommerce-message { color: #212529; }

/* тост «додано в кошик» */
.ec-toasts { position: fixed; z-index: 1000; right: 24rem; top: calc(var(--header-h, 120px) + 16rem); display: grid; gap: 10rem; width: 380rem; max-width: calc(100vw - 32px); pointer-events: none; }
.ec-toast {
	position: relative; display: flex; gap: 14rem; align-items: center; padding: 14rem 44rem 14rem 14rem;
	background: #fff; color: #212529; box-shadow: 0 18px 50px rgba(28, 26, 24, .16), 0 0 0 1px rgba(33, 37, 41, .06);
	overflow: hidden; pointer-events: auto;
	transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .4s;
}
.ec-toast.is-in { transform: none; opacity: 1; }
.ec-toast.is-out { transform: translateX(calc(100% + 40px)); opacity: 0; }
.ec-toast__media { flex: none; width: 64rem; height: 64rem; background: #F6F6F3; overflow: hidden; }
.ec-toast__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-toast__icon { flex: none; display: grid; place-items: center; width: 40rem; height: 40rem; border-radius: 50%; background: #796F51; color: #fff; }
.ec-toast__icon svg { width: 16rem; height: 16rem; }
.ec-toast__body { min-width: 0; }
.ec-toast__label { margin: 0 0 3rem; font: 600 10rem/1.3 Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #796F51; }
.ec-toast__text { margin: 0; font-size: 14rem; line-height: 1.4; }
.ec-toast__link { display: inline-flex; align-items: center; gap: 6rem; margin-top: 8rem; font: 600 11rem/1.3 Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #212529; text-decoration: underline; text-underline-offset: 4px; }
.ec-toast__link:hover { color: #796F51; }
.ec-toast__close { position: absolute; top: 10rem; right: 10rem; display: grid; place-items: center; width: 26rem; height: 26rem; padding: 0; background: none; border: 0; color: #212529; opacity: .5; cursor: pointer; }
.ec-toast__close:hover { opacity: 1; }
.ec-toast__close .icon { width: 16rem; height: 16rem; }
.ec-toast__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: #796F51; transform-origin: left; animation: ec-toast-bar var(--toast-time, 6s) linear forwards; }
.ec-toast:hover .ec-toast__bar { animation-play-state: paused; }
@keyframes ec-toast-bar { to { transform: scaleX(0); } }
@media (max-width: 767px) {
	.ec-toasts { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; max-width: none; }
	.ec-toast { transform: translateY(calc(100% + 40px)); }
	.ec-toast.is-out { transform: translateY(calc(100% + 40px)); }
	.ec-toast.is-in { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .ec-toast { transition: opacity .2s; transform: none; } .ec-toast__bar { animation: none; } }

/* варіативний звичайний товар */
.add-to-cart { flex-wrap: wrap; }
.add-to-cart__options { flex: 0 0 100%; display: grid; gap: 18rem; margin-bottom: 8rem; }
.add-to-cart__label { margin: 0 0 8rem; font: 600 11rem/1.3 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.add-to-cart [type="submit"]:disabled, .sys-btn:disabled { opacity: .45; cursor: not-allowed; }
.product__stock { font-weight: 600; color: #b3261e; }

/* конфігурація системи: кнопки під картками */
.sys-config__actions { display: flex; flex-wrap: wrap; gap: 12rem; margin-top: 30rem; }
button.sys-btn { border: 0; cursor: pointer; font-family: inherit; }
.sys-hero .sys-btn--ghost { border: 1px solid currentColor; }

/* бренд без логотипа */
.brand-card__name { font: 600 22rem/1.1 Inter, sans-serif; letter-spacing: .02em; }

/* пагінація: «назад» */
.pagination__prev .icon, .pagination__next .icon { width: 18rem; height: 18rem; }
.pagination__dots { pointer-events: none; }

/* звичайні сторінки (кошик, чекаут, політики) */
.wc-page .account__inner { display: block; }
.entry-content { font-size: 16rem; line-height: 1.7; }
.entry-content > * + * { margin-top: 1em; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; line-height: 1.2; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content ul, .entry-content ol { padding-left: 1.2em; }

/* сторінка запису (Stories) */
.story__inner { max-width: 880rem; }
.story__cat { font: 600 11rem/1.3 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.story__title { margin: 12rem 0; font: 500 44rem/1.1 Inter, sans-serif; }
.story__date { font-size: 14rem; opacity: .6; }
.story__media { margin: 30rem 0; }
.story__media img { width: 100%; height: auto; display: block; }
@media (max-width: 767px) { .story__title { font-size: 30px; } }

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

/* модуль: фото з медіатеки замість SVG-рендера */
.module-gallery__slide img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.module-gallery__slide:has(img) { padding: 0; }
.module-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.entry-content .woocommerce-message, .entry-content .woocommerce-error, .entry-content .woocommerce-info { padding-left: 54rem; }
.entry-content > .woocommerce-notices-wrapper + *, .entry-content > * + .woocommerce-notices-wrapper { margin-top: 0; }
