/* ===================================
   ZAMOK — Product Layout
   Общая сетка карточки товара: gallery + info, tabs, recommendations
   =================================== */

.product {
    padding: 0 0 var(--spacing-3xl);
}

/* Top block: Gallery + Info */
.product__top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
    margin-bottom: var(--spacing-2xl);
}

.product__gallery {
    position: sticky;
    top: 130px;
}

.product__info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Tabs section */
.product__tabs {
    margin-bottom: var(--spacing-2xl);
}

.product-tabs__nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--spacing-xl);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.product-tabs__nav::-webkit-scrollbar {
    display: none;
}

.product-tabs__tab {
    padding: 14px 24px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-tabs__tab:hover {
    color: var(--color-text);
}

.product-tabs__tab--active {
    color: var(--color-text);
    border-bottom-color: var(--color-primary);
}

.product-tabs__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-bg-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
}

.product-tabs__tab--active .product-tabs__tab-count {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.product-tabs__content {
    min-height: 200px;
}

.product-tabs__pane {
    display: none;
}

.product-tabs__pane--active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Description content */
.product-description {
    max-width: 800px;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.product-description p {
    margin-bottom: var(--spacing-md);
}

.product-description h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.product-description ul {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.product-description li {
    margin-bottom: 6px;
    position: relative;
}

.product-description li::marker {
    color: var(--color-primary);
}

/* Characteristics table */
.product-characteristics__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-lg);
}

.product-characteristics__table {
    width: 100%;
    max-width: 700px;
    border-collapse: collapse;
}

.product-characteristics__table tr {
    border-bottom: 1px solid var(--color-border-light);
}

.product-characteristics__table tr:last-child {
    border-bottom: none;
}

.product-characteristics__label {
    padding: 12px 16px 12px 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    width: 40%;
    vertical-align: top;
}

.product-characteristics__value {
    padding: 12px 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* Drawing */
.product-drawing__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
}

.product-drawing__hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.product-drawing__wrapper {
    position: relative;
    max-width: 700px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    cursor: crosshair;
}

.product-drawing__img {
    width: 100%;
    display: block;
    cursor: crosshair;
}

.product-drawing__zoom-lens {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    background: rgba(225, 30, 40, 0.05);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 2;
}

.product-drawing__zoom-result {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 300px;
    height: 300px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-repeat: no-repeat;
    background-color: var(--color-white);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 3;
}

/* Fullscreen drawing overlay */
.product-drawing__fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.product-drawing__fullscreen--active {
    opacity: 1;
}

.product-drawing__fullscreen img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    touch-action: pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.product-drawing__fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.product-drawing__fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Documents */
.product-documents__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-lg);
}

.product-documents__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}

.product-documents__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-base);
}

.product-documents__item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.product-documents__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.product-documents__item:hover .product-documents__icon {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.product-documents__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-documents__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.product-documents__meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.product-documents__download {
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.product-documents__item:hover .product-documents__download {
    color: var(--color-primary);
}

/* Reviews */
.product-reviews__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border-light);
}

.product-reviews__rating-big {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-reviews__rating-number {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-text);
    line-height: 1;
}

.product-reviews__stars {
    display: flex;
    gap: 2px;
    color: #F59E0B;
}

.product-reviews__stars svg {
    width: 20px;
    height: 20px;
}

.product-reviews__rating-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.product-reviews__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.product-reviews__item {
    padding: var(--spacing-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
}

.product-reviews__item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.product-reviews__item-author {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.product-reviews__item-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.product-reviews__item-stars {
    display: flex;
    gap: 2px;
    color: #F59E0B;
    margin-bottom: 10px;
}

.product-reviews__item-stars svg {
    width: 16px;
    height: 16px;
}

.product-reviews__item-text {
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

/* Reviews — Write review button */
.product-reviews__write-btn {
    flex-shrink: 0;
}

/* Recommendations */
.product__recommendations {
    margin-top: var(--spacing-2xl);
}

.product__section-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xl);
}

.product-recommendations__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

/* Recommendation cards use shared .product-card from catalog-card.css */

/* Полное описание: теги визуального редактора (h2, нумерованные списки, цитата,
   таблица, подчёркивание/зачёркивание). Без этих правил разметка, сделанная
   менеджером, показывалась бы без форматирования. */
.product-description h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.product-description ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
    list-style: decimal;
}

.product-description ul { list-style: disc; }

.product-description blockquote {
    margin: var(--spacing-md) 0;
    padding: 12px 16px;
    border-left: 3px solid var(--color-primary, #94a3b8);
    background: rgba(148, 163, 184, .08);
    border-radius: 8px;
}

.product-description a { color: var(--color-primary, currentColor); text-decoration: underline; }
.product-description strong { color: var(--color-text); font-weight: var(--font-weight-semibold); }
.product-description u { text-decoration: underline; }
.product-description s { text-decoration: line-through; }

.product-description table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    display: block;
    overflow-x: auto;
}

.product-description th,
.product-description td {
    border: 1px solid rgba(148, 163, 184, .35);
    padding: 8px 12px;
    text-align: left;
}

.product-description th { font-weight: var(--font-weight-semibold); color: var(--color-text); }
