/*
 * Стили содержимого страницы товара.
 * Общие стили сайта, header, footer и хлебные крошки сюда не входят.
 */

.product-page {
    --product-border: #dfe4e7;
    --product-muted: #767f84;
    --product-shadow: -3px 8px 28px rgba(22, 22, 22, 0.1);

    color: var(--text-color);
    background: var(--bg-color);
    font-family: var(--font-family);
}

.product-page *,
.product-page *::before,
.product-page *::after {
    box-sizing: border-box;
}

.product-page img {
    display: block;
    max-width: 100%;
}

.product-page a {
    color: inherit;
    text-decoration: none;
}

.product-page h1,
.product-page h2 {
    font-family: var(--title-font);
    font-weight: 400;
    text-transform: uppercase;
}

.product-main-section {
    padding: 45px 0 100px;
}

/* Галерея и информация о товаре */
.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    gap: 68px;
    align-items: start;
}

.gallery-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 570px;
    padding: 45px;
    overflow: hidden;
    background: var(--white);
    border-radius: var(--border-radius-big);
}

.gallery-stage::before {
    content: '';
    position: absolute;
    right: -85px;
    bottom: -120px;
    width: 390px;
    height: 390px;
    background: #e7f1f6;
    border-radius: 50%;
}

.gallery-stage > img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 480px;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.gallery-stage > img.changing {
    opacity: 0.35;
}

.zoom-btn {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    background: var(--white);
    border: 0;
    border-radius: 50%;
    box-shadow: var(--product-shadow);
    cursor: pointer;
}

.zoom-btn svg {
    width: 21px;
    fill: none;
    stroke: var(--text-color);
    stroke-width: 1.7;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.gallery-thumb {
    height: 155px;
    padding: 8px;
    overflow: hidden;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 18px;
    cursor: pointer;
}

.gallery-thumb.active {
    border-color: var(--theme-color);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 11px;
}

.product-summary {
    padding-top: 12px;
}

.product-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #8a8a8a;
    font-size: 11px;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    color: #2c8f45;
    background: #eaf7ed;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stock-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
}

.product-summary h1 {
    margin: 28px 0 32px;
    font-size: clamp(46px, 4.5vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.025em;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 24px 0;
    border-top: 1px solid var(--product-border);
    border-bottom: 1px solid var(--product-border);
}

.price-value {
    font-family: var(--title-font);
    font-size: 46px;
    line-height: 1;
}

.price-unit {
    color: var(--product-muted);
    font-size: 12px;
}

.product-order-button {
    width: 100%;
    margin-top: 24px;
}

.product-description {
    margin-top: 30px;
    color: #4f565a;
    font-size: 15px;
    line-height: 1.85;
    white-space: pre-line;
}

/* Характеристики */
.product-specifications {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 80px;
    margin-top: 90px;
    padding-top: 55px;
    border-top: 1px solid var(--product-border);
}

.specifications-heading > span,
.product-cta-copy > span,
.related-header > div > span,
.modal-caption {
    display: block;
    margin-bottom: 10px;
    color: var(--theme-color);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.specifications-heading h2 {
    margin: 0;
    font-size: clamp(37px, 4vw, 56px);
    line-height: 1;
}

.specification-table {
    margin: 0;
    border-top: 1px solid var(--product-border);
}

.spec-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 25px;
    padding: 20px 0;
    border-bottom: 1px solid var(--product-border);
}

.spec-row dt {
    color: #626a6e;
}

.spec-row dd {
    margin: 0;
    font-weight: 600;
}

/* CTA */
.product-cta {
    padding: 90px 0;
    color: var(--white);
}

.product-cta-grid {
    display: grid;
    grid-template-columns: 1fr 0.9fr;
    gap: 90px;
    align-items: center;
}

.product-cta-copy > span {
    color: #d9ebf7;
}

.product-cta-copy h2 {
    max-width: 690px;
    margin: 0 0 20px;
    font-size: clamp(39px, 4vw, 60px);
    line-height: 1.08;
}

.product-cta-copy p {
    max-width: 630px;
    margin: 0;
    color: #e3eef5;
}

.product-cta-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.product-cta-form label span {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
}

.product-cta-form input,
.product-cta-form textarea {
    width: 100%;
    padding: 15px 17px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--border-radius-small);
    outline: 0;
}

