/* Ковкастали — карточка товара: параметры, видеоблок, быстрый заказ */

/* ===== строка «Артикул / рейтинг» ===== */
.ks-meta {
    column-gap: 10px;
    font-size: 13px;
    white-space: nowrap;
}

.ks-meta .product-rating {
    margin-left: 2px;
}

/* ===== «В наличии» — без точки, с нормальным пробелом ===== */
.ks-stock {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #e87a38;
    font-size: 13px;
    font-weight: 500;
}

.ks-stock__hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: help;
}

/* ===== виджет скидки — как в каталоге, двухцветный ===== */
.discount-save-badge.ks-save {
    display: inline-flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #edc200 !important;
    border-radius: 6px !important;
    background: #fff4c2 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

.ks-save .badge-pct {
    display: flex !important;
    align-items: center !important;
    padding: 5px 9px !important;
    background: #ffd000 !important;
    color: #111 !important;
    font-weight: 700 !important;
}

.ks-save .badge-saving {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    color: #333 !important;
    white-space: nowrap !important;
}

/* ===== воздух между блоками опций ===== */
.product-section-purchase .option-field {
    margin-bottom: 22px !important;
}

.product-section-purchase .product-custom-params-wrapper {
    margin-bottom: 0 !important;
}

.product-section-purchase .option-field__title {
    margin-bottom: 10px !important;
}

/* ===== выбор цвета с образцами (узкие экраны) ===== */
.kspick {
    position: relative;
}

.kspick__head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 0 42px 0 14px;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    background: #f4f5f7;
    color: #374151;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.kspick__arrow {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: translateY(-70%) rotate(45deg);
    transition: transform .15s ease;
}

.kspick_open .kspick__arrow {
    transform: translateY(-30%) rotate(-135deg);
}

.kspick__chip {
    display: block;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
    background: #e5e7eb;
}

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

.kspick__name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kspick__list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 320px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    display: none;
}

.kspick_open .kspick__list {
    display: block;
}

.kspick__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 8px;
    border-radius: 9px;
    cursor: pointer;
}

.kspick__row:hover {
    background: #f3f4f6;
}

.kspick__row_on {
    background: #fdf0dd;
}

.kspick__row .kspick__name {
    white-space: normal;
    font-size: 14px;
    line-height: 1.3;
}

/* ===== блок «Видео с производства» ===== */
.ksvid__grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.ksvid__card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: none;
    border-radius: 22px;
    background: #111;
    cursor: pointer;
}


.ksvid__card_lead {
    grid-column: 1;
    grid-row: 1 / span 2;
    aspect-ratio: auto;
}

/* Роликов меньше трёх: большой карточке не на что опереться по высоте,
   поэтому задаём ей собственные пропорции. */
.ksvid__grid_n1 {
    grid-template-columns: 1fr;
}

.ksvid__grid_n1 .ksvid__card_lead {
    grid-row: auto;
    aspect-ratio: 16 / 9;
}

.ksvid__grid_n2 {
    grid-template-columns: 1fr 1fr;
}

.ksvid__grid_n2 .ksvid__card_lead {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
}

.ksvid__shot {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.ksvid__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
    transform: translate(-50%, -50%);
    transition: transform .2s ease, background .2s ease;
}

.ksvid__card_lead .ksvid__play {
    width: 68px;
    height: 68px;
}

.ksvid__play::before {
    width: 0;
    height: 0;
    margin-left: 3px;
    border-width: 8px 0 8px 13px;
    border-style: solid;
    border-color: transparent transparent transparent #1f2937;
    content: "";
}

.ksvid__card_lead .ksvid__play::before {
    margin-left: 4px;
    border-width: 11px 0 11px 18px;
}

