/* =============================================
   ПЕРЕИСПОЛЬЗУЕМЫЕ КОМПОНЕНТЫ
   ============================================= */

/* ---- Хлебные крошки ---- */

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumbs__link { color: var(--text-muted); }
.breadcrumbs__link:hover { color: var(--text-main); }
.breadcrumbs__sep { opacity: 0.6; }
.breadcrumbs__current { color: var(--text-main); font-weight: 500; }

/* ---- Заголовок секции с мазком ---- */

.heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 40px;
}

.heading--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.heading--center .heading__text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.heading__title {
    position: relative;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
    margin: 0 auto;
    width: 100%;
    max-width: max-content;
}

.heading__title span {
    position: relative;
    z-index: 2;
}

.heading__paint {
    position: absolute;
    right: 0;
    top: 0.1em;
    height: auto;
    z-index: 1;
    pointer-events: none;
    width: 100%;
}

.heading__paint--ultrashort  { width: 237px; max-width: 237px !important; right: 50%; transform: translate3d(50%, -50%, 0); top: 50% !important; }
.heading__paint--medium { max-width: 362px;  }
.heading__paint--medium { max-width: 378px;  }
.heading__paint--long   { max-width: 753px; }

.heading__subtitle {
    margin-top: 12px;
    max-width: 680px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
}

.heading--light .heading__title { color: #fff; }
.heading--light .heading__subtitle { color: rgba(255, 255, 255, 0.7); }

/* ---- Стрелки слайдера ---- */

.section-line {
    position: absolute;
    left: 0;
    top: -1px;
    width: clamp(204px, -235.85px + 115.75vw, 1430px);
    height: 2px;
    background-color: var(--accent);
    z-index: 3;
}

.section-line::before {
    display: block;
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
}

.section-line--reverse {
    left: initial;
    right: 0;
}

.section-line--reverse::before {
    right: initial;
    left: -4px;
}

.section-line--short {
    width: clamp(204px, -78.6px + 74.37vw, 993px);
}

.heading__arrows {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

.heading__arrow {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.heading__arrow:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.heading__arrow:hover > svg path {
	stroke: #fff;
}

.heading__arrow.swiper-button-disabled {
    opacity: 0.4;
    cursor: default;
}

.heading__arrow.swiper-button-disabled:hover {
    background: #fff;
    border-color: var(--border);
    color: var(--text-main);
}

/* ---- Заголовок с левой границей (блоки слайдеров) ---- */

.heading--bordered {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    align-items: center;
}

.heading--bordered .heading__title {
	margin: initial;
}

@media (max-width: 768px) {
    .heading--bordered .heading__arrows { display: none; }
    .heading--bordered {
        padding-left: 6px;
    }
}

/* ---- Карточка товара ---- */

.card-product {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    box-shadow: 0px 3px 10px 0px #0000001A;

    border-radius: 6px;
    overflow: hidden;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.card-product:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }

.card-product__image {
    display: block;
    aspect-ratio: 1 / 1;
    border: 2px solid #F9F7F9;
}

.card-product__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-product__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    margin-top: 10px;
}

.card-product__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

.card-product__title:hover { color: var(--accent); }

.card-product__price-wrap { margin-top: auto; }

.card-product__price-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.card-product__price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.card-product__btn { width: 100%; height: 44px; }

/* ---- Карточка объекта (кейс) ---- */

.card-case {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-bottom: 2px solid #F4B042;
    border-radius:6px;
    overflow: hidden;
    box-shadow: 0px 3px 10px 0px #0000001A;

}

.card-case__image {
    display: block;
    height: 250px;
    width: 100%;
    background: var(--graphite-pale);
}

.card-case__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-case__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    flex: 1;
}

.card-case__title { font-size: 20px; font-weight: 600; color: var(--text-main); }

.card-case__desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; flex: 1; }

.card-case__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.card-case__footer:not(:has(.card-case__term)) {
    flex-direction: row-reverse;
}

.card-case__term {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--accent);
}

.card-case__term-icon { color: var(--accent); flex-shrink: 0; }