.product-cta-form input::placeholder,
.product-cta-form textarea::placeholder {
    color: #d9e7ee;
}

.product-cta-form textarea {
    min-height: 105px;
    resize: vertical;
}

.form-wide {
    grid-column: 1 / -1;
}

/* Похожие товары */
.related-products {
    padding: 100px 0;
}

.related-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.related-header h2 {
    margin: 0;
    font-size: clamp(36px, 4vw, 52px);
}

.related-header > a {
    color: var(--theme-color);
    font-size: 13px;
    font-weight: 600;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 40px;
}

.related-card {
    overflow: hidden;
    background: var(--white);
    border-radius: 24px;
    transition: 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--product-shadow);
}

.related-image {
    display: grid;
    place-items: center;
    height: 235px;
    color: #c2d7e2 !important;
    background: linear-gradient(145deg, #eef4f7, #d8e7ee);
    font-family: var(--title-font);
    font-size: 64px;
}

.related-card-body {
    padding: 24px;
}

.related-card-body > span {
    color: var(--theme-color);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.related-card h3 {
    min-height: 52px;
    margin: 12px 0 18px;
    font-size: 17px;
    line-height: 1.45;
}

.related-link {
    color: var(--theme-color) !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Модальные окна */
.product-modal,
.product-image-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--font-family);
}

.product-modal.open,
.product-image-modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 19, 24, 0.72);
    backdrop-filter: blur(5px);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(500px, 100%);
    padding: 42px;
    background: var(--white);
    border-radius: 28px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
}

.modal-dialog h2 {
    margin: 0 0 10px;
    font-size: 40px;
}

.modal-caption {
    color: var(--theme-color);
}

.modal-dialog > p {
    color: var(--product-muted);
    font-size: 13px;
}

.modal-close,
.image-modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 32px;
    cursor: pointer;
}

.modal-form {
    display: grid;
    gap: 11px;
    margin-top: 25px;
}

.modal-form input,
.modal-form textarea {
    width: 100%;
    padding: 15px 17px;
    color: var(--text-color);
    background: var(--bg-grey);
    border: 1px solid var(--product-border);
    border-radius: var(--border-radius-small);
    outline: 0;
}

.modal-form textarea {
    min-height: 100px;
    resize: vertical;
}

.product-image-modal {
    z-index: 1100;
    padding: 4vw;
    background: rgba(7, 15, 19, 0.92);
}

.product-image-modal img {
    max-width: 90vw;
    max-height: 86vh;
    object-fit: contain;
}

.image-modal-close {
    top: 18px;
    right: 28px;
    color: var(--white);
    font-size: 40px;
}

/* Адаптивность */
@media (max-width: 1050px) {
    .product-layout {
        grid-template-columns: 1fr 1fr;
        gap: 35px;
    }

    .gallery-stage {
        min-height: 500px;
    }

    .product-specifications {
        gap: 45px;
    }

    .product-cta-grid {
        gap: 45px;
    }
}

@media (max-width: 850px) {
    .product-layout,
    .product-specifications,
    .product-cta-grid {
        grid-template-columns: 1fr;
    }

    .product-specifications {
        gap: 30px;
    }

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

    .related-card:last-child {
        display: none;
    }
}

@media (max-width: 600px) {
    .product-page .container {
        width: 100%;
        padding-right: 18px;
        padding-left: 18px;
    }

    .product-main-section,
    .related-products {
        padding: 55px 0;
    }

    .gallery-stage {
        min-height: 355px;
        padding: 24px;
        border-radius: 24px;
    }

    .gallery-stage > img {
        height: 305px;
    }

    .gallery-thumbs {
        gap: 8px;
    }

    .gallery-thumb {
        height: 90px;
        border-radius: 13px;
    }

    .product-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .product-summary h1 {
        margin-top: 22px;
        font-size: 42px;
    }

    .product-specifications {
        margin-top: 60px;
        padding-top: 40px;
    }

    .product-cta {
        padding: 65px 0;
    }

    .product-cta-form,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .form-wide {
        grid-column: auto;
    }

    .related-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .related-card:last-child {
        display: block;
    }

    .modal-dialog {
        padding: 34px 24px;
    }
}