.ksvid__card:hover .ksvid__play {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

@media (max-width: 767.98px) {
    .ksvid__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ksvid__card_lead {
        grid-column: auto;
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }

    .ksvid__card {
        border-radius: 18px;
    }
}

/* ===== быстрый заказ ===== */
.ksorder {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    background: rgba(17, 20, 24, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.ksorder_on {
    opacity: 1;
    visibility: visible;
}

.ksorder__sheet {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 30px 32px 32px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.ksorder__title {
    margin: 0 0 18px;
    font-size: 26px;
    font-weight: 700;
    color: #111;
}

.ksorder__label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #374151;
}

.ksorder__label b {
    color: #e11d48;
    font-weight: 400;
}

.ksorder__input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    color: #111;
}

.ksorder__input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

.ksorder__send {
    margin-top: 18px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: #6b7280;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s ease;
}

.ksorder__send:hover {
    background: #4b5563;
}

.ksorder__send[disabled] {
    opacity: .6;
    cursor: default;
}

.ksorder__note {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.45;
}

.ksorder__note_bad { color: #dc2626; }
.ksorder__note_ok  { color: #16a34a; }

.ksorder__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
}

.ksorder__close:hover {
    background: #fee2e2;
}

.ksorder__close::before,
.ksorder__close::after {
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
}

.ksorder__close::before { transform: rotate(45deg); }
.ksorder__close::after  { transform: rotate(-45deg); }

/* ===== узкие экраны: больше воздуха, без лишних полос ===== */
@media (max-width: 991.98px) {
    .product-section-purchase .single__sheet {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .product-section-purchase .option-field {
        margin-bottom: 26px !important;
    }

    .product-section-purchase .option-field,
    .product-section-purchase .option-field__title,
    .product-section-purchase [data-entity="sku-line-block"],
    .product-section-purchase .material-param-field,
    .product-section-purchase .material-mobile-select {
        border-bottom: 0 !important;
        box-shadow: none !important;
    }

    .product-section-purchase .option-field::after,
    .product-section-purchase .material-mobile-select::after {
        display: none !important;
    }

    .product-section-desc,
    .product-section-tabs {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }
}


/* ===== вкладки под описанием товара ===== */
.tabs {
    display: flex;
    gap: 30px;
    margin: 0 0 20px;
    padding: 0 0 10px;
    overflow-x: auto;
    list-style: none;
}

.tabs .tab {
    flex: 0 0 auto;
}

.tab-link {
    padding: 4px 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: #6b7173;
    font-size: 20px;
    white-space: nowrap;
    cursor: pointer;
}

.tab-link:hover {
    color: #000;
}

.tab-link.active {
    border-bottom-color: #ff6a00;
    color: #000;
}

.tab-pane {
    line-height: 1.4;
}

@media (max-width: 767.98px) {
    .tabs {
        gap: 16px;
    }

    .tab-link {
        font-size: 15px;
        padding: 10px 2px;
    }
}


/* ===== действия над карточкой: избранное и «поделиться» ===== */
.single-actions {
    display: flex;
    flex-wrap: wrap;
}

.single-action {
    display: inline-flex;
    padding: 4px;
    border: none;
    background: none;
    color: #b8b8b8;
    font-size: 34px;
    cursor: pointer;
}

.single-action:hover {
    color: #858585;
}

.single-action[data-favorite-status="Y"] {
    color: #fc482d;
}

/* выпадающий список «поделиться» */
.share-list {
    position: relative;
}

.share-list__items {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 40;
    margin: 0;
    padding: 0;
    list-style: none;
    border-radius: 3px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, .1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s ease-in-out, transform .3s ease-in-out, visibility .3s ease-in-out;
}

.share-list:hover .share-list__items,
.share-list__toggle:focus ~ .share-list__items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-list__item {
    display: flex;
    padding: 8px 14px;
    border-bottom: 1px solid #f2f6f7;
    color: #989898;
    font-size: 24px;
    transition: background-color .3s ease-in-out, color .3s ease-in-out;
}

.share-list__item:last-child {
    border-bottom: none;
}

.share-list__item:hover {
    background-color: #757b7e;
    color: #fff;
}
