.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.01em;
    background-clip: padding-box;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    background: var(--resin-deep);
    background-clip: padding-box;
    border-color: rgba(255, 255, 255, 0.06);
    color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.button--primary:hover,
.button--primary:focus-visible {
    color: white;
}

.button--secondary,
.button--ghost {
    border-color: rgba(70, 50, 31, 0.12);
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
}

.button--secondary-dark {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink-inverse);
}

.button--secondary-dark:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--ink-inverse);
}

.button--danger {
    background: var(--danger);
    color: white;
}

.showcase-card,
.product-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border-radius: 34px 24px 34px 20px;
    border: 1px solid var(--line);
    background: rgba(255, 252, 247, 0.88);
    color: var(--ink);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card {
    border-radius: 24px 18px 24px 14px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(247, 239, 229, 0.88));
    box-shadow: 0 18px 38px rgba(32, 23, 16, 0.11);
}

.showcase-card::before,
.product-card::before {
    content: none;
}

.showcase-card:hover,
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 56px rgba(32, 23, 16, 0.16);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 46px rgba(32, 23, 16, 0.15);
}

.product-card__media-link {
    position: relative;
    z-index: 1;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #1d1513;
}

.product-card__media-link:focus-visible {
    outline: 2px solid #cfc4b7;
    outline-offset: -4px;
}

.showcase-card__media,
.product-card__media {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #1d1513;
    filter: saturate(0.92) contrast(1.04);
}

.product-card__media {
    height: 100%;
    aspect-ratio: auto;
    transition: transform 0.28s ease, filter 0.28s ease;
}

.product-card:hover .product-card__media,
.product-card:focus-within .product-card__media {
    transform: scale(1.026);
    filter: saturate(0.98) contrast(1.05);
}

.showcase-card > .fallback-picture,
.product-card > .fallback-picture,
.product-card__media-link > .fallback-picture {
    background: #1d1513;
}

.showcase-card__body,
.product-card__body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    padding: 24px;
}

.product-card__body {
    align-content: start;
    gap: 9px;
    padding: 16px;
}

.card-grid--listing .showcase-card h2,
.card-grid--listing .product-card h2 {
    font-size: clamp(1.24rem, 1.04rem + 0.52vw, 1.5rem);
    line-height: 1.08;
}

.card-grid--listing .product-card h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: clamp(1.08rem, 0.98rem + 0.32vw, 1.24rem);
    line-height: 1.1;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.product-card h2 a:focus-visible {
    outline: 2px solid #cfc4b7;
    outline-offset: 4px;
}

