/* =====================================================================
   PROJECT-9 — дополнительные стили динамических страниц
   (Bootstrap 5 + тема «Долина Хранителей»)
   ===================================================================== */

/* ------------------------------ PAGE HERO ------------------------------ */
.page-hero {
    position: relative;
    padding: 160px 24px 70px;
    text-align: center;
    background: linear-gradient(135deg, var(--violet-deep) 0%, var(--violet-dark) 40%, var(--emerald-dark) 100%);
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 90%, rgba(201, 162, 39, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 10%, rgba(46, 158, 115, 0.22) 0%, transparent 55%);
}
.page-hero > * { position: relative; z-index: 2; }
.page-hero h1 {
    font-size: clamp(34px, 5.5vw, 60px);
    color: var(--gold-light);
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 50px rgba(201, 162, 39, 0.35);
}
.page-hero p {
    color: var(--violet-pale);
    font-size: clamp(14px, 1.6vw, 18px);
    max-width: 720px;
    margin: 0 auto;
}
.page-hero .hero-badge { margin-bottom: 18px; }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(201, 184, 224, 0.75);
}
.breadcrumbs a { color: var(--violet-pale); }
.breadcrumbs a:hover { color: var(--gold-light); }
.breadcrumbs span.sep { opacity: 0.5; }

/* ------------------------------ GRID-ХЕЛПЕРЫ ------------------------------ */
.grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 26px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ------------------------------ HOUSE / CARD ------------------------------ */
.house-card, .product-card, .info-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(26, 11, 46, 0.06);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.house-card:hover, .product-card:hover, .info-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(201, 162, 39, 0.35);
}
.card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--violet-bg);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition-slow); }
.house-card:hover .card-media img,
.product-card:hover .card-media img { transform: scale(1.06); }
.card-media .media-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 76px;
    background: linear-gradient(135deg, var(--violet-bg), var(--emerald-pale));
}
.card-body-flex { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-body-flex h3, .card-body-flex h4 { font-size: 22px; margin: 0; }
.card-body-flex p { font-size: 14px; color: var(--text-mid); margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--violet-bg);
    color: var(--violet-mid);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.chip.gold { background: var(--gold-pale); color: var(--gold-dark); }
.chip.emerald { background: var(--emerald-pale); color: var(--emerald-mid); }
.card-price {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-dark);
}
.card-price.gift { color: var(--emerald-mid); font-size: 20px; }
.card-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.card-actions .btn { padding: 12px 20px; font-size: 12px; }

/* ------------------------------ DETAIL ------------------------------ */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 46px;
    align-items: start;
}
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-media {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--violet-bg);
}
.detail-media img { width: 100%; display: block; }
.detail-media .media-icon { display: flex; align-items: center; justify-content: center; height: 380px; font-size: 120px; }
.detail-body h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 10px; }

.spec-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 22px 0;
}
.spec-item {
    background: var(--violet-bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.spec-item .spec-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 4px;
}
.spec-item .spec-value { font-size: 14px; font-weight: 600; color: var(--violet-dark); }

.info-block { margin-bottom: 20px; }
.info-block .info-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 6px;
}
.info-block p { font-size: 14px; color: var(--text-mid); }
.info-block ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text-mid); }

/* ------------------------------ FILTERS ------------------------------ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}
.filter-bar .shop-cat {
    border: 1px solid rgba(201, 162, 39, 0.35);
    background: transparent;
    color: var(--violet-mid);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
}
.filter-bar .shop-cat:hover { background: var(--gold-pale); color: var(--gold-dark); }
.filter-bar .shop-cat.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-mid));
    color: var(--violet-deep);
    border-color: transparent;
    box-shadow: var(--shadow-gold);
}
.filter-bar.on-dark .shop-cat { color: var(--violet-pale); border-color: rgba(201, 162, 39, 0.4); }

/* ------------------------------ ALERTS ------------------------------ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}
.alert-success { background: var(--emerald-pale); color: var(--emerald-dark); border-left-color: var(--emerald-mid); }
.alert-error   { background: #fdeaea; color: #8a1f1f; border-left-color: #c0392b; }
.alert-info    { background: var(--violet-bg); color: var(--violet-dark); border-left-color: var(--violet-mid); }

/* ------------------------------ EMPTY / PAGER ------------------------------ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 22px;
}
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(74, 45, 122, 0.2);
    color: var(--violet-mid);
    font-size: 14px;
    transition: var(--transition);
}
.pager a:hover { background: var(--gold-pale); border-color: var(--gold-mid); }
.pager .current { background: linear-gradient(135deg, var(--gold-dark), var(--gold-mid)); color: var(--violet-deep); border-color: transparent; }

/* ------------------------------ STARS ------------------------------ */
.stars { color: var(--gold-mid); letter-spacing: 3px; font-size: 15px; }

/* ------------------------------ STATS ------------------------------ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 22px; }
.stat-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}
.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
}
.stat-card .stat-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--violet-pale); margin-top: 8px; }

/* ------------------------------ ФОРМЫ ------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label {
    display: block;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 6px;
}
.field input, .field select, .field textarea, .inline-form input, .inline-form select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid rgba(74, 45, 122, 0.18);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--gold-mid);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}
.field textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: 12px; color: var(--text-light); }
.form-msg { display: none; margin-top: 14px; }
.form-msg.show { display: block; }

/* Кнопка-«призрак» */
.btn-ghost {
    background: transparent;
    color: var(--violet-mid);
    border: 1px solid rgba(74, 45, 122, 0.25);
}
.btn-ghost:hover { background: var(--violet-bg); color: var(--violet-dark); }
.btn-sm { padding: 10px 18px; font-size: 12px; }

