/* Общие стили для страницы продукта */
.product-page {
    background-color: #ffffff;
    min-height: 100vh;
    font-family: 'Gramatika', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
}

/* Стили для header (такие же, как на странице каталога) */
.catalog-header {
    width: 100%;
    padding: 20px 0;
    border-bottom: 1px solid #000000;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo a {
    font-size: 24px;
    font-weight: bold;
    color: #000000;
    text-decoration: none;
    text-transform: uppercase;
}

.header-menu {
    display: flex;
    gap: 30px;
}

.menu-item {
    color: #000000;
    text-decoration: none;
    font-size: 12px;
    transition: opacity 0.3s;
}

.menu-item:visited,
.menu-item:active,
.menu-item:focus {
    color: #000000;
}

.menu-item:hover {
    opacity: 0.7;
}

.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    text-decoration: none;
}

.icon-link img,
.icon-link svg {
    width: 20px;
    height: 20px;
}

.icon-link svg path {
    stroke: #000000;
}

/* Счетчик корзины */
.cart-icon {
    position: relative;
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #000000;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    padding: 0;
    margin: 0;
}

/* Первая часть: Галерея и функциональный блок */
.product-main-section {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Галерея изображений (70% ширины) */
.product-gallery {
    width: 70%;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    overflow: hidden;
    position: relative;
    align-content: flex-start;
}

.gallery-item {
    width: 50%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
    /* Вычисляем высоту на основе ширины (квадрат) */
    padding-bottom: 50%;
    height: 0;
}

.gallery-item:nth-child(odd) {
    /* Нечетные элементы - обычное расположение */
}

.gallery-item:nth-child(even) {
    /* Четные элементы - на том же уровне */
    margin-top: 0;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Функциональный блок (30% ширины) */
.product-info-block {
    width: 30%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid #000000;
    border-top: none;
}

/* Хлебные крошки */
.product-breadcrumbs {
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
    color: #666666;
}

.product-breadcrumbs a {
    color: #666666;
    text-decoration: none;
}

.product-breadcrumbs a:hover {
    text-decoration: underline;
}

/* Название продукта */
.product-title {
    font-size: 24px;
    font-weight: normal;
    color: #000000;
    margin: 0 0 20px 0;
    text-align: left;
}

/* Цена */
.product-price {
    text-align: center;
    font-size: 20px;
    color: #000000;
    margin-bottom: 20px;
    font-weight: normal;
}

/* Горизонтальная черта */
.product-divider {
    width: 100%;
    border: none;
    border-top: 1px solid #000000;
    margin: 20px 0;
    box-sizing: border-box;
}

/* Горизонтальная черта на всю ширину (только для черты над описанием) */
.product-divider-full {
    width: calc(100% + 80px);
    margin: 20px -40px;
}

/* Значения таксономий */
.product-taxonomies {
    margin-bottom: 30px;
}

.taxonomy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.taxonomy-label {
    color: #666666;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: normal;
}

.taxonomy-value {
    color: #000000;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: normal;
}

.product-size-select {
    background-color: transparent;
    border: none;
    color: #000000;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: normal;
    font-family: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 20px;
    min-width: 150px;
}

.product-size-select:hover {
    opacity: 0.7;
}

.product-size-select:focus {
    outline: none;
}

.product-size-select option {
    background-color: #ffffff;
    color: #000000;
    padding: 10px;
    text-transform: uppercase;
}

.taxonomy-divider {
    width: 100%;
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 5px 0;
}

/* Кнопки */
.product-buttons {
    margin-bottom: 30px;
}

.buttons-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 15px;
    border: 1px solid #000000;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
}

.btn-add-to-cart {
    flex: 1;
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.3s;
    border-radius: 0;
    min-width: 0;
}

.btn-add-to-cart:hover {
    opacity: 0.8;
}

.btn-fav-wrapper {
    width: auto;
    min-width: 50px;
    max-width: 60px;
    background-color: #ffffff;
    height: auto;
    display: flex;
    align-items: stretch;
    border-left: 1px solid #ffffff;
    flex-shrink: 0;
    flex-grow: 0;
}

.btn-favorite {
    background-color: #000000;
    border: none;
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    border-radius: 0;
}

.btn-favorite:hover {
    opacity: 0.8;
}

.btn-favorite img {
    width: 20px;
    height: 18px;
    filter: brightness(0) invert(1);
    stroke: #ffffff;
}

.btn-favorite.active img {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%);
}

.btn-consultation {
    width: 100%;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    padding: 15px 20px;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 0;
}

.btn-consultation:hover {
    background-color: #000000;
    color: #ffffff;
}

/* Описание */
.product-description {
    margin-top: 20px;
}

.description-title {
    font-size: 18px;
    font-weight: normal;
    color: #000000;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.description-text {
    font-size: 14px;
    color: #000000;
    line-height: 1.6;
}