.product-card p {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card__main {
    display: block;
    min-width: 0;
}

.product-card__main::after {
    content: "";
    display: block;
    clear: both;
}

.product-card__status {
    float: right;
    margin: 0 0 6px 12px;
    max-width: 46%;
}

.product-card__meta,
.product-card__footer {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.product-card__meta {
    gap: 8px;
    justify-content: flex-start;
}

.product-card__type {
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-card .status-badge {
    padding: 6px 10px;
    font-size: 0.74rem;
}

.product-card__specs {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 0;
}

.product-card__specs div {
    display: grid;
    gap: 2px;
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    padding: 8px 9px;
    border: 1px solid rgba(83, 58, 35, 0.10);
    border-radius: 14px 10px 14px 9px;
    background: rgba(255, 255, 255, 0.48);
}

.product-card__specs dt,
.product-card__specs dd {
    margin: 0;
}

.product-card__specs dt {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.product-card__specs dd {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.25;
}

.product-card__footer {
    justify-content: space-between;
    margin-top: auto;
    padding-top: 2px;
}

.product-card__action {
    margin-left: auto;
    color: var(--resin-deep);
}

.meta-line {
    color: var(--ink-muted);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.status-badge--making {
    background: rgba(88, 96, 110, 0.12);
    color: var(--ink-muted);
    border-color: rgba(88, 96, 110, 0.18);
}

.status-badge--available {
    background: rgba(47, 124, 99, 0.12);
    color: var(--success);
    border-color: rgba(47, 124, 99, 0.18);
}

.status-badge--reserved {
    background: rgba(158, 106, 27, 0.12);
    color: var(--warning);
    border-color: rgba(158, 106, 27, 0.18);
}

.status-badge--sold {
    background: rgba(166, 63, 54, 0.12);
    color: var(--danger);
    border-color: rgba(166, 63, 54, 0.18);
}

.media-placeholder {
    position: relative;
    display: grid;
    place-items: end start;
    min-height: 280px;
    padding: 24px;
    background: rgba(20, 16, 15, 0.88);
    color: var(--ink-inverse);
    font-family: var(--display-font);
    font-size: 1.4rem;
    overflow: hidden;
}

.media-placeholder::before,
.media-placeholder::after {
    content: "";
    position: absolute;
}

.media-placeholder::before {
    inset: 0;
    background:
        image-set(
            url("../../img/visuals/product-fallback.8d2c5e5b2304.avif") type("image/avif"),
            url("../../img/visuals/product-fallback.5a76631573de.svg") type("image/svg+xml")
        )
        center / cover no-repeat;
}

.media-placeholder::after {
    inset: 0;
    background: rgba(13, 10, 9, 0.32);
}

.media-placeholder > * {
    position: relative;
    z-index: 1;
}

.detail-intro {
    padding: clamp(98px, 10vw, 126px) 0 clamp(34px, 5vw, 56px);
}

.detail-card {
    position: relative;
    z-index: 2;
    display: grid;
    /* фото — главный аргумент изделия, ему большая часть карточки */
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px 22px 30px 18px;
    background: rgba(255, 252, 247, 0.94);
    box-shadow: var(--shadow-hero);
    color: var(--ink);
}

.detail-card::after {
    content: none;
}

/* колонка фото: крупная обложка и под ней лента миниатюр;
   фон в тон дерева — пока грузится снимок, вместо чёрной дыры видно «заготовку» */
.detail-card__media {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #7a5436 0%, #4a3122 55%, #2c1d15 100%);
}

.detail-card__cover {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-height: clamp(340px, 34vw, 520px);
    overflow: hidden;
}

a.detail-card__cover {
    cursor: zoom-in;
}

/* Изображение вынуто из потока: высоту задаёт текстовая колонка,
   иначе вертикальный снимок растягивает карточку по своим пропорциям. */
.detail-card__cover img,
.detail-card__cover picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.detail-card__cover img {
    object-fit: cover;
    transition: transform 0.4s ease;
}

a.detail-card__cover:hover img {
    transform: scale(1.02);
}

a.detail-card__cover:focus-visible {
    outline: 2px solid var(--resin);
    outline-offset: -4px;
}

.detail-card__cover .fallback-picture img,
.detail-card__cover .detail-gallery__fallback {
    aspect-ratio: auto;
    padding: clamp(18px, 3vw, 34px);
    object-fit: contain;
}

.detail-card__zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(247, 240, 231, 0.24);
    border-radius: 50%;
    background: rgba(19, 15, 13, 0.6);
    color: #f7f0e7;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: transform 0.22s ease, background 0.22s ease;
}

.detail-card__zoom svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

a.detail-card__cover:hover .detail-card__zoom {
    background: rgba(19, 15, 13, 0.78);
    transform: scale(1.06);
}

/* с миниатюрами значок «увеличить» уходит наверх, а низ фото мягко затемняется,
   чтобы превью читались на любом снимке */
.detail-card__media--thumbs .detail-card__zoom {
    top: 14px;
    bottom: auto;
}

.detail-card__media--thumbs .detail-card__cover::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 42%;
    background: linear-gradient(to top, rgba(17, 13, 12, 0.62), rgba(17, 13, 12, 0));
    pointer-events: none;
}

/* миниатюры лежат поверх низа обложки */
.detail-card__thumbs {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.detail-card__thumbs > * {
    pointer-events: auto;
}

.detail-card__thumbs-track {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    /* запас под подъём миниатюры при наведении и рамку фокуса */
    padding: 6px 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    /* привязка учитывает отступ ленты: иначе в начале она стоит на 4px
       правее нуля и левый край гаснет, закрывая первое превью */
    scroll-padding-inline: 4px;
    scrollbar-width: none;
}

.detail-card__thumbs-track::-webkit-scrollbar {
    display: none;
}

/* край ленты, за которым есть ещё фото, гаснет (классы ставит work-detail.js) */
.detail-card__thumbs.has-more-right .detail-card__thumbs-track {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}

.detail-card__thumbs.has-more-left .detail-card__thumbs-track {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
}

.detail-card__thumbs.has-more-left.has-more-right .detail-card__thumbs-track {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

.detail-card__thumbs-nav {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(247, 240, 231, 0.28);
    border-radius: 50%;
    background: rgba(19, 15, 13, 0.62);
    color: #f7f0e7;
    cursor: pointer;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, opacity 0.2s ease;
}

.detail-card__thumbs-nav[hidden] {
    display: none;
}

.detail-card__thumbs-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.detail-card__thumbs-nav:not(:disabled):hover {
    background: rgba(19, 15, 13, 0.85);
}

.detail-card__thumbs-nav:focus-visible {
    outline: 2px solid var(--resin);
    outline-offset: 2px;
}

.detail-card__thumbs-nav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-card__thumb {
    flex: 0 0 auto;
    display: block;
    width: 76px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 2px solid rgba(247, 240, 231, 0.55);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(17, 13, 12, 0.35);
    cursor: zoom-in;
    scroll-snap-align: start;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.detail-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-card__thumb:hover,
.detail-card__thumb:focus-visible {
    border-color: #f7f0e7;
    transform: translateY(-2px);
}

.detail-card__thumb:focus-visible {
    outline: 2px solid var(--resin);
    outline-offset: 2px;
}

.detail-card__content {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: clamp(22px, 3.2vw, 38px);
}

.detail-card__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* хлебные крошки «Портфолио / Стол» — путь назад вместо ссылки рядом с кнопкой */
.detail-card__crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.detail-card__crumbs a {
    color: var(--resin-deep);
    text-decoration: none;
}

.detail-card__crumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.detail-card__crumbs span {
    color: var(--ink-soft);
}

.detail-card__status {
    flex: 0 0 auto;
}

.detail-card__title {
    max-width: 18ch;
    font-size: clamp(2rem, 3.8vw, 3.8rem);
    line-height: 0.98;
}

.detail-card__copy {
    max-width: 62ch;
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.52;
}

.detail-card__specs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 0;
}

.detail-card__specs .detail-card__spec--wide {
    flex-basis: 100%;
}

.detail-card__specs .detail-card__spec--price dd {
    font-size: 1.12rem;
    font-weight: 600;
}

.detail-card__specs div {
    display: grid;
    gap: 3px;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(83, 58, 35, 0.10);
    border-radius: 14px 10px 14px 9px;
    background: rgba(255, 255, 255, 0.54);
}

.detail-card__specs dt,
.detail-card__specs dd {
    margin: 0;
}

.detail-card__specs dt {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-card__specs dd {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 0.93rem;
    line-height: 1.28;
}

.detail-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Карандаш «редактировать в студии» — только для staff */
/* инструменты staff в правом верхнем углу карточки: «Аудит» и карандаш */
.detail-card__tools {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-card__edit {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(83, 58, 35, 0.14);
    border-radius: 50%;
    background: rgba(255, 252, 247, 0.92);
    color: var(--ink-muted);
    box-shadow: 0 6px 16px rgba(32, 23, 16, 0.14);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.detail-card__edit svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-card__edit:hover,
.detail-card__edit:focus-visible {
    border-color: var(--resin-deep);
    background: var(--resin-deep);
    color: #fff;
    transform: scale(1.06);
}

.detail-card__edit:focus-visible {
    outline: 2px solid var(--resin);
    outline-offset: 2px;
}

.detail-card__audit {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(83, 58, 35, 0.14);
    border-radius: 50%;
    background: rgba(255, 252, 247, 0.92);
    color: var(--ink-muted);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(32, 23, 16, 0.14);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.detail-card__audit svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-card__audit:hover,
.detail-card__audit:focus-visible,
.detail-card__audit[aria-expanded="true"] {
    border-color: var(--resin-deep);
    background: var(--resin-deep);
    color: #fff;
    transform: scale(1.06);
}

.detail-card__audit:focus-visible {
    outline: 2px solid var(--resin);
    outline-offset: 2px;
}

/* чтобы бейдж статуса не уходил под инструменты */
.detail-card--editable .detail-card__topline {
    padding-right: 44px;
}

.detail-card--audit .detail-card__topline {
    padding-right: 44px;
}

.detail-card--audit.detail-card--editable .detail-card__topline {
    padding-right: 90px;
}

.detail-card__hint {
    margin-top: 2px;
    color: var(--ink-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.detail-section-head {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.detail-section-head .section-kicker {
    margin-bottom: 0;
}

.detail-section-head .section-title {
    max-width: 20ch;
    font-size: clamp(1.55rem, 2.6vw, 2.35rem);
}

.stack-form {
    display: grid;
    gap: 18px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field[hidden] {
    display: none;
}

.form-field label {
    font-weight: 500;
}

.form-field--checkbox {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
}

.form-field--checkbox label {
    grid-column: 2;
    grid-row: 1;
}

.form-field--checkbox input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
}

/* Подсказка и ошибка — отдельной строкой под подписью, а не третьей ячейкой сбоку. */
.form-field--checkbox small,
.form-field--checkbox .field-error {
    grid-column: 2;
}

.form-field input:not([type="checkbox"]),
.form-field textarea,
.form-field select,
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(60, 44, 27, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.form-field input:not([type="checkbox"]):focus,
.form-field textarea:focus,
.form-field select:focus,
.form-control:focus {
    outline: none;
    border-color: #6d7476;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.button--compact {
    padding: 10px 16px;
    font-size: 0.92rem;
}

/* Кнопка, которая ведёт себя как ссылка: вторичное действие рядом с основным. */
.text-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--wood-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.text-button:hover:not(:disabled) {
    color: var(--resin-deep);
}

.text-button:disabled {
    color: var(--ink-muted);
    font-weight: 500;
    cursor: default;
}

/* Видно программам чтения с экрана, не видно глазами. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.form-checkbox {
    width: 18px;
    height: 18px;
}

.field-error {
    color: var(--danger);
    font-size: 0.92rem;
}

.form-summary-error {
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
    font-size: 0.96rem;
}

.form-field--invalid input:not([type="checkbox"]),
.form-field--invalid textarea,
.form-field--invalid select {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mini-link-card {
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.65);
    color: var(--ink);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.mini-link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(32, 23, 16, 0.16);
    box-shadow: var(--shadow-card);
}

.mini-link-card span {
    color: var(--ink-muted);
}

.empty-panel--visual {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 360px) 1fr;
    gap: 24px;
    align-items: center;
}

.empty-panel__figure {
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(80, 58, 36, 0.10);
    background: #1d1513;
    box-shadow: var(--shadow-card);
}

.empty-panel__media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-panel__figure .fallback-picture {
    aspect-ratio: 4 / 3;
}

.empty-panel__body {
    display: grid;
    gap: 12px;
    align-content: center;
}

.empty-panel__eyebrow {
    color: var(--resin-deep);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.empty-panel__body h3 {
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.empty-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: 6px;
}

.detail-gallery__fallback {
    width: 100%;
    aspect-ratio: 5 / 4;
    object-fit: cover;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 6px;
    background: rgba(15, 12, 11, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    width: max-content;
    max-width: 100%;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.filter-chip {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: rgba(247, 240, 231, 0.88);
    background: transparent;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition:
        background 180ms ease,
        color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.filter-chip:hover {
    color: var(--ink-inverse);
    background: rgba(255, 255, 255, 0.14);
}

.filter-chip.is-active {
    background: var(--surface-strong);
    color: var(--ink);
    border-color: color-mix(in srgb, var(--resin-deep) 32%, transparent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 8px 18px -10px rgba(18, 90, 100, 0.45);
}

.filter-chip.is-active:hover {
    background: var(--surface-strong);
    color: var(--ink);
}

@media (max-width: 820px) {
    .filter-row {
        width: 100%;
        border-radius: 22px;
    }
}

@media (max-width: 960px) {
    .empty-panel--visual {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .empty-panel__figure {
        border-radius: 24px;
    }

    .detail-intro {
        padding-top: 90px;
    }

    .detail-card {
        grid-template-columns: 1fr;
        border-radius: 24px 18px 24px 14px;
    }

    .detail-card__cover {
        flex: 0 0 auto;
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .detail-card__thumbs {
        right: 8px;
        bottom: 8px;
        left: 8px;
    }

    .detail-card__thumb {
        width: 58px;
    }

    .detail-card__thumbs-nav {
        width: 30px;
        height: 30px;
    }

    /* на телефоне инструменты staff лежат в том же углу фото — значок ниже них */
    .detail-card--editable .detail-card__media--thumbs .detail-card__zoom,
    .detail-card--audit .detail-card__media--thumbs .detail-card__zoom {
        top: 62px;
    }

    .detail-card__content {
        gap: 12px;
        padding: 18px;
    }

    /* на мобильном инструменты лежат поверх фото, строка с бейджем ниже */
    .detail-card--editable .detail-card__topline,
    .detail-card--audit .detail-card__topline,
    .detail-card--audit.detail-card--editable .detail-card__topline {
        padding-right: 0;
    }

    .detail-card__title {
        max-width: 100%;
        font-size: 1.82rem;
        line-height: 1.06;
    }

    .detail-card__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .detail-card__actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card:hover .product-card__media,
    .product-card:focus-within .product-card__media {
        transform: none;
    }
}

/* Карточка работы над формой заявки (/custom-order/?work=<slug>) */
.inquiry-work {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-block: 4px 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px 14px 20px 12px;
    background: var(--surface-strong);
    color: var(--ink);
    text-decoration: none;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.inquiry-work:hover,
.inquiry-work:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(32, 23, 16, 0.12);
}

.inquiry-work:focus-visible {
    outline: 2px solid var(--resin-deep);
    outline-offset: 3px;
}

.inquiry-work__media {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: 14px 10px 14px 8px;
    background: var(--surface-deep);
}

.inquiry-work__media img,
.inquiry-work__media .fallback-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inquiry-work__body {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.inquiry-work__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.inquiry-work__meta .status-badge {
    padding: 4px 10px;
    font-size: 0.76rem;
}

.inquiry-work__title {
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.inquiry-work__price {
    color: var(--resin-deep);
    font-weight: 500;
}

/* работа-образец («Хочу похожее»): пунктир — это ориентир, не покупка */
.inquiry-work--reference {
    border: 1px dashed rgba(117, 67, 35, 0.42);
    background: rgba(169, 109, 64, 0.05);
}

.inquiry-work__role {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(169, 109, 64, 0.14);
    color: var(--wood-deep);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
    .inquiry-work:hover,
    .inquiry-work:focus-visible {
        transform: none;
    }
}

/* --- Форма заявки: плитки типа изделия, свёрнутые контакты, страница «принята» --- */

.form-field--choices .form-field__label {
    font-weight: 500;
}

.choice-tiles > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px;
}

.choice-tiles label {
    display: block;
    padding: 14px 16px;
    border: 1px solid rgba(60, 44, 27, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
    cursor: pointer;
    text-align: center;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.form-field--choices input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.choice-tiles label:hover {
    border-color: rgba(60, 44, 27, 0.4);
}

.choice-tiles label:has(input:focus-visible) {
    outline: 2px solid var(--wood-deep);
    outline-offset: 2px;
}

.choice-tiles label:has(input:checked) {
    border-color: var(--wood-deep);
    background: rgba(169, 109, 64, 0.12);
    box-shadow: inset 0 0 0 1px var(--wood-deep);
    font-weight: 500;
}

.inquiry-identity {
    padding: 14px 16px;
    border: 1px solid rgba(60, 44, 27, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
}

.inquiry-identity__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    cursor: pointer;
    list-style: none;
}

/* Длинный адрес не должен распирать панель на узком экране. */
.inquiry-identity__who {
    min-width: 0;
    overflow-wrap: anywhere;
}

.inquiry-identity__summary::-webkit-details-marker {
    display: none;
}

.inquiry-identity__contacts {
    display: block;
    color: var(--ink-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.inquiry-identity__toggle {
    color: var(--wood-deep);
    font-size: 0.9rem;
    font-weight: 700;
}

.inquiry-identity[open] .inquiry-identity__toggle {
    font-weight: 400;
}

.inquiry-identity__fields {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

/* Два поля формы в одну строку; на узком экране — друг под другом. */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
    align-items: start;
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.stack-form__note {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.inquiry-done {
    display: grid;
    gap: 16px;
}

.inquiry-done__title {
    margin: 0;
    font-size: 1.1rem;
}

.inquiry-done__facts {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

.inquiry-done__message {
    margin: 0;
    padding: 12px 16px;
    border-left: 2px solid rgba(60, 44, 27, 0.18);
    color: var(--ink-muted);
}

.inquiry-done__note {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.92rem;
}

.inquiry-done .button {
    justify-self: start;
}

/* Страница «Страница устарела» вместо ошибки CSRF (templates/403_csrf.html)
   и страницы ошибок 404/500. */

/* тёмный intro растягивается до футера, иначе под коротким
   контентом остаётся пустой светлый фон .site-frame */
.page-not-found .page-shell,
.page-server-error .page-shell,
.page-csrf-failure .page-shell {
    display: flex;
    flex-direction: column;
}

.page-not-found .page-intro,
.page-server-error .page-intro,
.page-csrf-failure .page-intro {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
}

.page-not-found .page-intro__grid {
    grid-template-columns: minmax(0, 36rem) auto;
    justify-content: center;
}

@media (max-width: 820px) {
    .page-not-found .page-intro__grid {
        grid-template-columns: 1fr;
    }
}

.not-found__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: 28px;
}

/* ссылка стоит на тёмном intro */
.not-found__actions .text-link {
    color: var(--resin-soft);
}

.not-found__actions .text-link::after {
    border-color: currentColor;
}

/* мастер выглядывает из-за края: «а страницы-то нет» */
.not-found__visual {
    justify-self: center;
    width: auto;
    height: clamp(240px, 30vw, 360px);
    aspect-ratio: 393 / 917;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.not-found__visual::after {
    content: none;
}

.not-found__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 26px 38px rgba(0, 0, 0, 0.38));
}

.csrf-failure__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
