/* =========================================
   ДЕТАЛЬНАЯ СТРАНИЦА МАТЕРИАЛА (ПРЯЖИ)
========================================= */

.yarn-detail-container {
    max-width: 1300px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    font-family: 'Inter', sans-serif;
}

/* =========================================
   ВЕРХНИЙ БЛОК: ГАЛЕРЕЯ И ПАНЕЛЬ ИНФО
========================================= */
.yarn-top-section {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 60px;
}

.yarn-gallery {
    width: 45%;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
}

/* КОНТЕЙНЕР ДЛЯ ЛУПЫ И БЕЙДЖА */
.yarn-main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fdfafb;
    overflow: hidden;
    position: relative;
    cursor: crosshair; 
}

.yarn-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    pointer-events: none; 
}

/* СТИЛИ ДЛЯ БЕЙДЖА НА ГЛАВНОМ ФОТО */
.main-image-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #df1b53;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 18px;
    border-radius: 30px; 
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    pointer-events: none; 
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.main-image-badge.hidden {
    opacity: 0;
    transform: scale(0.9);
}

.main-image-badge.gold {
    background: linear-gradient(135deg, #C59348, #FCE08B, #FFF39A, #FCE08B, #C59348);
    color: #31213e;
}

.yarn-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.thumbnail-box {
    aspect-ratio: 1 / 1;
    background: #fdfafb;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s;
}

.thumbnail-box:hover {
    opacity: 0.7;
}

.thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   ПРАВАЯ ПАНЕЛЬ ИНФОРМАЦИИ
========================================= */
.yarn-info-panel {
    width: 55%;
    display: flex;
    flex-direction: column;
}

.yarn-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 700;
    color: #4a3c5a;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.yarn-brand-label {
    font-size: 13px;
    color: #888888;
    margin: 0 0 5px 0;
}

.yarn-short-desc {
    font-size: 15px;
    color: #333333;
    line-height: 1.6;
    margin: 0 0 20px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #eeeeee;
}

.yarn-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.stars {
    color: #ffc107;
    font-size: 18px;
    letter-spacing: 2px;
}

.reviews-count-link {
    font-size: 14px;
    color: #666666;
    text-decoration: underline;
    cursor: pointer;
}

.availability-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333333;
    margin-bottom: 25px;
}

.status-icon.green {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
}

.colors-dropdown-container {
    border: 1px solid #eeeeee;
    border-radius: 4px;
    margin-bottom: 30px;
    background: #ffffff;
}

.colors-dropdown-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fcf9fa;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    list-style: none;
}

.colors-dropdown-btn::-webkit-details-marker {
    display: none;
}

details[open] .dropdown-icon {
    transform: rotate(180deg);
}

.colors-dropdown-content {
    padding: 25px 20px;
    border-top: 1px solid #eeeeee;
}

/* =========================================
   СЕТКА ОТТЕНКОВ И SVG-АРКА С АНИМАЦИЕЙ
========================================= */
.colors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px 15px;
}

.color-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.color-circle-wrapper {
    position: relative;
    margin-bottom: 12px;
    display: inline-block;
    margin-top: 25px; 
}

.curved-badge-container {
    position: absolute;
    top: -26.5px; 
    left: 50%;
    transform: translateX(-50%);
    width: 160px; 
    height: 160px; 
    pointer-events: none; 
    z-index: 10;
    transition: transform 0.2s;
}

@keyframes spinOrbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1080deg); }
}

.curved-badge-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: center center;
}

.color-swatch-item:hover .curved-badge-container,
.color-swatch-item.active .curved-badge-container {
    transform: translateX(-50%) scale(1.05);
}

.color-swatch-item:hover .curved-badge-svg,
.color-swatch-item.active .curved-badge-svg {
    animation: spinOrbit 0.8s ease-in-out;
}

