/* ==========================================================================
   Штыковские двери — карточка товара и конфигуратор
   ========================================================================== */

.product { padding-bottom: 90px; }
@media (min-width: 1024px) { .product { padding-bottom: 40px; } }

.product__top { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .product__top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; } }

/* ============================ Галерея ============================ */
.gallery { position: relative; }
.gallery__main {
    position: relative; aspect-ratio: 3 / 4; background: var(--bg-2);
    border-radius: var(--radius-lg); overflow: hidden;
}
@media (min-width: 700px) { .gallery__main { aspect-ratio: 4 / 3; } }
.gallery__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: center; height: 100%; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

.gallery__badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; z-index: 2; }
.gallery__zoom {
    position: absolute; right: 12px; bottom: 12px; z-index: 2;
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .93); display: flex; align-items: center; justify-content: center;
}
.gallery__zoom svg { width: 18px; height: 18px; }

.gallery__dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
@media (min-width: 700px) { .gallery__dots { display: none; } }
.gallery__dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--line); }
.gallery__dot.is-on { background: var(--accent); width: 20px; border-radius: 4px; }

.gallery__thumbs { display: none; gap: 8px; margin-top: 10px; }
@media (min-width: 700px) { .gallery__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); } }
.gallery__thumb {
    aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: var(--radius);
    overflow: hidden; background: var(--bg-2);
}
.gallery__thumb.is-on { border-color: var(--accent); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

.ar-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 10px; padding: 12px; background: var(--bg-2);
    border: 1px dashed var(--muted-2); border-radius: var(--radius);
    font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.ar-btn:hover { border-color: var(--accent); color: var(--accent); }
.ar-btn svg { width: 19px; height: 19px; }

/* ============================ Основная информация ============================ */
.product__style { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.product h1 { margin: 6px 0 10px; }
.product__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.product__sku { font-variant-numeric: tabular-nums; }

.product__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.product__price b { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.product__price s { font-size: 17px; color: var(--muted); }
.product__price .badge { align-self: center; }
.product__pricenote { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.product__lead { color: var(--ink-2); margin-bottom: 18px; }

.product__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 700px) { .product__facts { grid-template-columns: repeat(4, 1fr); } }
.pfact { padding: 12px; background: var(--bg-2); border-radius: var(--radius); }
.pfact b { display: block; font-size: 15px; }
.pfact span { font-size: 12px; color: var(--muted); }

/* ============================ Конфигуратор ============================ */
.config { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.config__head { padding: 14px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.config__head h2 { margin: 0; font-size: 17px; }
.config__head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.config__body { padding: 16px; display: grid; gap: 18px; }

.cfield__label {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    font-size: 13px; font-weight: 700; margin-bottom: 8px;
}
.cfield__label span { font-weight: 500; color: var(--muted); font-size: 12px; }

.opts { display: flex; flex-wrap: wrap; gap: 7px; }
.opt {
    padding: 9px 13px; background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius); font-size: 14px; font-weight: 600;
    transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.opt:hover { border-color: var(--muted-2); }
.opt.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt small { display: block; font-size: 11px; font-weight: 500; opacity: .75; }

.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
@media (min-width: 700px) { .swatches { grid-template-columns: repeat(10, 1fr); } }
.swatch {
    position: relative; aspect-ratio: 1; padding: 0; border: 2px solid transparent;
    border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.swatch img { width: 100%; height: 100%; object-fit: cover; }
.swatch.is-on { border-color: var(--accent); }
.swatch.is-on::after {
    content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
.swatch-name { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.swatch-more { margin-top: 8px; font-size: 13px; }

.config__total {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px; background: var(--accent-tint); border-top: 1px solid var(--line);
}
.config__total b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.config__total span { font-size: 13px; color: var(--ink-2); display: block; }

.config__list { margin: 0; font-size: 13px; color: var(--ink-2); }
.config__list div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.config__list dt { color: var(--muted); }
.config__list dd { margin: 0; font-weight: 600; text-align: right; }

/* ============================ Кнопки покупки ============================ */
.buy { display: grid; gap: 10px; margin-bottom: 16px; }
.buy__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buy__main { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); height: 46px; }
.qty button { width: 40px; height: 100%; background: none; border: 0; font-size: 19px; color: var(--ink-2); }
.qty button:hover { background: var(--bg-2); }
.qty input { width: 42px; height: 100%; border: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.iconlinks { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.iconlink { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); background: none; border: 0; padding: 0; }
.iconlink:hover { color: var(--accent); }
.iconlink.is-on { color: var(--sale); }
.iconlink svg { width: 17px; height: 17px; }

/* ============================ Вкладки ============================ */
.tabs { margin-top: 40px; }
.tabs__nav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs__nav::-webkit-scrollbar { display: none; }
.tabs__btn {
    flex: 0 0 auto; padding: 13px 16px; background: none; border: 0;
    border-bottom: 2px solid transparent; font-size: 15px; font-weight: 600; color: var(--muted);
    white-space: nowrap;
}
.tabs__btn.is-on { color: var(--ink); border-color: var(--accent); }
.tabs__panel { display: none; padding: 24px 0; }
.tabs__panel.is-on { display: block; }
.tabs__panel p { max-width: 76ch; }

.spec { width: 100%; border-collapse: collapse; font-size: 14px; max-width: 760px; }
.spec th, .spec td { text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.spec th { font-weight: 500; color: var(--muted); width: 46%; }
.spec td { font-weight: 600; }

.doclist { display: grid; gap: 10px; max-width: 620px; }
.doc {
    display: flex; align-items: center; gap: 12px; padding: 13px 15px;
    background: var(--bg-2); border-radius: var(--radius); border: 0; width: 100%; text-align: left;
}
.doc:hover { background: var(--bg-3); }
.doc__ico {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius);
    background: var(--sale); color: #fff; font-size: 10px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.doc b { display: block; font-size: 14px; }
.doc span { font-size: 12px; color: var(--muted); }

.qa { display: grid; gap: 12px; max-width: 760px; }
.qa__item { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.qa__q { font-weight: 700; margin-bottom: 6px; }
.qa__a { margin: 0; font-size: 14px; color: var(--ink-2); }
.qa__who { font-size: 12px; color: var(--muted); margin-top: 8px; }

.revlist { display: grid; gap: 14px; max-width: 820px; }
.revitem { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.revitem__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.revitem__head b { font-size: 15px; }
.revitem__stars { color: var(--star); letter-spacing: 2px; }
.revitem__date { font-size: 13px; color: var(--muted); margin-left: auto; }
.revitem p { margin: 0; font-size: 14px; color: var(--ink-2); }

.revsum { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 20px; }
.revsum__score { text-align: center; }
.revsum__score b { display: block; font-size: 42px; line-height: 1; letter-spacing: -.02em; }
.revsum__score span { color: var(--star); letter-spacing: 2px; }
.revsum__bars { flex: 1 1 260px; max-width: 320px; }
.revbar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.revbar__line { flex: 1; height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.revbar__fill { display: block; height: 100%; background: var(--star); }

/* ============================ Липкая панель ============================ */
.buybar {
    position: fixed; left: 0; right: 0; bottom: var(--bottombar-h); z-index: 66;
    display: flex; align-items: center; gap: 10px; padding: 10px var(--pad);
    background: rgba(255, 255, 255, .98); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(22, 24, 26, .08);
}
@media (min-width: 1024px) { .buybar { display: none; } }
.buybar__price { flex: 1; min-width: 0; }
.buybar__price b { display: block; font-size: 18px; font-weight: 800; }
.buybar__price small { font-size: 11px; color: var(--muted); }
.buybar .btn { flex-shrink: 0; }

/* ============================ Просмотрщик (общий) ============================ */
.lightbox {
    position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center;
    background: rgba(12, 14, 15, .94); padding: 40px 16px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: var(--radius); }
.lightbox__close, .lightbox__nav {
    position: absolute; background: rgba(255, 255, 255, .12); border: 0; color: #fff;
    width: 46px; height: 46px; border-radius: 50%; font-size: 26px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav--prev { left: 12px; top: 50%; margin-top: -23px; }
.lightbox__nav--next { right: 12px; top: 50%; margin-top: -23px; }
.lightbox__caption { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #c9ced1; font-size: 14px; margin: 0; }

/* ============================ Карусели на странице ============================ */
.carousel { position: relative; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
.carousel__track { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.carousel__track > * { scroll-snap-align: start; flex: 0 0 66%; }
@media (min-width: 700px) { .carousel__track > * { flex: 0 0 32%; } }
@media (min-width: 1024px) { .carousel__track > * { flex: 0 0 23.5%; } }
