/* Product page glue between the Figma "Устройство" frames and WooCommerce data. Loaded after the device-*.css files. */

.device {
    padding-top: 10px;
    padding-bottom: 20px;
}

/* ---- breadcrumbs ---- */
.device__crumbs {
    margin-bottom: -20px;
    font: 500 clamp(15px, 10px + 0.4167vw, 18px)/140% var(--font-family);
    color: var(--seryy);
}

/* Figma "Устройство": long arrow 29×21, "Назад" 18px Medium #1d1b1b (the crumbs' grey must not reach it) */
.device__crumbs .device__back {
    display: none;
    align-items: center;
    gap: 10px;
    font: 500 18px/140% var(--font-family);
    color: var(--chernyy);
}

.device__back img {
    width: 29px;
    height: auto;
}

.device__crumbs-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

.device__crumbs-list li:not(:last-child)::after {
    content: "/";
    margin-left: 6px;
}

.device__crumbs a {
    color: inherit;
}

.device__crumbs-list a:hover {
    color: var(--firmennyy);
}

.device__title {
    text-transform: uppercase;
}

.device__section-title {
    margin: 0;
}

.device__code {
    margin-left: auto;
    white-space: nowrap;
}

.device__rating {
    align-items: center;
}

.review__rating-star--off {
    opacity: 0.25;
}

/* ---- options (chips) ---- */
.settings__setting-item {
    font-family: inherit;
    background: transparent;
    padding-inline: 14px;
}

.settings__setting-item--color {
    padding: 1.5px;
    min-width: 46px;
}

.settings__setting-item.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings__setting-item.active {
    border-color: var(--chernyy);
}

.settings__setting-item--color.active {
    border: 1.5px solid var(--chernyy);
}

.settings__settings-wrapper {
    flex-wrap: wrap;
}

.settings__note {
    margin: 0 0 3px;
    font: 400 11px/130% var(--font-family);
    color: var(--seryy);
}

.settings__item-price {
    margin-left: 6px;
    font-size: 11px;
    color: var(--firmennyy);
}

.settings__title-value {
    font-weight: 500;
}

/* ---- characteristics ---- */
.device__chars-scroll {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.device__chars-scroll::-webkit-scrollbar {
    display: none;
}

.device__characteristics .characteristics__card {
    flex: 0 0 min(320px, 88%);
    scroll-snap-align: start;
    background: var(--belyy);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
}

.device__chars-link {
    display: none;
}

.device__specs {
    display: none;
}

/* ---- price card ---- */
.conditions__price-block[hidden] {
    display: none;
}

.conditions__price-block--single {
    grid-column: 1 / -1;
}

.conditions__cart-form {
    display: block;
}

.conditions__stock {
    margin: 0;
    padding: 15px;
    background: var(--svetlo-seryy);
    text-align: center;
    font: 500 15px/140% var(--font-family);
    color: var(--seryy);
}

.instalments .instalments__detail {
    background: var(--belyy);
}

.instalments__details {
    padding: 0 15px 15px;
}

.instalments__detail-payment--smaller {
    font-size: 11px;
    color: var(--seryy);
}

.conditions__stores-list {
    margin: 0;
    padding-left: 18px;
    font: 500 15px/140% var(--font-family);
}

.conditions__tradein {
    color: inherit;
}

/* ---- about ---- */
.device__about {
    display: block;
}

.about__info .device__section-title {
    margin-bottom: 15px;
}

.about__content {
    max-height: 17em;
    overflow: hidden;
}

.about__content p {
    margin: 0 0 10px;
}

.about__info.is-open .about__content {
    max-height: none;
}

.about__link {
    background: none;
    border: 0;
    padding: 0;
    font: 700 15px/140% var(--font-family);
    color: var(--firmennyy);
    cursor: pointer;
}

.about__device-card {
    display: none;
}

/* ---- reviews ---- */
.device__reviews {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.device__reviews-header {
    gap: 10px;
}

.device__reviews-wr {
    align-items: stretch;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    min-width: 0;
}

.device__reviews-wr .review--main {
    display: flex;
    flex-direction: column;
    flex: 0 0 min(320px, 86%);
    height: auto;
    min-height: 200px;
    scroll-snap-align: start;
}

.device__reviews-wr .review__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device__reviews-wr .review__card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.device__reviews-wr .review__date {
    position: static;
    margin: 0;
    max-width: none;
    order: 3;
    width: 100%;
    font-size: 13px;
}

.device__reviews-btn {
    display: block;
    text-align: center;
}

.summary__add-review {
    display: block;
    text-align: center;
}

.summary__rating-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.device__review-form {
    padding: 15px;
    background: var(--belyy);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    font: 500 15px/140% var(--font-family);
}

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

.device__review-form form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.device__review-form p {
    margin: 0;
}

/* Field captions only: the consent line (.legal-consent) keeps its own flex layout, or its checkbox square collapses */
.device__review-form label:not(.legal-consent) {
    display: block;
    margin-bottom: 3px;
    color: var(--seryy);
}

.device__review-form select,
.device__review-form textarea,
.device__review-form input[type="text"],
.device__review-form input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--temno-belyy);
    background: var(--belyy);
    font: inherit;
}

.device__review-form .submit {
    width: 100%;
    min-height: 48px;
    border: 0;
    background: var(--firmennyy);
    color: var(--belyy);
    font: 500 15px/140% var(--font-family);
    cursor: pointer;
}

.device__review-form .comment-reply-title {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

/* ---- mobile sticky buy bar ---- */
.device__sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 15px;
    background: var(--belyy);
    box-shadow: 0 -4px 20px 0 rgba(0, 0, 0, 0.08);
}

.device__sticky-price {
    font: 600 20px/120% var(--font-family);
    color: var(--chernyy);
    white-space: nowrap;
}

