/** ---------- ITEM CARD ---------- **/
/* Карточка товара нужна и списку каталога, и блоку товаров под статьёй блога,
   поэтому её стили вынесены из catalog.css в отдельный компонент. */

.card {
    position: relative;
    padding: 10px;
    overflow: hidden;
    border-radius: 20px;

    height: 550px;

    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.card:before {
    content: "";
    position: absolute;
    inset: 0;
    background: url(/images/ui/banner.dce1dfce49ec3dab6812.avif) center / cover no-repeat;
    opacity: 0.3;
    z-index: -1;
    transition: opacity 0.25s linear;
}

.card:hover:before {
    opacity: 0.15;
}

.card__image {
    width: 100%;
    height: 300px;
    min-height: 300px;

    border-radius: 20px;

    overflow: hidden;
}

.card__image-link {
    display: block;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 0% 10%;
}

.card__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    justify-content: space-between;
    height: 100%;
}

.card__text {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card__name {
    color: var(--color-text-primary);
    font-size: 22px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card__description {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.75;
}

.card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card__price {
    font-size: 22px;
    font-weight: 700;
}

.card__link {
    flex-shrink: 0;
}

@media only screen and (max-width: 640px) {
    .card {
        height: fit-content;
    }

    .card__link {
        text-align: center;
    }

    .card__price {
        font-size: 16px;
    }
}

.product {
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product__title-block,
.product__description-block,
.product__price-block {
    position: relative;
}

.product__skeleton {
    display: block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #e8dcc9 0%, #f6efe5 50%, #e8dcc9 100%);
    background-size: 200% 100%;
    animation: productSkeletonPulse 1.5s ease-in-out infinite;
}

.product__skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%);
    animation: productSkeletonShimmer 1.8s ease-in-out infinite;
}

.product__skeleton-lines {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.product__skeleton--line {
    height: 18px;
    border-radius: 999px;
}

.product__skeleton--line-wide {
    width: 100%;
}

.product__skeleton--line-medium {
    width: 72%;
}

.product__skeleton--line-short {
    width: 54%;
}

.product__skeleton--image {
    position: absolute;
    inset: 0;
    border-radius: 20px;
}

.product__skeleton--thumb {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.product__skeleton--price {
    width: 160px;
    height: 38px;
    border-radius: 999px;
}

.product__skeleton-lines--title .product__skeleton--line {
    height: 24px;
}

.product__skeleton-lines--description .product__skeleton--line {
    height: 16px;
}

.product-wrapper {
    display: flex;
    gap: 50px;
}

.product__image-wrapper {
    position: relative;
    height: 100%;
}

.product__image-slider {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 999px;
    background: rgba(235, 225, 208, 0.92) url(/images/ui/slider.25f23242f5ccc5cfe6ee.svg) center / 16px
        28px no-repeat;
    box-shadow: 0 10px 30px rgba(67, 35, 13, 0.14);
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        opacity 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.product__image-slider:hover {
    background-color: rgba(255, 248, 240, 0.98);
    box-shadow: 0 14px 34px rgba(67, 35, 13, 0.2);
}

.product__image-slider:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

.product__image-slider--prev {
    left: 20px;
}

.product__image-slider--next {
    right: 20px;
    transform: translateY(-50%) rotate(180deg);
}

.product__image {
    position: relative;
    width: 700px;
    height: 700px;
    max-height: 700px;
    border: 0;

    border-radius: 20px;

    overflow: hidden;
    cursor: zoom-in;
}

.product__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 10%;
}

.product-gallery-modal-wrapper {
    z-index: 120;
    background-color: rgba(0, 0, 0, 0.82);
}

.product-gallery-modal {
    --gallery-border: rgba(255, 255, 255, 0.14);
    --gallery-surface: rgba(10, 10, 10, 0.78);
    --gallery-surface-muted: rgba(255, 255, 255, 0.08);
    --gallery-surface-elevated: rgba(255, 255, 255, 0.12);
    --gallery-text-primary: rgba(255, 255, 255, 0.96);
    --gallery-text-secondary: rgba(255, 255, 255, 0.62);
    --gallery-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);

    position: relative;
    width: min(1380px, calc(100vw - 48px));
    height: min(900px, calc(100vh - 48px));
    padding: 24px;
    border: 1px solid var(--gallery-border);
    border-radius: 24px;
    background-color: var(--gallery-surface);
    box-shadow: var(--gallery-shadow);
    overflow: hidden;
}

.product-gallery-modal__close {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 3;
    border: none;
    background-color: rgba(0, 0, 0, 0);
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.product-gallery-modal__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
    padding-right: 56px;
}

.product-gallery-modal__eyebrow {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gallery-text-secondary);
}

.product-gallery-modal__title {
    font-family: var(--font-primary);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--gallery-text-primary);
}

