.product-detail-page {
    padding: 40px 0;
    min-height: 100vh;
    background: #fff;
}

.product-detail-page .container {
    max-width: 1440px;
    margin: 0 auto;
}

/* Хлебные крошки */
.breadcrumbs {
    font-size: 14px;
    color: #20221E7A;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: #20221E7A;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #81AD4F;
}

.breadcrumbs span {
    color: #20221EB8;
}

/* Основной лейаут */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Галерея */
.product-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-gallery-main {
    display: flex;
    gap: 24px;
}

.gallery-main {
    flex: 1;
}

.main-image-container {
    width: 100%;
    height: 586px;
    border-radius: 24px;
    background: #F8F9FA;
    overflow: hidden;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s;
}

.no-image-large {
    width: 100%;
    height: 100%;
    background: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #20221E7A;
}

.thumbnail-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 98px;
    flex-shrink: 0;
    max-height: 586px;
    overflow-y: auto;
}

.thumbnail-column::-webkit-scrollbar {
    width: 4px;
}

.thumbnail-column::-webkit-scrollbar-track {
    background: #F8F9FA;
    border-radius: 4px;
}

.thumbnail-column::-webkit-scrollbar-thumb {
    background: #20221E1A;
    border-radius: 4px;
}

.thumbnail-image {
    width: 98px;
    height: 98px;
    object-fit: cover;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
    border: 1px solid #20221E14;
}

.thumbnail-image:hover {
    border-color: #81AD4F;
    opacity: 0.9;
}

.thumbnail-image.active {
    border-color: #81AD4F;
}

/* Информация о товаре */
.product-title {
    color: #20221E;
    margin: 0 0 32px 0;
    letter-spacing: -0.02em;
    max-width: 586px;
    font-weight: 500;
    font-size: 28px;
    line-height: 120%;
}

.source-link-heading {
    font-weight: 500;
    font-size: 16px;
    line-height: 16px;
    letter-spacing: -.02em;
    margin-bottom: 16px;
    color: #81AD4F;
}

.brand-name {
    color: #20221E;
    font-weight: 500;
    margin-left: 4px;
}

/* Бейджи */
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.product-badges .badge {
    padding: 6px 8px;
    border-radius: 8px;
    background: #F8F9FA;
    color: #20221E;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -.02em;
}

.badge.recommended {
    margin-top: 24px;
    position: absolute;
    background: #20221E0A;
    color: #20221E;
    display: flex;
    gap: 12px;
    padding: 8px 12px 8px 8px;
    border-radius: 16px;
    align-items: center;
    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -.02em;
}

/* Где купить */
.where-to-buy {
    display: flex;
    margin-bottom: 32px;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
}


.brand-link-card {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
    background: #F8F9FA;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s;
    flex: 1;
    max-width: 342px;
    justify-content: space-between;
}

.brand-link-image {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-link-name {
    color: #20221E;
    font-size: 16px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: -0.02em;
}

.copy-link-button {
    margin-right: auto;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F9FA;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.copy-link-button:hover {
    background: #E9ECEF;
}

.copy-link-button:active {
    background: #DEE2E6;
}

.copy-link-button svg {
    width: 24px;
    height: 24px;
}

/* Описание */
.product-description-wrapper {
    background: #20221E0A;
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 24px;
}

.product-description p,
.product-shelf-life p,
.product-storage p,
.product-brand p,
.product-composition p,
.product-manufacturer p,
.product-country p {
    color: #20221EB8;
    margin-bottom: 16px;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -.02em;
}

.product-description-wrapper:last-child {
    margin-bottom: 0;
}

/* Пищевая ценность */
.nutrition-table {
    width: 100%;
    border-collapse: collapse;
}

.nutrition-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 400;
    font-size: 16px;
    line-height: 16px;
    letter-spacing: -.02em;
    color: #20221E7A;
}

.nutrition-table td {
    padding: 20px 16px;
    font-size: 16px;
    color: #81AD4F;
    border-bottom: 1px solid #20221E14;
}

.nutrition-table td:first-child {
    color: #20221EB8;
    font-weight: 400;
    font-size: 16px;
    line-height: 16px;
    letter-spacing: -.02em;
}

.serving-info {
    font-size: 12px;
    color: #20221E7A;
    margin-top: 24px;
    font-style: italic;
}

/* Кнопка избранного */
.favorite-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 16px 24px;
    background: #81AD4F;
    border-radius: 30px;
    color: #fff;
    font-size: 16px;
    line-height: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.favorite-button.active {
    background: #81AD4F;
    color: white;
}

.favorite-button.active svg path {
    fill: white;
    stroke: white;
}

.favorite-button svg {
    width: 20px;
    height: 20px;
}

/* Сертификаты */
.product-certificates {
    width: 100%;
}

.certificates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.certificate-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #20221E08;
    border-radius: 16px;
    padding: 10px 14px 10px 10px;
    gap: 8px;
    transition: background 0.15s;
}

