/* ===== Шапка ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 14px 0;
    background: #fff;
    /* фон на всю ширину окна, хотя .page имеет боковые отступы */
    box-shadow: 0 0 0 100vmax #fff;
    clip-path: inset(0 -100vmax);
    border-bottom: 1px solid var(--border);
}
.nav-logo { display: block; flex: none; }
.nav-logo img { display: block; height: 64px; width: auto; }

.nav-menu { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* «Каталог» — единственный акцент в шапке */
.nav-links a.nav-cta {
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.nav-links a.nav-cta:hover { background: var(--accent); color: #fff; }
.nav-links a.nav-cta[aria-current="page"] { box-shadow: 0 0 0 3px var(--border); }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-phone {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--ink); text-decoration: none;
    font-weight: 700; font-size: 16px; white-space: nowrap;
}
.nav-icon { display: inline-flex; color: var(--ink); }
.nav-phone:hover, .nav-icon:hover { color: var(--accent); }
.nav a:focus-visible, .nav-burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Бургер и скрытый чекбокс: на десктопе не нужны */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; }

/* Узкий ноутбук: телефон остаётся только иконкой */
@media (max-width: 1100px) {
    .nav-phone-text { display: none; }
}

/* Телефон и планшет */
@media (max-width: 800px) {
    .nav { flex-wrap: wrap; gap: 0 16px; padding: 10px 0; }
    .nav-logo img { height: 48px; }
    .nav-actions { order: 2; margin-left: auto; }
    .nav-menu { order: 3; flex-basis: 100%; display: none; padding: 12px 0 8px; }
    .nav-toggle:checked ~ .nav-menu { display: block; }
    .nav-links { flex-direction: column; align-items: stretch; gap: 4px; }
    .nav-links a { display: block; padding: 12px 4px; font-size: 18px; }
    .nav-links a.nav-cta { text-align: center; margin-top: 8px; }

    .nav-burger {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; cursor: pointer;
    }
    .nav-burger span,
    .nav-burger span::before,
    .nav-burger span::after {
        display: block; width: 22px; height: 2px;
        background: var(--ink); border-radius: 2px;
        transition: transform 0.2s ease, background 0.2s ease;
    }
    .nav-burger span { position: relative; }
    .nav-burger span::before, .nav-burger span::after { content: ""; position: absolute; left: 0; }
    .nav-burger span::before { top: -7px; }
    .nav-burger span::after { top: 7px; }
    .nav-toggle:checked ~ .nav-actions .nav-burger span { background: transparent; }
    .nav-toggle:checked ~ .nav-actions .nav-burger span::before { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked ~ .nav-actions .nav-burger span::after { transform: translateY(-7px) rotate(-45deg); }
    .nav-toggle:focus-visible ~ .nav-actions .nav-burger { outline: 2px solid var(--accent); border-radius: 8px; }
}

:root {
    --ink: #1D1B19;
    --ink-muted: #6E6A64;
    --accent: #57534C;
    --accent-light: #A8927A;
    --border: #DDD9D2;
    --card-dark-1: #2B2823;
    --card-dark-2: #171512;
}

* { box-sizing: border-box; }

.btn-primary {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.btn-secondary {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 999px;
    background: #EEF1F0;
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
}

.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    background: #EEF1F0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pill input:checked + span { background: var(--accent); color: white; }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

html, body { overflow-x: hidden; overflow-x: clip; }

.product-card, .product-tile { position: relative; }
/* === Карточка товара: единый источник правил для каталога и блока «Часто берут» === */
.product-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: white;
}

.product-photo {
    position: relative;      /* якорь для absolute img */
    flex: none;              /* не растимся и не ужимаемся под контент */
    width: 100%;
    aspect-ratio: 4 / 3;     /* жёсткая высота от ширины */
    min-height: 0;           /* снимаем min-height: auto у flex-элемента */
    overflow: hidden;        /* страховка от «вылезающего» контента */
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.product-photo img {
    position: absolute;      /* img вне потока → не влияет на высоту родителя */
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 12px;
    box-sizing: border-box;  /* явно, чтобы padding не ушёл наружу */
    object-fit: contain;
    display: block;
}

.product-photo .no-photo { min-height: 0; }
.product-card h3 a, .product-tile h3 a { color: inherit; text-decoration: none; }
.product-card h3 a::after, .product-tile h3 a::after { content: ""; position: absolute; inset: 0; }

.ref-banner {
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    margin: 0 0 48px; padding: 32px 40px;
    border: 1px solid var(--border); border-radius: 20px;
    background: white; color: var(--ink); text-decoration: none;
}
.ref-banner h3 { margin: 0 0 6px; font-size: 20px; }
.ref-banner p { margin: 0; max-width: 560px; color: var(--ink-muted); font-size: 14px; }
.ref-banner-btn {
    flex-shrink: 0; padding: 14px 24px; border-radius: 999px;
    background: var(--ink); color: white; font-weight: 600; font-size: 15px;
}
@media (max-width: 700px) {
    .ref-banner { flex-direction: column; align-items: flex-start; padding: 24px; }
}
/* Подвал — общий для всех страниц сайта */

.site-footer {
    margin: 64px 0 32px;
    padding: 48px 40px 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--card-dark-1), var(--card-dark-2));
    color: #E8E4DD;
}
.site-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.4fr;
    gap: 40px;
}
.site-footer-logo {
    font-weight: 800;
    font-size: 22px;
    margin-bottom: 12px;
    color: white;
}
.site-footer-title {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-light);
}
.site-footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: #E8E4DD; text-decoration: none; transition: color 0.15s ease; }
.site-footer a:hover { color: white; text-decoration: underline; }
.site-footer-muted { color: #A9A196; font-size: 14px; line-height: 1.6; }
.site-footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
    margin-top: 36px; padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px; color: #A9A196;
}
.site-footer-bottom a { color: #A9A196; text-decoration: underline; }
.site-footer-bottom a:hover { color: white; }

@media (max-width: 700px) {
    .site-footer { margin-top: 40px; padding: 28px 24px 20px; border-radius: 20px; }
    .site-footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.rent-price {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid #A8927A;
  border-radius: 999px;
  background: rgba(168, 146, 122, 0.10);
  color: #1D1B19;
}
.rent-price__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #57534C;
}
.rent-price__value {
  font-size: 18px;
  font-weight: 700;
}
.rent-price__value small {
  font-size: 13px;
  font-weight: 500;
  color: #57534C;
}
.rent-price--sm {
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
}
.rent-price--sm .rent-price__label { font-size: 10px; }
.rent-price--sm .rent-price__value { font-size: 14px; }

/* Заглушка вместо фото */
.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  padding: 12px;
  box-sizing: border-box;
  background: #EFEAE3;
  color: #A8927A;
  font-size: 14px;
  text-align: center;
}
.gallery-main .no-photo { aspect-ratio: 4 / 3; }
/* атрибут hidden не должен перебиваться display из других правил */
.gallery-main img[hidden] { display: none; }