.product-gallery-modal__content {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 20px;
    height: calc(100% - 54px);
}

.product-gallery-modal__sidebar {
    min-height: 0;
}

.product-gallery-modal__thumbs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 100%;
    overflow: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}

.product-gallery-modal__thumb {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 14px;
    background-color: var(--gallery-surface);
    overflow: hidden;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.product-gallery-modal__thumb:hover,
.product-gallery-modal__thumb.--active {
    background-color: var(--gallery-surface-muted);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.product-gallery-modal__thumb.--active {
    background-color: var(--gallery-surface-elevated);
    border-color: rgba(255, 255, 255, 0.28);
}

.product-gallery-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery-modal__viewer {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery-modal__stage {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 72px 96px;
    border: 1px solid var(--gallery-border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(6, 6, 6, 0.94));
    overflow: hidden;
    touch-action: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery-modal__stage.--zoomed {
    background: linear-gradient(180deg, rgba(24, 24, 24, 0.96), rgba(8, 8, 8, 0.98));
}

.product-gallery-modal__stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.18s ease;
    will-change: transform;
    user-select: none;
    pointer-events: none;
}

.product-gallery-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid var(--gallery-border);
    border-radius: 999px;
    background:
        rgba(200, 200, 200, 0.08) url(/images/ui/slider.25f23242f5ccc5cfe6ee.svg) center / 12px 20px no-repeat;
    transform: translateY(-50%);
    cursor: pointer;
    filter: brightness(0) invert(1);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.product-gallery-modal__nav:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.product-gallery-modal__nav--prev {
    left: 24px;
}

.product-gallery-modal__nav--next {
    right: 24px;
    transform: translateY(-50%) rotate(180deg);
}

.product-gallery-modal__controls {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 2;
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--gallery-border);
    border-radius: 14px;
    background-color: rgba(0, 0, 0, 0.42);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.product-gallery-modal__controls button {
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--gallery-text-primary);
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.product-gallery-modal__controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
}

.product-gallery-modal__controls button:disabled {
    opacity: 0.35;
    cursor: default;
}

.product__info,
.product__info-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product__info {
    justify-content: space-between;
}

.product__description {
    max-height: 400px;
    overflow: hidden;
}

.product.--loading .product__title,
.product.--loading .product__description,
.product.--loading [name="price"],
.product.--loading .product__image img,
.product.--loading .product__images-item img {
    opacity: 0;
}

.product.--loading .product__title,
.product.--loading .product__description,
.product.--loading [name="price"] {
    pointer-events: none;
}

.product.--loading .product__image,
.product.--loading .product__images,
.product.--loading .product__image-slider {
    pointer-events: none;
}

.product.--loading .product__skeleton-lines {
    display: flex;
}

.product.--loading .product__skeleton--price {
    display: block;
}

.product:not(.--loading) .product__skeleton,
.product:not(.--loading) .product__skeleton-lines {
    display: none;
}

.product__description.--collapsible:not(.--expanded) {
    -webkit-mask-image: linear-gradient(
        to bottom,
        #000 0,
        #000 calc(100% - 72px),
        transparent 100%
    );
    mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 72px), transparent 100%);
}

.product__info-more {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.75;
    cursor: pointer;
}

.product__info-more:hover {
    opacity: 1;
    text-decoration: underline;
}

.product__images {
    display: flex;
    overflow: auto;
    gap: 20px;
}

.product__images-item {
    min-width: 80px;
    min-height: 80px;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;

    opacity: 0.6;

    cursor: pointer;
}

.product__images-item:hover,
.product__images-item.--active {
    opacity: 1;
}

.product__images-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product__info-cta {
    display: flex;
    gap: 20px;
}

.product__price {
    background-color: var(--color-background-secondary);
    padding: 30px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    justify-content: center;

    border-radius: 20px;
}

.product__price p {
    font-size: 24px;
    font-weight: 600;
}

.product__price h3 {
    font-size: 32px;
    font-weight: 700;
}

