.kf-product {
    --kf-accent: var(--set-button-kf, #FF6B00);
    --kf-accent-hover: #e35f00;
    --kf-line: #e3e3e3;
    --kf-muted: #5B5B5B;
    padding: 16px 0 48px;
    color: #000;
}

.kf-product__top {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 40px;
    align-items: start;
}

/* ---------- Фото ---------- */

.kf-product__main {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 1px solid var(--kf-line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: zoom-in;
}

.kf-product__main img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    box-sizing: border-box;
    transition: opacity .25s ease;
}

.kf-product__main img.is-changing {
    opacity: 0;
}

.kf-product__zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transition: opacity .2s ease;
}

.kf-product__main:hover .kf-product__zoom-hint,
.kf-product__main:focus-visible .kf-product__zoom-hint {
    opacity: 1;
}

.kf-product__main:focus-visible,
.kf-product__thumb:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.kf-product__thumbs {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0 0 4px;
    overflow-x: auto;
}

.kf-product__thumb {
    display: block;
    width: 84px;
    height: 63px;
    padding: 0;
    border: 2px solid var(--kf-line);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s ease;
}

.kf-product__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kf-product__thumb:hover {
    border-color: #BEBEBE;
}

.kf-product__thumb.is-active {
    border-color: var(--kf-accent);
}

/* ---------- Информация ---------- */

.kf-product__info {
    display: grid;
    gap: 20px;
}