/* ------------------------------ Табы ------------------------------ */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tabs button {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 4px;
    margin-right: 14px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.tabs button.active { color: var(--violet-dark); border-bottom-color: var(--gold-mid); }

/* ------------------------------ Таймлайн ------------------------------ */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--gold-mid), var(--emerald-light));
}
.timeline-item { position: relative; margin-bottom: 26px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold-mid);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2);
}
.timeline-item h4 { margin-bottom: 4px; }
.timeline-item p { font-size: 14px; color: var(--text-mid); }

/* ------------------------------ Заглушка Bootstrap ------------------------------ */
.container > .row { --bs-gutter-x: 0; }
.section .container-fluid { padding: 0; }

/* Карточка-цитата */
.quote-card {
    background: linear-gradient(135deg, var(--violet-deep), var(--violet-dark));
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    color: var(--violet-pale);
}
.quote-card p {
    font-family: var(--font-heading);
    font-size: clamp(20px, 2.4vw, 28px);
    font-style: italic;
    color: var(--gold-light);
    margin-bottom: 12px;
}
.quote-card .quote-author { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--violet-pale); }

/* Адаптив */
@media (max-width: 768px) {
    .page-hero { padding: 130px 18px 54px; }
    .detail-layout { gap: 28px; }
    .grid-2, .grid-3, .grid-4 { gap: 18px; }
}
/* ------------------------ Bootstrap dropdown в шапке ------------------------ */
.nav .dropdown { position: relative; display: flex; align-items: center; }
.nav .dropdown-toggle::after {
    display: inline-block;
    margin-left: 6px;
    vertical-align: 2px;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-left: .3em solid transparent;
    opacity: .7;
}
.nav .dropdown-menu {
    background: rgba(26, 11, 46, 0.98);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: var(--radius-md);
    padding: 8px;
    margin-top: 12px;
    min-width: 210px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}
.nav .dropdown-item {
    color: var(--violet-pale);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
}
.nav .dropdown-item:hover, .nav .dropdown-item:focus {
    background: rgba(201, 162, 39, 0.12);
    color: var(--gold-light);
}
.hero-tile { text-decoration: none; }
a.hero-tile, button.hero-tile { cursor: pointer; }
.btn.is-loading { opacity: .75; pointer-events: none; }
.footer-subscribe { position: relative; }
.footer-subscribe + .form-msg { margin-top: 10px; font-size: 12px; }
.footer-subscribe + .form-msg.alert { padding: 10px 14px; }
/* =====================================================================
   КНОПКА «НАВЕРХ»
   Круглая кнопка с кольцом прогресса прокрутки, появляется после 400px.
   ===================================================================== */
.scroll-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 900;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--violet-mid), var(--violet-dark));
    color: var(--gold-bright);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s ease, box-shadow 0.3s ease;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-top:hover,
.scroll-top:focus-visible {
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    transform: translateY(-3px) scale(1.05);
}

.scroll-top:focus-visible {
    outline: 3px solid var(--gold-mid);
    outline-offset: 3px;
}

.scroll-top:active {
    transform: translateY(-1px) scale(0.97);
}

.scroll-top-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    grid-area: 1 / 1;
    transition: var(--transition);
}

.scroll-top:hover .scroll-top-icon {
    transform: translateY(-2px);
}

/* Кольцо прогресса прокрутки */
.scroll-top-ring {
    grid-area: 1 / 1;
    width: 52px;
    height: 52px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.scroll-top-ring circle {
    fill: none;
    stroke-width: 2.5;
}

.scroll-top-ring-track {
    stroke: rgba(255, 255, 255, 0.12);
}

.scroll-top-ring-bar {
    stroke: var(--gold-light);
    stroke-linecap: round;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 125.66;
    transition: stroke-dashoffset 0.1s linear;
}

@media (max-width: 576px) {
    .scroll-top {
        right: 16px;
        bottom: 16px;
        width: 46px;
        height: 46px;
    }

    .scroll-top-ring {
        width: 46px;
        height: 46px;
    }

    .scroll-top-icon {
        width: 21px;
        height: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-top,
    .scroll-top:hover,
    .scroll-top:focus-visible,
    .scroll-top:active {
        transition: opacity 0.2s ease, visibility 0.2s ease;
        transform: none;
    }

    .scroll-top.visible {
        transform: none;
    }
}
/* =====================================================================
   КЛАВИАТУРНАЯ ДОСТУПНОСТЬ ФОРМ
   Тема гасит outline при фокусе, заменяя его сменой цвета рамки — для
   мыши это красиво, но при навигации по Tab такого сигнала мало.
   Возвращаем заметное золотое кольцо через :focus-visible: оно
   появляется только при работе с клавиатуры, клик мышью его не показывает.
   ===================================================================== */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--gold-mid);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.18);
}

.btn:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--gold-mid);
    outline-offset: 3px;
}

a:focus-visible,
.shop-cat:focus-visible {
    outline: 2px solid var(--gold-mid);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* На тёмных секциях (контакты, подвал, модальные окна) золото поглубже
   читается хуже — берём светлый оттенок. */
.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.footer-subscribe input:focus-visible,
.modal form input:focus-visible,
.modal form select:focus-visible,
.modal form textarea:focus-visible {
    outline-color: var(--gold-bright);
    box-shadow: 0 0 0 4px rgba(245, 215, 110, 0.22);
}
/* =====================================================================
   АКТИВНЫЙ ПУНКТ МОБИЛЬНОГО МЕНЮ
   Скролл-спай подсвечивает текущую секцию и в `.nav`, и в `.mobile-nav`,
   но для второго оформления не было.
   ===================================================================== */
.mobile-nav a.active {
    color: var(--gold-light);
    background: rgba(201, 162, 39, 0.15);
}