/* Модальное окно детального просмотра */
#product-detail-modal .product-detail-content {
    max-width: 1000px;
    width: 90%;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.product-detail-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.product-images {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    cursor: pointer;
}

.placeholder-image-large {
    width: 100%;
    max-height: 500px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 20px;
    text-align: center;
}

.product-info {
    flex: 1;
}

.detail-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4361ee;
    margin: 10px 0;
}

/* Компактная таблица для размеров */
.detail-sizes-table, .trim-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-header {
    display: flex;
    background: #f0f5ff;
    font-weight: bold;
    padding: 8px 10px;
    border-bottom: 2px solid #e9ecef;
}

.table-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.table-row {
    display: flex;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.table-row:hover {
    background: #e9ecef;
}

.table-cell {
    flex: 1;
    padding: 3px 5px;
    text-align: left;
}

.size-header, .size-cell {
    flex: 1.3;
}

.price-header, .price-cell {
    flex: 1;
}

.item-header, .item-cell {
    flex: 1;
    color: #6c757d;
    font-size: 0.85rem;
}

.stock-header, .stock-cell {
    flex: 1;
}

.actions-header, .actions-cell {
    flex: 1;
    text-align: right;
}

.item-cell {
    color: #495057;
    font-size: 0.85rem;
}

.stock-cell.available {
    color: #38b000;
}

.stock-cell.unavailable {
    color: #d90429;
}

.hover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-row:hover .hover-actions {
    opacity: 1;
}

/* Стили для блока погонажа в новом формате */
.trim-items {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.trim-category {
    margin-bottom: 15px;
}

.trim-category h4 {
    color: #4361ee;
    margin-bottom: 10px;
    font-size: 1.1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid #e9ecef;
}

.trim-group {
    margin-bottom: 8px;
}

/* Стили для заголовков групп погонажа с эффектами при наведении и активном состоянии */
.trim-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    user-select: none;
}

.trim-group-header:hover {
    background: #e3f2fd; /* Светло-синий при наведении */
    border-color: #4361ee;
}

.trim-group-header.active {
    background: #4361ee; /* Синий фон при активном состоянии */
    border-color: #4361ee;
    color: white; /* Белый текст */
}

.trim-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fafafa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.trim-group-content.expanded {
    max-height: 500px;
    margin-top: -1px; /* Коррекция для сглаживания границы */
}

.trim-item {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
}

.trim-item:last-child {
    border-bottom: none;
}

.expand-icon {
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 20px;
    text-align: center;
}

/* Стили для выпадающего попапа корзины */
.cart-control-container {
    position: relative;
    display: inline-block;
}

.cart-popup {
    position: absolute;
    right: 0;
    bottom: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    gap: 5px;
    white-space: nowrap;
}

.cart-popup.hidden {
    display: none;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.quantity-btn:hover {
    background: #dee2e6;
}

.quantity-input {
    width: 38px;
    padding: 2px 4px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

/* Кнопка "Купить" в выпадающем окне */
.buy-btn {
    background: #4361ee;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    font-size: 13px;
    width: 65px;
    height: 28px;
}

.buy-btn:hover {
    background: #3a56e0;
}

.buy-btn.added {
    background: #28a745;
    cursor: default;
}

.buy-btn.added:hover {
    background: #218838;
}

/* Уведомление о товарах под заказ */
.out-of-stock-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}