.product__contacts {
    position: relative;
    padding: 30px;

    flex-grow: 1;

    border-radius: 20px;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product__phone {
    font-size: 30px;
    font-weight: 700;
    text-decoration: none;
}

.product__contacts-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.product__contacts-text {
    width: 150px;
    font-size: 20px;
    font-weight: 600;
}

.product__contacts:before {
    content: "";
    position: absolute;
    inset: 0;
    background: url(/images/ui/banner.dce1dfce49ec3dab6812.avif) center / cover no-repeat;
    opacity: 0.3;
    z-index: -1;
    transition: opacity 0.25s linear;
}

.product-details-modal {
    max-width: min(720px, calc(100vw - 40px));
    max-height: min(80vh, 900px);
}

.product-details-modal__description {
    font-size: 16px;
    opacity: 0.75;
}

.section__row {
    display: flex;
    gap: 40px;
}

.sidebar {
    display: flex;
    flex-direction: column;

    gap: 20px;
}

#sidebar-toggle {
    display: none;
    justify-content: center;
}

.sidebar__sections,
.sidebar__filters {
    background-color: var(--color-background-secondary);
    padding: 40px;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
    border-radius: 20px;
}

.sidebar__sections-item {
    font-size: 20px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar__sections-item.--active {
    color: var(--color-button-primary);
}

.filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter__name {
    font-size: 20px;
    font-weight: 600;
}

.number-range-slider {
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #9e978e;
}

.number-range-slider__inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.number-range-slider__field {
    display: block;
}

.number-range-slider__input {
    width: 100%;
    min-width: 0;
    padding: 20px 0px;
    border: 0;
    border-radius: 15px;
    background: var(--color-background-primary);
    color: rgb(0, 0, 0, 0.4);
    text-align: center;
    font-family: inherit;
    font-size: 18px;
    outline: none;
}

.number-range-slider__input:focus {
    box-shadow: 0 0 0 2px rgba(156, 13, 0, 0.16);
}

.number-range-slider__track {
    position: relative;
    height: 24px;
    cursor: pointer;
    touch-action: none;
}

.number-range-slider__line,
.number-range-slider__range {
    position: absolute;
    top: 50%;
    height: 8px;
    border-radius: 999px;
    transform: translateY(-50%);
}

.number-range-slider__line {
    inset-inline: 0;
    background: #d9bbb3;
}

.number-range-slider__range {
    background: #990d00;
}

.number-range-slider__thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #aa0e00;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 6px #ebe1d0;
    cursor: grab;
}

.number-range-slider__thumb:focus-visible {
    outline: 2px solid rgba(156, 13, 0, 0.35);
    outline-offset: 8px;
}

.number-range-slider__thumb:active {
    cursor: grabbing;
}

.number-range-slider__labels {
    position: relative;
    height: 30px;
}

.number-range-slider__label {
    position: absolute;
    top: 0;
    color: rgb(0, 0, 0, 0.35);
    transform: translateX(-50%);
    white-space: nowrap;
}

.catalog__items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.catalog__pagination {
    margin-top: 32px;
}