.color-circle {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.color-swatch-item:hover .color-circle,
.color-swatch-item.active .color-circle {
    transform: scale(1.05);
}

.color-swatch-item.active .color-circle {
    border-color: #df1b53; 
}

.color-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-name {
    font-size: 13px;
    color: #333333;
    font-weight: 600;
    line-height: 1.3;
}

.color-code {
    font-size: 12px;
    color: #888888;
    margin-top: 2px;
}

/* =========================================
   ОСТАЛЬНЫЕ БЛОКИ И ССЫЛКИ
========================================= */
.yarn-cta-box {
    background: #fff2f4;
    padding: 20px;
    border-radius: 6px;
    border-left: 5px solid #fb5a6c;
    margin-bottom: 40px;
}

.yarn-cta-box p {
    font-size: 14px;
    color: #333333;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

/* Стили для новых инлайн ссылок в блоке CTA */
.cta-inline-link {
    color: #936098;
    text-decoration: none;
    border-bottom: 1px solid rgba(147, 96, 152, 0.4);
    transition: all 0.2s ease;
}

.cta-inline-link:hover {
    color: #df1b53;
    border-bottom-color: #df1b53;
}

.btn-primary-action {
    display: inline-block;
    background: #936098;
    color: #ffffff;
    padding: 14px 25px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
    width: 100%;
    border: none;
    cursor: pointer;
}

.btn-primary-action:hover {
    background: #7b4a80;
}

.product-description-block {
    margin-bottom: 30px;
}

.section-header-red {
    background-color: #e5d9e0; 
    color: #333333;
    font-weight: 700;
    font-size: 16px;
    padding: 12px 15px;
    border-left: 6px solid #fb5a6c; 
    margin-bottom: 20px;
}

.long-desc {
    font-size: 14px;
    color: #444444;
    line-height: 1.7;
    margin: 0;
}

/* =========================================
   НИЖНИЙ БЛОК: ТАБЛИЦЫ
========================================= */
.yarn-bottom-section {
    padding-top: 30px;
    border-top: 1px solid #eeeeee;
}

.info-block {
    margin-bottom: 60px;
}

.specs-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 50px;
    row-gap: 15px;
}

.spec-row {
    display: flex;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
}

.spec-label {
    width: 45%;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
}

.spec-value {
    width: 55%;
    font-size: 14px;
    color: #555555;
}

/* =========================================
   МОДУЛЬ ОТЗЫВОВ
========================================= */
.reviews-module {
    margin-top: 60px;
}

.reviews-main-heading {
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 25px;
}

.reviews-pulse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 40px;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 30px;
}

.pulse-left {
    display: flex;
    gap: 30px;
    align-items: center;
}

.pulse-summary {
    text-align: center;
}

.pulse-score {
    font-size: 56px;
    font-weight: 700;
    color: #4a3c5a;
    line-height: 1;
}

.stars-big {
    color: #ffc107;
    font-size: 20px;
    letter-spacing: 2px;
    margin: 5px 0;
}

.pulse-count {
    font-size: 12px;
    color: #888888;
}

.pulse-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 180px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #555555;
}

.bar-label {
    width: 20px;
}

.bar-track {
    flex-grow: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #ffc107;
    transition: width 0.3s;
}

.bar-count {
    width: 20px;
    text-align: right;
}