.device__sticky-btn {
    flex: 0 0 55%;
    min-height: 48px;
    border: 0;
    background: var(--firmennyy);
    font: 500 15px/140% var(--font-family);
    color: var(--belyy);
    cursor: pointer;
}

@media (max-width: 767px) {
    .device {
        padding-bottom: 80px;
    }

    .device__header {
        flex-wrap: wrap;
        gap: 5px 10px;
    }
}

@media (min-width: 768px) {
    .device__sticky {
        display: none;
    }

    .device__crumbs {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-bottom: -30px;
    }

    .device__crumbs .device__back {
        display: inline-flex;
    }

    .device__crumbs-list {
        flex: 1;
        padding-right: 70px;
        font-size: 14px;
    }

    .device__title {
        text-transform: none;
    }

    .device__chars-scroll {
        display: block;
        overflow: visible;
    }

    .device__characteristics .characteristics__card {
        flex: none;
        min-width: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .device__characteristics .characteristics__card:nth-child(n + 2) {
        display: none;
    }

    .device__chars-link {
        display: block;
        margin-top: 15px;
        text-align: end;
        color: var(--firmennyy);
        font-weight: 500;
    }

    .device__specs {
        display: block;
    }

    .device__specs .device__section-title {
        margin-bottom: 20px;
    }

    .device__specs-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px 30px;
    }

    .device__reviews {
        display: grid;
        grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        column-gap: 30px;
        row-gap: 20px;
        align-items: start;
    }

    .device__reviews-header {
        grid-area: 1 / 1 / 2 / 3;
    }

    .device__reviews-summary {
        grid-area: 2 / 1 / 3 / 2;
        margin: 0;
    }

    .device__reviews-wr {
        grid-area: 2 / 2 / 3 / 3;
    }

    .device__review-form {
        grid-area: 3 / 1 / 4 / 3;
    }

    .device__reviews-btn {
        display: none;
    }

    .device__reviews-wr .review--main {
        flex-basis: 380px;
        min-width: 0;
    }
}

@media (min-width: 1200px) {
    /* Figma "Устройство": "Читать далее" 20px Bold, 25px line, #672829 */
    .about__link {
        font: 700 20px/25px var(--font-family);
        color: #672829;
    }

    .device__about {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
        gap: 40px;
        align-items: start;
    }

    .about__content {
        max-width: 640px;
    }

    .about__device-card {
        position: sticky;
        top: 110px;
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr) auto;
        align-items: center;
        gap: 15px;
        padding: 15px;
        background: var(--belyy);
        box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);
    }

    .about__device-thumb img {
        display: block;
        width: 78px;
        height: 78px;
        object-fit: contain;
    }

    .about__device-body {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }

    .about__device-title {
        font: 500 15px/130% var(--font-family);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .about__device-rating {
        font: 500 14px/130% var(--font-family);
    }

    .about__device-rating span {
        color: var(--seryy);
    }

    .about__device-links {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 16px;
        font: 500 14px/130% var(--font-family);
    }

    .about__device-links a {
        color: var(--firmennyy);
    }

    .about__device-buy {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .about__device-price {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        font: 700 18px/120% var(--font-family);
        white-space: nowrap;
    }

    .about__device-price del {
        font: 400 12px/120% var(--font-family);
        color: var(--seryy);
    }

    .about__device-price del[hidden] {
        display: none;
    }

    .about__device-cart {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border: 0;
        background: var(--firmennyy);
        cursor: pointer;
    }

    .about__device-cart img {
        width: 22px;
        height: auto;
    }
}

@media (min-width: 1500px) {
    .device__characteristics {
        margin-top: 10px;
    }
}

/* A product with a single photo has no thumbnail strip; the main view takes the whole card. */
.gallery.gallery--single {
    grid-template-columns: 1fr;
}

.device__header {
    flex-wrap: wrap;
    gap: 5px 12px;
}

@media (min-width: 1500px) {
    .device__header {
        justify-content: flex-end;
    }

    .device__fav-icon--header {
        display: none;
    }
}

/* Figma "Устройство" (1920): stars first, then "10 отзывов" */
.device__rating--full {
    flex-flow: row;
}

/* out-of-stock colour: crossed-out swatch instead of a faded one */
.settings__setting-item--color.is-disabled {
    opacity: 1;
}

.settings__setting-item--color.is-disabled .color-option {
    background:
        linear-gradient(to top right, transparent calc(50% - 1px), var(--seryy) 50%, transparent calc(50% + 1px)),
        linear-gradient(to top left, transparent calc(50% - 1px), var(--seryy) 50%, transparent calc(50% + 1px)),
        var(--belyy) !important;
    border: 1px solid var(--temno-belyy);
}

/* Figma: colour swatches 70×50, 20px apart */
@media (min-width: 950px) {
    .settings__setting-item--color {
        width: 70px;
        min-width: 70px;
        height: 50px;
    }

    [data-option-group="attribute_pa_color"] .settings__settings-wrapper {
        gap: 20px;
    }
}

/* Figma "Устройство" (desktop): "Оформить в рассрочку" spans the white card; "Рассрочка без переплат" and the
   tiles sit below it in their own grey panel (padding 20). On phones the button stays inside the grey block. */
@media (min-width: 1200px) {
    .conditions__instalments.instalments {
        padding: 0;
        background: none;
    }

    .instalments .instalments__btn {
        padding: 18px 25px; /* 65px with the 2px border, as in Figma */
    }

    .instalments .instalments__title {
        margin: 15px 0 0;
        padding: 20px 20px 15px;
        background: var(--svetlo-seryy);
    }

    .instalments .instalments__details {
        padding: 0 20px 20px;
        background: var(--svetlo-seryy);
    }
}