.catalog__pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.catalog__pagination-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.catalog__pagination-button,
.catalog__pagination-nav {
    min-width: 48px;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    background: var(--color-background-secondary);
    color: var(--color-text-primary);
    font-size: 16px;
    font-weight: 600;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.catalog__pagination-button.--active {
    background: #aa0e00;
    border-color: #aa0e00;
    color: #fff;
}

.catalog__pagination-button:disabled,
.catalog__pagination-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.catalog__pagination-gap {
    color: rgba(0, 0, 0, 0.45);
    font-size: 18px;
    font-weight: 600;
}

.catalog__status {
    min-height: 240px;
    background-color: var(--color-background-secondary);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
}

.catalog__status.--error {
    color: var(--color-button-primary);
}

@keyframes productSkeletonPulse {
    0%,
    100% {
        background-position: 200% 0;
    }

    50% {
        background-position: 0 0;
    }
}

@keyframes productSkeletonShimmer {
    100% {
        transform: translateX(100%);
    }
}

@media only screen and (max-width: 1900px) {
    .product__price p {
        font-size: 20px;
    }

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

    .product__contacts-text {
        width: fit-content;
        font-size: 16px;
    }

    .product__phone {
        font-size: 24px;
    }
}

@media only screen and (max-width: 1500px) {
    .product__image {
        width: 600px;
        min-height: 600px;
        max-height: 1000px;
    }
}

@media only screen and (max-width: 1400px) {
    .product__price p {
        font-size: 18px;
    }

    .product__price h3 {
        font-size: 20px;
    }

    .product__phone {
        font-size: 20px;
    }

    .catalog__items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 1300px) {
    .product__description {
        max-height: 250px;
    }

    .product__info-cta {
        flex-direction: column;
    }
}

@media only screen and (max-width: 1200px) {
    .product__image {
        width: 400px;
        min-height: 400px;
        max-height: 1000px;
    }

    .product__image:after {
        content: '';
        position: absolute;
        right: 24px;
        top: 24px;
        background-image: url(/images/ui/expand.e6f4971852c9c00dc7d6.svg);
        background-repeat: no-repeat;
        background-size: contain;
        width: 20px;
        height: 20px;   
    }
}

@media only screen and (max-width: 1060px) {
    .product {
        padding-bottom: 40px;
    }
}

@media only screen and (max-width: 1050px) {
    .catalog__items {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media only screen and (max-width: 900px) {
    .product {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .product__image-slider {
        width: 48px;
        height: 48px;
    }

    .sidebar__sections-item {
        font-size: 16px;
    }

    .product-wrapper {
        display: contents;
    }

    .product__image {
        width: 100%;
    }

    .product__image-wrapper {
        grid-row: 1;
    }

    .product__images {
        grid-row: 2;
    }

    .product__info {
        grid-row: 3;
    }

    .product__description {
        max-height: 250px;
    }

    .product-gallery-modal {
        width: 100vw;
        height: 100vh;
        padding: 16px;
        border-radius: 0;
    }

    .product-gallery-modal__content {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        height: calc(100% - 62px);
    }

    .product-gallery-modal__sidebar {
        order: 2;
    }

    .product-gallery-modal__thumbs {
        flex-direction: row;
        max-width: 100%;
        padding-right: 0;
        padding-bottom: 6px;
    }

    .product-gallery-modal__thumb {
        width: 76px;
        min-width: 76px;
    }

    .product-gallery-modal__nav {
        width: 40px;
        height: 40px;
    }

    .product-gallery-modal__nav--prev {
        left: 12px;
    }

    .product-gallery-modal__nav--next {
        right: 12px;
    }

    .product__description.--expanded {
        max-height: none;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .product__info-cta {
        flex-direction: column;
    }

    .product__contacts-row {
        flex-wrap: wrap;
    }

    .section__row {
        flex-direction: column;
    }

    #sidebar-toggle {
        display: flex;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar:not(.--expanded) {
        display: none;
    }

    .sidebar__sections,
    .sidebar__filters {
        width: 100%;
    }

    .catalog__items {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-details-modal {
        max-width: none;
        max-height: none;
    }

    .product__image {
        height: 400px;
    }

    .product-gallery-modal__header {
        gap: 2px;
        margin-bottom: 16px;
    }

    .product-gallery-modal__title {
        font-size: 20px;
    }

    .product-gallery-modal__stage {
        padding: 64px 56px;
    }
}

@media only screen and (max-width: 640px) {
    .product {
        padding-top: 0;
    }

    .product__image-slider {
        transform: none;
    }

    .product__image-slider--prev {
        left: 16px;
    }

    .product__image-slider--next {
        right: 16px;
        transform: rotate(180deg);
    }

    .product-gallery-modal__controls {
        right: 12px;
        bottom: 12px;
    }

    .product-gallery-modal__controls button {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .product-gallery-modal {
        padding: 12px;
    }

    .product-gallery-modal__close {
        top: 20px;
        right: 20px;
        width: 24px;
        height: 24px;
    }

    .product-gallery-modal__header {
        margin-bottom: 12px;
        padding-right: 44px;
    }

    .product-gallery-modal__eyebrow {
        font-size: 11px;
    }

    .product-gallery-modal__title {
        font-size: 18px;
    }

    .product-gallery-modal__content {
        gap: 12px;
        height: calc(100% - 52px);
    }

    .product-gallery-modal__stage {
        padding: 52px 40px 72px;
        border-radius: 16px;
    }

    .product-gallery-modal__nav--prev {
        left: 10px;
    }

    .product-gallery-modal__nav--next {
        right: 10px;
    }

    .product-gallery-modal__thumb {
        width: 68px;
        min-width: 68px;
        border-radius: 12px;
    }

    .number-range-slider__inputs {
        grid-template-columns: 1fr;
    }

    .number-range-slider__input {
        padding-block: 10px;
        font-size: 18px;
    }

    .number-range-slider__label {
        font-size: 20px;
    }

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

    .catalog__status {
        font-size: 16px;
    }
}