/* base.css — согласие на обработку данных, общее для всех форм */
.help-form .consent,
.request-form .consent {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
}
.consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.consent a:hover { color: var(--accent); }

.consent input[type="checkbox"] {
    appearance: none;
    flex: none;
    width: 20px; height: 20px;
    margin-top: 1px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: white;
    cursor: pointer;
}
.consent input[type="checkbox"]:checked { background: var(--ink); border-color: var(--ink); }
.consent input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-error { color: #8C4A42; font-size: 14px; margin: 0; }
.form-success { color: #2F6B3F; font-weight: 600; margin: 0 0 16px; }
.honeypot-field { position: absolute; left: -9999px; }

.request-form { display: flex; flex-direction: column; gap: 16px; }
.request-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.request-form input[type="text"],
.request-form input[type="tel"] {
    width: 100%;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
}
.request-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.request-form .btn-primary { border: 0; cursor: pointer; font-family: inherit; }
.request-form textarea {
    width: 100%; font: inherit; font-size: 15px; color: var(--ink);
    padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
    background: white; resize: vertical; min-height: 80px;
}
.request-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-block { display: block; width: 100%; text-align: center; border: 0; cursor: pointer; font-family: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.nav-cart { position: relative; }
.nav-cart-count {
    position: absolute; top: -7px; right: -9px;
    min-width: 18px; height: 18px; padding: 0 5px;
    display: grid; place-items: center;
    border-radius: 999px; background: var(--ink); color: #fff;
    font-size: 11px; font-weight: 700;
}

.nav-cart-count.bump { animation: bump 0.3s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 100;
    display: flex; align-items: center; gap: 16px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 14px 16px 14px 20px;
    border-radius: 16px; background: var(--ink); color: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    animation: toast-in 0.25s ease;
}
.toast-text { min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.toast-link {
    flex: none; padding: 8px 14px; border-radius: 999px;
    background: #fff; color: var(--ink);
    font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.toast-stack .toast .toast-link { padding: 10px 18px; font-size: 16px; }
.toast-close { flex: none; border: 0; background: transparent; color: rgba(255, 255, 255, 0.7); font-size: 22px; line-height: 1; cursor: pointer; }
.toast-close:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .toast { left: 16px; right: 16px; bottom: 16px; } }

/* Расчёт тарифа: карточка в кабинете и страница предложения */
.offer-calc { display: grid; gap: 14px; }
.offer-calc-rules { display: grid; gap: 8px; }
.offer-calc-rule {
  margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent-light);
  border-radius: 0 10px 10px 0; background: #F8F6F2;
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.offer-calc-subtitle { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.offer-calc-list {
  display: grid; gap: 8px; margin: 0; padding: 12px 14px; list-style: none;
  border-radius: 12px; background: #F8F6F2; font-size: 14px;
}
.offer-calc-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--ink-muted); }
.offer-calc-list b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-calc-sum { padding-top: 8px; border-top: 1px solid var(--border); font-weight: 700; }
.offer-calc-sum span { color: var(--ink); }
.offer-calc-extra .offer-calc-list { background: transparent; border: 1px dashed var(--border); }
.offer-calc-extra-note { margin: -4px 0 8px; color: var(--ink-muted); font-size: 13px; }
.offer-calc-sep {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: #EFEAE3; color: var(--ink-muted); font-size: 11px; font-style: normal; font-weight: 600;
}
@media (min-width: 761px) {
  .offer-calc { grid-template-columns: 1fr 1fr; align-items: start; column-gap: 20px; }
  .offer-calc-rules { grid-column: 1 / -1; }
}

/* Контейнер для серверных уведомлений (messages) */
.toast-stack { position: fixed; right: 32px; bottom: 32px; z-index: 100; display: grid; gap: 12px; }
.toast-stack .toast {
    position: static;                       /* позицию теперь задаёт контейнер */
    max-width: min(520px, calc(100vw - 32px));
    padding: 22px 24px 22px 28px;
    gap: 20px;
    border-radius: 20px;
}
.toast-stack .toast .toast-text { font-size: 18px; line-height: 1.5; font-weight: 600; }
.toast-stack .toast .toast-close { font-size: 28px; }

/* Галочка перед текстом успеха */
.toast--success .toast-text::before {
    content: "✓";
    display: inline-grid; place-items: center;
    width: 28px; height: 28px; margin-right: 12px;
    border-radius: 50%; background: var(--accent-light); color: var(--ink);
    font-size: 16px; font-weight: 800; vertical-align: middle;
}
@media (max-width: 600px) { .toast-stack { left: 16px; right: 16px; bottom: 16px; } }

/* Кнопка отправки: приглушена, пока форма не заполнена */
form[data-ready-form] button[type="submit"] {
    background: #EEF1F0;
    color: var(--ink-muted);
    transition: background 0.2s ease, color 0.2s ease;
}
form[data-ready-form] button[type="submit"].is-ready { background: var(--ink); color: #fff; }
form[data-ready-form] button[type="submit"].is-ready:hover { background: var(--accent); }