.pulse-metrics {
    display: flex;
    gap: 40px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 11px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse-cta {
    text-align: center;
    width: 250px;
}

.cta-prompt-title {
    font-size: 15px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.cta-prompt-copy {
    font-size: 13px;
    color: #888888;
    margin: 0 0 15px 0;
}

.br-write-review-btn {
    background: #936098;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
}

.br-write-review-btn:hover {
    opacity: 0.9;
}

.new-review-form {
    background: #fdfafb;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #eeeeee;
    animation: fadeIn 0.3s ease-in-out;
}

.new-review-form.hidden {
    display: none;
}

.new-review-form h3 {
    margin: 0 0 15px 0;
    color: #333333;
}

.review-input, .review-textarea {
    width: 100%;
    border: 1px solid #cccccc;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 14px;
}

.review-textarea {
    min-height: 100px;
    resize: vertical;
}

.reviews-highlights {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.highlights-label {
    font-size: 11px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
}

.highlights-drivers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.driver-pill {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #555555;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

.driver-pill:hover {
    border-color: #936098;
}

.reviews-tabs-wrapper {
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 20px;
}

.br-tabs {
    display: flex;
    gap: 30px;
}

.br-tab {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #888888;
    padding-bottom: 10px;
    cursor: pointer;
}

.br-tab.active {
    color: #333333;
    border-bottom: 3px solid #333333;
}

.tab-count {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 5px;
}

.br-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.br-toolbar-filters {
    display: flex;
    gap: 8px;
}

.filter-pill-btn {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #555555;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}

.br-toolbar-actions {
    display: flex;
    gap: 15px;
}

.br-search-input {
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 13px;
    width: 250px;
}

.br-sort-select {
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
}

.reviews-list-container {
    display: flex;
    flex-direction: column;
}

.br-review-card {
    border-bottom: 1px solid #eeeeee;
    padding: 30px 0;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.br-review-card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.br-avatar {
    width: 44px;
    height: 44px;
    background: #f5f5f5;
    color: #555555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-right: 15px;
}

.br-info {
    flex-grow: 1;
}

.br-top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.br-author {
    font-size: 15px;
    font-weight: 700;
    color: #333333;
}

.br-date {
    font-size: 13px;
    color: #999999;
}

.br-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.br-stars-small {
    color: #ffc107;
    font-size: 14px;
    letter-spacing: 2px;
}

.br-verified-badge {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
}

.br-review-title {
    font-size: 16px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 10px 0;
}

.br-review-body p {
    font-size: 15px;
    color: #555555;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.br-review-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.br-tag {
    background: #fdfafb;
    border: 1px solid #eeeeee;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #666666;
}

.br-review-actions {
    display: flex;
    gap: 15px;
}

.br-action-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #888888;
    cursor: pointer;
}

.br-action-btn:hover {
    color: #fb5a6c;
}

.br-footer-pagination {
    text-align: center;
    margin-top: 40px;
}

.br-show-more {
    background: #ffffff;
    color: #936098;
    border: 1px solid #936098;
    padding: 12px 35px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.br-show-more:hover {
    background: #fcf9fa;
}

/* =========================================
   МОДУЛЬ ЗАКАЗА ИЗДЕЛИЙ ИЗ ПРЯЖИ (INLINE)
========================================= */
#yarn-order-module {
    position: relative;
    transition: all 0.3s ease;
}

.inline-order-icons {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(251, 90, 108, 0.4);
    animation: slideDownFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.inline-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.inline-order-header h4 {
    margin: 0;
    font-size: 16px;
    color: #4a3c5a;
    font-weight: 700;
}

.btn-close-inline {
    background: none;
    border: none;
    font-size: 24px;
    color: #888888;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s;
}

.btn-close-inline:hover {
    color: #df1b53;
}

.inline-icons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.inline-prod-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    width: 70px;
}

.inline-prod-btn:hover {
    transform: translateY(-3px);
}

.inline-icon-bg {
    width: 56px;
    height: 56px;
    background: #ffffff;
    border: 2px solid #eeeeee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.inline-prod-btn:hover .inline-icon-bg {
    border-color: #936098;
    background: #fdfafb;
    box-shadow: 0 4px 10px rgba(147, 96, 152, 0.2);
}

.inline-prod-btn .icon-mask {
    width: 32px;
    height: 32px;
    background-color: #666666;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    transition: background-color 0.2s;
}

.inline-prod-btn:hover .icon-mask {
    background-color: #936098;
}

.inline-prod-btn span {
    font-size: 12px;
    font-weight: 600;
    color: #555555;
    transition: color 0.2s;
}

.inline-prod-btn:hover span {
    color: #936098;
}

/* =========================================
   АДАПТИВНОСТЬ
========================================= */
@media screen and (max-width: 992px) {
    .yarn-top-section {
        flex-direction: column;
    }
    .yarn-gallery, .yarn-info-panel {
        width: 100%;
        position: relative;
    }
    .specs-table {
        grid-template-columns: 1fr;
    }
    .reviews-pulse-header {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }
    .pulse-metrics {
        width: 100%;
        justify-content: space-around;
    }
    .pulse-cta {
        width: 100%;
    }
}
@media screen and (max-width: 768px) {
    .panel-inner-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .panel-left-side, .panel-middle-side, .panel-right-side {
        width: 100%;
        align-items: center;
        justify-content: center;
    }
}
@media screen and (max-width: 576px) {
    .yarn-thumbnails-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .colors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .br-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .br-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}