/* Product gallery layout overrides.
   Loaded after equipment-product.css so the 3:4 gallery geometry wins. */

.product-detail__hero.product-detail__hero--split {
    grid-template-columns: minmax(430px, .9fr) minmax(0, 1.1fr);
    align-items: stretch;
    gap: 16px;
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.product-detail__gallery.product-detail__gallery--card {
    min-width: 0;
    align-self: start;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    align-items: start;
    gap: 12px;
    padding: 14px 14px 20px;
    overflow: hidden;
    border: 1px solid #e1e7ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 26px rgba(16, 24, 40, .035);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .12s ease, transform .12s ease;
}

.product-detail__gallery.product-detail__gallery--card.is-variant-leaving {
    opacity: .48;
    transform: translateY(1px);
}

.product-detail__gallery.product-detail__gallery--card.is-variant-entering {
    opacity: 0;
    transform: translateY(1px);
}

.product-detail__gallery.product-detail__gallery--multi {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
}

.product-detail__gallery--card .product-detail__media {
    width: min(100%, 400px);
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
    justify-self: center;
    align-self: start;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.product-detail__gallery--card .product-detail__main-media {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .08);
}

.product-detail__gallery--card video.product-detail__main-media {
    background: #111827;
}

.product-detail__gallery--card .product-detail__media-brand {
    left: 10px;
    bottom: 8px;
}

.product-detail__media-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 7px;
    border: 1px solid rgba(218, 225, 233, .92);
    border-radius: 5px;
    background: rgba(255, 255, 255, .9);
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.product-detail__gallery--card .product-detail__thumbnails {
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.product-detail__gallery--card .product-detail__thumbnails a {
    width: 58px;
    height: auto;
    aspect-ratio: 3 / 4;
    flex: 0 0 58px;
    display: block;
    overflow: hidden;
    border: 1px solid #dde5ee;
    border-radius: 7px;
    background: #f8fafc;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.product-detail__gallery--card .product-detail__thumbnails a:hover {
    transform: translateY(-1px);
    border-color: #b9c8da;
}

.product-detail__gallery--card .product-detail__thumbnails a.is-active {
    border-color: #0864d9;
    box-shadow: 0 0 0 2px rgba(8, 100, 217, .10);
}

.product-detail__gallery--card .product-detail__thumbnails img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.product-detail__video-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #475467;
    background: linear-gradient(180deg, #f9fbfd 0%, #f2f5f8 100%);
}

.product-detail__video-thumb strong {
    color: #0864d9;
    font-size: 15px;
    line-height: 1;
}

.product-detail__video-thumb small {
    font-size: 8px;
    font-weight: 700;
}

.product-detail__side {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 14px;
    align-self: stretch;
}

.product-detail__side--single {
    grid-template-rows: auto;
}

.product-detail__panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e1e7ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 26px rgba(16, 24, 40, .035);
}

.product-detail__summary.product-detail__panel {
    justify-content: flex-start;
    padding: 28px 34px 26px;
}

.product-detail__summary.product-detail__panel h1 {
    margin: 0 0 10px;
}

.product-detail__variants {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #edf1f5;
}

.product-detail__variants > span {
    display: block;
    margin-bottom: 8px;
    color: #667085;
    font-size: 14px;
    font-weight: 700;
}

.product-detail__variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.product-detail__variant-list a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #dde5ee;
    border-radius: 7px;
    background: #ffffff;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .12s ease, background .12s ease, color .12s ease, opacity .12s ease;
}

.product-detail__variants.is-loading .product-detail__variant-list a {
    opacity: .78;
    pointer-events: none;
}

.product-detail__variant-list a:hover {
    border-color: #b9c8da;
    background: #f8fafc;
}

.product-detail__variant-list a.is-active {
    border-color: #0864d9;
    background: #f3f8ff;
    color: #0864d9;
}

.product-detail__price small {
    font-size: 14px;
}

.product-detail__marketplaces {
    margin-top: 14px;
    padding-top: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    border-top: 0;
}

.product-detail__marketplaces > span {
    display: block;
    margin: 0;
    color: #667085;
    font-size: 14px;
    font-weight: 700;
}

.product-detail__marketplace-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-detail__marketplace-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.product-detail__marketplace-link:hover {
    transform: translateY(-1px);
    filter: brightness(.985);
}