.description-text p {
    margin: 0 0 15px 0;
}

.description-text p:last-child {
    margin-bottom: 0;
}

/* Вторая часть: Карусели */
.product-collection-section,
.product-related-section {
    width: 100%;
    padding: 60px 40px;
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: normal;
    color: #000000;
    margin: 0 0 40px 0;
    text-transform: uppercase;
}

.products-carousel-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}

.products-carousel {
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
    scroll-behavior: smooth;
}

.products-carousel .product-card {
    width: 25%;
    flex: 0 0 25%;
    flex-shrink: 0;
    border: 1px solid #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.products-carousel .product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.products-carousel .product-card .product-info {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.products-carousel .product-card .product-name {
    font-size: 18px;
    font-weight: normal;
    color: #000000;
    text-align: center;
    margin: 0;
    padding-top: 20px;
}

.products-carousel .product-card .product-bottom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 15px 0;
    position: relative;
}

.products-carousel .product-card .product-price {
    font-size: 16px;
    color: #000000;
    text-align: center;
    margin: 0;
}

.products-carousel .product-card .product-fav-btn {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: opacity 0.3s;
}

.products-carousel .product-card .product-fav-btn:hover {
    opacity: 0.7;
}

.products-carousel .product-card .product-fav-btn svg {
    width: 20px;
    height: 18px;
}

.products-carousel .product-card .product-fav-btn svg path {
    stroke: #000000;
    fill: none;
    transition: fill 0.3s;
}

.products-carousel .product-card .product-fav-btn.active svg path {
    fill: #000000;
    stroke: #000000;
}

.carousel-btn {
    background: none;
    border: none;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.carousel-btn:hover {
    opacity: 0.7;
}

.carousel-btn:hover svg path {
    stroke: #000000;
}

.carousel-btn svg {
    width: 48px;
    height: 48px;
}

.carousel-btn svg path {
    stroke: #000000;
    transition: stroke 0.3s;
}

/* Попап консультации */
.consultation-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.consultation-popup.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.popup-content {
    position: relative;
    background-color: #ffffff;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.popup-close:hover {
    opacity: 0.7;
}

.popup-close svg {
    width: 24px;
    height: 24px;
}

.popup-title {
    font-size: 24px;
    font-weight: normal;
    color: #000000;
    margin: 0 0 30px 0;
    text-transform: uppercase;
}

.consultation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #000000;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid #000000;
    font-size: 14px;
    color: #000000;
    background-color: #ffffff;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000000;
}

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

.btn-submit {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    opacity: 0.8;
}

/* Чекбокс согласия */
.form-group-consent {
    margin-top: 10px;
}

.consent-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.5;
}

.consent-checkbox-label:hover {
    opacity: 0.8;
}

.consent-checkbox-label input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.consent-checkbox-text {
    color: #000000;
    font-size: 12px;
    line-height: 1.5;
}

.consent-checkbox-text a {
    color: #000000;
    text-decoration: underline;
    transition: opacity 0.3s;
}

.consent-checkbox-text a:hover {
    opacity: 0.7;
}

/* Спиннер загрузки */
.consultation-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 16px;
    color: #000000;
    margin: 0;
    text-transform: uppercase;
}

/* Сообщение об успехе */
.consultation-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    border: 3px solid #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    background-color: #ffffff;
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

.success-title {
    font-size: 28px;
    font-weight: normal;
    color: #000000;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.success-message {
    font-size: 16px;
    color: #000000;
    margin: 0;
    line-height: 1.5;
}

/* Сообщение об ошибке */
.consultation-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    border: 3px solid #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    background-color: #ffffff;
}

.error-icon svg {
    width: 40px;
    height: 40px;
}

.error-title {
    font-size: 28px;
    font-weight: normal;
    color: #000000;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.error-message {
    font-size: 16px;
    color: #000000;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.btn-retry {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.3s;
}

.btn-retry:hover {
    opacity: 0.8;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .product-main-section {
        flex-direction: column;
    }
    
    .product-gallery {
        width: 100%;
    }
    
    .product-info-block {
        width: 100%;
    }
    
    .gallery-item:nth-child(even) {
        margin-top: 0;
    }
    
    .products-carousel .product-card {
        width: 33.333%;
        flex: 0 0 33.333%;
    }
}

@media (max-width: 768px) {
    .product-info-block {
        padding: 20px;
    }
    
    .product-collection-section,
    .product-related-section {
        padding: 40px 20px;
    }
    
    .products-carousel .product-card {
        width: 50%;
        flex: 0 0 50%;
    }
    
    .popup-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .products-carousel .product-card {
        width: 100%;
        flex: 0 0 100%;
    }
    
    .gallery-item {
        width: 100%;
    }
    
    .gallery-item:nth-child(even) {
        margin-top: 0;
    }
}