.kf-product__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.kf-product__title {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.kf-product__label {
    margin: 0 0 8px;
    padding: 0;
    float: none;
    width: auto;
    font-size: 14px;
    font-weight: 500;
    color: var(--kf-muted);
}

.kf-product__short {
    font-size: 15px;
    line-height: 1.5;
}

.kf-product__short ul,
.kf-product__short ol {
    margin: 0;
    padding-left: 20px;
}

.kf-product__short p {
    margin: 0 0 6px;
}

.kf-product__short > :last-child {
    margin-bottom: 0;
}

.kf-product__colors {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.kf-product__colors [data-kf-color-name] {
    color: #000;
}

.kf-product__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kf-product__swatches label {
    margin: 0;
    cursor: pointer;
    line-height: 0;
}

.kf-product__swatches input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.kf-product__swatches .kf-catalog__swatch {
    width: 32px;
    height: 32px;
}

.kf-product__swatches input:checked + .kf-catalog__swatch {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--kf-accent);
}

.kf-product__swatches input:focus-visible + .kf-catalog__swatch {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

.kf-product__qty {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kf-product__qty .kf-product__label {
    margin: 0;
}

.kf-product__stepper {
    display: inline-flex;
    border: 1px solid #BEBEBE;
    border-radius: 6px;
    overflow: hidden;
}

.kf-product__stepper button {
    width: 40px;
    height: 40px;
    border: 0;
    background: #f5f5f5;
    font-size: 20px;
    line-height: 1;
    color: #000;
    cursor: pointer;
}

.kf-product__stepper button:hover {
    background: #e9e9e9;
}

.kf-product__stepper input {
    width: 52px;
    height: 40px;
    border: 0;
    border-left: 1px solid #BEBEBE;
    border-right: 1px solid #BEBEBE;
    text-align: center;
    font-size: 16px;
    -moz-appearance: textfield;
}

.kf-product__stepper input::-webkit-outer-spin-button,
.kf-product__stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kf-product__buy {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding-top: 20px;
    border-top: 1px solid var(--kf-line);
}

.kf-product__price {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 700;
    white-space: nowrap;
}

.kf-product__price s {
    display: block;
    font-size: 15px;
    font-weight: 400;
    color: #8a8a8a;
}

.kf-product__buy-btn {
    min-height: 52px;
    min-width: 180px;
    padding: 0 36px;
    font-size: 18px;
}

.kf-product__buy-btn[disabled] {
    opacity: .7;
    cursor: default;
}

.kf-product__out {
    margin: 0;
    font-size: 16px;
    color: #8a8a8a;
}

.kf-product__status {
    margin: -8px 0 0;
    font-size: 14px;
    color: #c0271a;
}

.kf-product__status:empty {
    display: none;
}

/* ---------- Вкладки ---------- */

.kf-product__tabs {
    margin-top: 40px;
}

.kf-product__tablist {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--kf-line);
    overflow-x: auto;
    overflow-y: hidden;
}

.kf-product__tablist [role="tab"] {
    flex: 0 0 auto;
    padding: 12px 20px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--kf-muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.kf-product__tablist [role="tab"]:hover {
    color: #000;
}

.kf-product__tablist [role="tab"][aria-selected="true"] {
    color: #000;
    border-bottom-color: var(--kf-accent);
}

.kf-product__tablist [role="tab"]:focus-visible {
    outline: 3px solid #000;
    outline-offset: -3px;
}

.kf-product__panel {
    padding: 24px 0 0;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.kf-product__panel:focus-visible {
    outline: 2px solid #BEBEBE;
    outline-offset: 6px;
}

.kf-product__panel > :first-child { margin-top: 0; }
.kf-product__panel p { margin: 0 0 12px; }
.kf-product__panel img { max-width: 100%; height: auto; }
.kf-product__panel ul,
.kf-product__panel ol { padding-left: 22px; margin: 0 0 12px; }

.kf-product__panel table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    margin: 0 0 16px;
}

.kf-product__panel table td,
.kf-product__panel table th {
    padding: 10px 14px;
    border: 1px solid var(--kf-line);
    text-align: left;
    vertical-align: top;
}

.kf-product__panel table tr:nth-child(even) td {
    background: #fafafa;
}

.kf-product__video,
.kf-product__video-frame {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #000;
    overflow: hidden;
}

.kf-product__video-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.kf-product__content {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--kf-line);
}

/* ---------- Похожие товары ---------- */

.kf-product__related {
    margin-top: 48px;
}

.kf-product__related h2 {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 700;
}

.kf-product__related-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.kf-product__related .kf-card__title {
    font-size: 15px;
}

.kf-product__related .kf-card__price {
    font-size: 17px;
}

/* ---------- Увеличенное фото ---------- */

.kf-lightbox-open {
    overflow: hidden;
}

.kf-lightbox {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 72px;
    background: rgba(0, 0, 0, 0);
    transition: background-color .25s ease;
    cursor: zoom-out;
}

.kf-lightbox[hidden] {
    display: none;
}

.kf-lightbox.is-open {
    background: rgba(0, 0, 0, .85);
}

.kf-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    background: #fff;
    opacity: 0;
    transform: scale(.85);
    transition: opacity .25s ease, transform .3s ease;
}

.kf-lightbox__image.is-ready {
    opacity: 1;
    transform: scale(1);
}

.kf-lightbox__close,
.kf-lightbox__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease;
}

.kf-lightbox__close:hover,
.kf-lightbox__nav:hover {
    background: rgba(255, 255, 255, .3);
}

.kf-lightbox__close:focus-visible,
.kf-lightbox__nav:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.kf-lightbox__close { top: 16px; right: 16px; }
.kf-lightbox__nav--prev { left: 12px; top: 50%; transform: translateY(-50%); }
.kf-lightbox__nav--next { right: 12px; top: 50%; transform: translateY(-50%); }

.kf-lightbox--single .kf-lightbox__nav {
    display: none;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1199px) {
    .kf-product__related-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .kf-product__top {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .kf-product__related-list {
        grid-auto-flow: column;
        grid-auto-columns: 220px;
        grid-template-columns: none;
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

@media (max-width: 575px) {
    .kf-product__title {
        font-size: 24px;
    }

    .kf-product__price {
        font-size: 26px;
    }

    .kf-product__buy-btn {
        flex: 1 1 100%;
    }

    .kf-lightbox {
        padding: 64px 8px;
    }

    .kf-lightbox__nav {
        top: auto;
        bottom: 12px;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kf-product *,
    .kf-lightbox,
    .kf-lightbox * {
        transition: none !important;
    }
}

.kf-product__price small {
    font-size: 15px;
    font-weight: 400;
    color: var(--kf-muted);
}

.kf-product__hint {
    margin: -8px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--kf-muted);
}