.product-detail__marketplace-link--ozon {
    background: #005bff;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(0, 91, 255, .14);
}

.product-detail__marketplace-link--ozon > span {
    display: none;
}

.product-detail__marketplace-link--yandex {
    background: #ffcc00;
    color: #111827;
    box-shadow: 0 5px 14px rgba(255, 204, 0, .16);
}

.product-detail__description.product-detail__description--side {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px 34px 26px;
}

.product-detail__description--side p {
    max-width: none;
    color: #596579;
    font-size: 15px;
    line-height: 1.65;
}

.product-detail__info-row {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #edf1f5;
}

.product-detail__info-row h2 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.3;
}

.product-detail__info-row p {
    margin: 0;
}

@media (min-width: 1001px) {
    .product-detail {
        padding: 18px 40px 48px;
    }

    .product-breadcrumbs {
        margin-bottom: 14px;
    }

    .product-detail__summary.product-detail__panel h1 {
        font-size: clamp(24px, 1.85vw, 32px);
        line-height: 1.1;
        letter-spacing: -.03em;
    }

    .product-detail__price {
        margin-top: 16px;
        padding-top: 14px;
    }

    .product-detail__price strong {
        font-size: 25px;
    }
}

@media (min-width: 1001px) and (max-height: 820px) {
    .product-detail {
        padding-top: 12px;
        padding-bottom: 32px;
    }

    .product-breadcrumbs {
        margin-bottom: 10px;
    }

    .product-detail__gallery.product-detail__gallery--card {
        gap: 10px;
        padding: 12px 12px 18px;
    }

    .product-detail__gallery--card .product-detail__media {
        width: min(100%, 365px);
    }

    .product-detail__gallery--card .product-detail__thumbnails a {
        width: 54px;
        flex-basis: 54px;
    }

    .product-detail__summary.product-detail__panel {
        padding: 22px 30px 22px;
    }

    .product-detail__description.product-detail__description--side {
        padding: 20px 30px 22px;
    }

    .product-detail__variants {
        margin-top: 12px;
        padding-top: 12px;
    }

    .product-detail__price {
        margin-top: 12px;
        padding-top: 12px;
    }

    .product-detail__marketplaces {
        margin-top: 10px;
    }
}

@media (max-width: 1180px) and (min-width: 1001px) {
    .product-detail__hero.product-detail__hero--split {
        grid-template-columns: minmax(410px, .9fr) minmax(0, 1.1fr);
    }

    .product-detail__gallery--card .product-detail__media {
        width: min(100%, 385px);
    }
}

@media (max-width: 1000px) {
    .product-detail__hero.product-detail__hero--split {
        grid-template-columns: 1fr;
    }

    .product-detail__gallery--card .product-detail__media {
        width: min(100%, 420px);
    }

    .product-detail__side {
        grid-template-rows: auto auto;
    }

    .product-detail__side--single {
        grid-template-rows: auto;
    }
}

@media (max-width: 760px) {
    .product-detail__hero.product-detail__hero--split,
    .product-detail__side {
        gap: 14px;
    }

    .product-detail__gallery.product-detail__gallery--card {
        padding: 14px;
        border-radius: 10px;
    }

    .product-detail__gallery.product-detail__gallery--multi {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .product-detail__gallery--card .product-detail__media {
        width: min(100%, 360px);
        padding: 0;
    }

    .product-detail__gallery--card .product-detail__thumbnails {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 7px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 1px 4px;
        scrollbar-width: thin;
    }

    .product-detail__gallery--card .product-detail__thumbnails a {
        width: 62px;
        flex-basis: 62px;
    }

    .product-detail__panel {
        border-radius: 10px;
    }

    .product-detail__summary.product-detail__panel,
    .product-detail__description.product-detail__description--side {
        padding: 28px 24px 30px;
    }

    .product-detail__summary.product-detail__panel h1 {
        font-size: 28px;
        line-height: 1.1;
    }

    .product-detail__marketplaces {
        display: block;
        margin-top: 20px;
        padding-top: 18px;
        border-top: 1px solid #edf1f5;
    }

    .product-detail__marketplaces > span {
        margin-bottom: 10px;
    }

    .product-detail__marketplace-list {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-detail__marketplace-link {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-detail__gallery.product-detail__gallery--card,
    .product-detail__variant-list a,
    .product-detail__marketplace-link {
        transition: none;
    }
}