.certificate-item:hover {
    background: #20221E12;
}

.certificate-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #20221EB8;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 20px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    font-family: 'Inter', sans-serif;
}

.certificate-link:hover .certificate-name {
    color: #81AD4F;
}

.certificate-icon-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.certificate-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}

.certificate-download {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.certificate-download:hover {
    background: #81AD4F1F;
}

/* Related products section */
.related-products {
    padding: 128px 0;
    background: white;
}

.related-products__container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.related-products__header {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
}

.related-products__title {
    display: flex;
    font-size: 28px;
    line-height: 32px;
    font-weight: 500;
    color: #20221E;
    gap: 12px;
    margin: 0;
    flex-direction: row;
    align-items: center;
}

.related-products__title svg {
    width: 9px;
    height: 16px;
}

.related-products__grid {
    width: 100%;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.related-products .product-card {
    background: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 220px;
    overflow: hidden;
}

.related-products .product-card__favorite {
    position: absolute;
    top: 16px;
    right: 16px;
    background: white;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 10;
}

.related-products .product-card__image {
    width: 220px;
    height: 220px;
    object-fit: cover;
    margin-bottom: 16px;
    border-radius: 24px;
}

.related-products .product-card__title {
    font-size: 16px;
    font-weight: 500;
    color: #20221EB8;
    margin: 0 0 8px 0;
    line-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
}

.related-products .product-card__description {
    font-size: 14px;
    color: #20221E7A;
    margin: 0 0 14px 0;
    line-height: 18px;
    flex: 1;
}

.related-products .product-card__footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto;
}

.related-products .product-card__btn {
    background: #81AD4F1F;
    color: #81AD4F;
    padding: 9px 26px;
    border-radius: 128px;
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}

/* Contact section */
.contact {
    width: 100%;
    padding: 0 0 128px;
    margin-top: 48px;
}

.contact__container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    flex-direction: row;
}

.contact__form-wrapper {
    background-image: url(/static/images/cta-banner-bg.png);
    border-radius: 40px;
    padding: 40px;
    color: white;
    background-size: cover;
    background-repeat: no-repeat;
    width: 1074px;
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
}

.contact__title {
    font-weight: 500;
    font-size: 28px;
    line-height: 36px;
    color: #fff;
    max-width: 600px;
}

.contact__subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 29px;
    background: #fff;
    border-radius: 128px;
    color: #81AD4F;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.contact__info {
    display: flex;
    width: 342px;
    background: #81AD4F1F;
    border-radius: 40px;
    gap: 32px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.contact__info-title {
    font-size: 18px;
    line-height: 24px;
    letter-spacing: -.02em;
    font-weight: 500;
    color: #20221EB8;
    text-align: center;
}

/* Лайтбокс */
.cert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: certFadeIn 0.18s ease;
}

@keyframes certFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cert-modal {
    position: relative;
    width: min(90vw, 1100px);
    height: 90vh;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s;
}

.cert-modal-close:hover {
    background: rgba(0, 0, 0, 0.65);
}

.cert-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.cert-modal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.cert-modal-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #20221E7A;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    background: #fff;
    z-index: 2;
}

.cert-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #81AD4F30;
    border-top-color: #81AD4F;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== АДАПТИВНОСТЬ ========== */