.card-case__link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.card-case__link:hover { color: var(--accent); }

/* ---- Инпуты (для всех форм) ---- */

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.input-label { font-size: 13px; }
.input-req { color: var(--accent); margin-left: 2px; }

.input-text {
    width: 100%;
    min-height: 50px;
    padding: 15px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    font-size: 15px;
    transition: border-color 0.2s;
}

.input-text::placeholder { color: var(--text-muted); }
.input-text:focus { border-color: var(--accent); }

.input-textarea {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
}

.input-text--error { border-color: #E03131; }
.input-error-message { color: #E03131; font-size: 13px; }

/* ---- Чекбокс (для всех форм) ---- */

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
}

.checkbox__input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.checkbox__box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox__box svg { opacity: 0; transition: opacity 0.2s; }

.checkbox__input:checked + .checkbox__box {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox__input:checked + .checkbox__box svg { opacity: 1; }

.checkbox__input:focus-visible + .checkbox__box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.checkbox--error .checkbox__box { border-color: #E03131; }

/* ---- Форма ---- */

.form { display: flex; flex-direction: column; gap: 16px; }
.form__row { display: flex; gap: 16px; }
.form__submit { height: 52px; padding: 0 32px; }
.form__error { color: #E03131; font-size: 13px; }

/* ---- Слайдер: равная высота слайдов ---- */

.js-slider .swiper-slide { height: auto; }

@media (max-width: 768px) {
    .heading { margin-bottom: 28px; }
    .heading__title { font-size: 26px; }
    .form__row { flex-direction: column; }
}

/* ---- Реусабельный интро-блок (gradient bg) ---- */

.section-intro {
    padding: 40px 0 48px;
    background: var(--bg-grad);
}

/* ---- Пагинация ---- */

.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination__list {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination__item a,
.pagination__item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    background: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    text-decoration: none;
}

.pagination__item a:hover { background: var(--graphite-pale); }

.pagination__item .current {
    background: var(--accent);
    color: var(--text-main);
}

.pagination__item .prev,
.pagination__item .next { font-size: 0; }

/* ---- Сетка категорий товаров ---- */
/* Используется на странице каталога (template-catalog.php)
   и во flexible-блоке «Каталог» на страницах услуг. */

.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.cat-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }

.cat-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius:6px;
    overflow: hidden;
    text-decoration: none;
    background-color: #F5F7FA;
    transition: box-shadow 0.2s;
    box-shadow: 0px 3px 10px 0px #0000001A;

}

.cat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cat-card__image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
}

.cat-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 20px;
}

.cat-card__title {
    padding: 10px 20px 20px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    line-height: 1.3;
}

.catalog-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    padding: 40px 0;
}

@media (max-width: 1080px) {
    .cat-grid,
    .cat-grid--cols-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
    .cat-grid,
    .cat-grid--cols-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cat-card__title { font-size: 13px; padding: 10px 12px; }
}

/* ---- Модальное окно галереи ---- */

.modal-gallery {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}

.modal-gallery:not([aria-hidden="true"]) {
    pointer-events: all;
    opacity: 1;
}

.modal-gallery__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}

.modal-gallery__close:hover { background: rgba(255, 255, 255, 0.25); }

.modal-gallery__counter {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2;
}

.modal-gallery__swiper {
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    padding: 0 60px;
    z-index: 1;
}

.modal-gallery__swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-gallery__swiper img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-gallery .swiper-button-prev::after,
.modal-gallery .swiper-button-next::after {
    color: #fff;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 768px) {
    .section-intro { padding: 28px 0 36px; }
    .modal-gallery__swiper { padding: 0 40px; }

    .heading__paint {
        top: 8px;
    }
}

/* ---- Утилиты ---- */
.is-hidden { display: none !important; }

/* ---- Состояния кнопки «В корзину» ---- */

.btn--disabled {
    background: var(--graphite-light);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--graphite-light);
}

.btn--in-cart {
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    cursor: default;
}

.btn--in-cart:hover {
    background: #fff;
    color: var(--accent);
}