@media (max-width: 1440px) {
    .product-detail-page .container,
    .related-products__container,
    .contact__container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 1024px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .product-gallery-main {
        flex-direction: column;
    }

    .thumbnail-column {
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        order: 2;
        margin-top: 16px;
    }

    .thumbnail-image {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    .main-image-container {
        width: 100%;
        height: 500px;
    }

    .contact__container {
        flex-direction: column;
    }

    .contact__form-wrapper {
        width: 100%;
    }

    .contact__info {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .product-detail-page {
        padding: 20px 0;
    }

    .breadcrumbs {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .product-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .main-image-container {
        height: 350px;
    }

    .thumbnail-image {
        width: 60px;
        height: 60px;
    }

    .product-description-wrapper {
        padding: 16px;
    }

    .product-description p,
    .product-shelf-life p,
    .product-storage p,
    .product-brand p,
    .product-composition p {
        font-size: 14px;
        line-height: 18px;
        margin-bottom: 12px;
    }

    .nutrition-table th,
    .nutrition-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .nutrition-table td:first-child {
        font-size: 14px;
    }

    .where-to-buy {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-link-card {
        max-width: 100%;
    }

    .favorite-button {
        padding: 12px 20px;
        font-size: 14px;
    }

    .related-products {
        padding: 60px 0;
    }

    .related-products__title {
        font-size: 24px;
    }

    .related-products__grid {
        gap: 16px;
        justify-content: center;
    }

    .related-products .product-card {
        width: calc(50% - 8px);
        min-width: 140px;
    }

    .related-products .product-card__image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .related-products .product-card__title {
        font-size: 14px;
        min-height: 36px;
    }

    .related-products .product-card__btn {
        padding: 6px 16px;
        font-size: 12px;
    }

    .contact {
        padding: 0 0 60px;
    }

    .contact__form-wrapper {
        padding: 24px;
        height: auto;
        min-height: 260px;
    }

    .contact__title {
        font-size: 20px;
        line-height: 28px;
    }

    .contact__subtitle {
        padding: 12px 24px;
        font-size: 14px;
    }

    .contact__info {
        padding: 24px;
    }

    .contact__info-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 20px;
    }

    .main-image-container {
        height: 280px;
    }

    .thumbnail-image {
        width: 50px;
        height: 50px;
    }

    .product-badges .badge {
        font-size: 10px;
        padding: 4px 6px;
    }

    .brand-link-card {
        height: 48px;
    }

    .brand-link-image {
        width: 40px;
        height: 40px;
    }

    .brand-link-name {
        font-size: 14px;
    }

    .copy-link-button {
        width: 48px;
        height: 48px;
    }

    .product-description-wrapper {
        padding: 12px;
    }

    .nutrition-table th,
    .nutrition-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .nutrition-table td:first-child {
        font-size: 12px;
    }

    .certificate-link {
        font-size: 13px;
    }

    .related-products .product-card {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }

    .related-products__grid {
        justify-content: center;
    }

    .contact__form-wrapper {
        padding: 20px;
    }

    .contact__title {
        font-size: 18px;
        line-height: 24px;
    }

    .contact__subtitle {
        padding: 10px 20px;
        font-size: 13px;
    }

    .contact__info {
        padding: 20px;
    }

    .contact__info-title {
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    .product-title {
        font-size: 18px;
    }

    .main-image-container {
        height: 240px;
    }

    .thumbnail-image {
        width: 45px;
        height: 45px;
    }

    .product-description p,
    .product-shelf-life p,
    .product-storage p,
    .product-brand p,
    .product-composition p {
        font-size: 12px;
        line-height: 16px;
    }

    .nutrition-table th,
    .nutrition-table td {
        padding: 6px 8px;
        font-size: 11px;
    }

    .certificate-link {
        font-size: 12px;
    }

    .favorite-button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

.nutrition-section-title {
    border-bottom: none !important;
    color: #20221E !important;
}

.nutrition-footnote {
    margin-top: 16px;
    color: #20221E7A;
    font-weight: 500;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -.02em;
}

.product-description-wrapper h3 {
    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: -.02em;
    margin-bottom: 8px;
}

.percent-badge {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.brand-link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}


.brand-link-arrow {
    display: flex;
    background: white;
    height: 100%;
    width: 44px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
}