/* Скрываем стандартные селекты */
.variations { display: none !important; }

/* -- Обертка всего блока (для позиционирования стрелок) -- */
.gh-table-wrapper-outer {
    position: relative;
    margin-bottom: 25px;
    /* Чтобы стрелки не вылезали за пределы блока при случайных сдвигах */
    max-width: 100%; 
}

/* -- Контейнер скролла -- */
.gh-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    position: relative;
    /* Важно: scroll-behavior smooth делает прокрутку по кнопке плавной */
    scroll-behavior: smooth; 
}

/* -- Основная таблица -- */
.gh-variations-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    background: #fff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-width: 100%; /* Гарантирует растягивание */
}

/* -- Ячейки -- */
.gh-variations-table th, 
.gh-variations-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}

/* -- Sticky Header (Липкая шапка) -- */
.gh-variations-table thead th {
    background-color: #2E7D32;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 1px solid #388E3C;
}

/* -- Sticky First Column (Липкая левая колонка) -- */
.gh-variations-table tbody td.gh-step-label {
    position: sticky;
    left: 0;
    background-color: #f9f9f9;
    z-index: 5;
    font-weight: 600;
    color: #333;
    font-size: 13px;
	text-align: left;
    border-right: 2px solid #ddd;
    min-width: 80px;
}

/* Угловая ячейка (верхний левый угол) - самый высокий z-index */
.gh-variations-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
}

/* -- Разделитель (Поликарбонат) -- */
.gh-poly-header td {
    background-color: #E8F5E9 !important;
    color: #1B5E20;
    font-weight: 800;
    padding: 10px 15px;
    text-align: left;
}

/* -- Ячейка цены -- */
.gh-price-cell {
    background-color: #fff;
    color: #2E7D32;
    cursor: pointer;
    font-weight: bold;
	font-size: 13px;
    min-width: 90px; 
    border-radius: 8px; 
    /* Важно: делаем границу прозрачной по умолчанию, чтобы работало скругление фона, 
       но визуальные разделители останутся от глобальных td */
    border: 1px solid transparent; 
    transition: all 0.2s ease;
    position: relative; /* Чтобы при выборе ячейка была поверх соседей */
}
		
/* Эффект при наведении */
.gh-price-cell:not(.unavailable):hover {
    background-color: #F1F8E9;
    /* При наведении подсвечиваем границы скругления */
    border-color: #C8E6C9; 
    z-index: 2; /* Поднимаем над соседями, чтобы углы не перекрывались */
}		
.gh-price-cell:hover:not(.unavailable) { background-color: #F1F8E9; }

/* -- Размер цены -- */
.gh-price-cell span.woocommerce-Price-amount {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.2;
}
/* Если нужно уменьшить и значок рубля/валюты */
.gh-price-cell span.woocommerce-Price-currencySymbol {
    font-size: 13px; 
}
.gh-price-cell.selected {
    background-color: #4CAF50 !important;
    color: white !important;
    /* Тень делает акцент на скруглении */
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    border-color: #388E3C !important;
    z-index: 3; /* Самый верхний слой */
}
.gh-price-cell.selected span.woocommerce-Price-amount,
.gh-price-cell.selected span.woocommerce-Price-currencySymbol {
    color: white !important;
}

.gh-price-cell.unavailable {
    background-color: #fafafa; color: #ccc; cursor: not-allowed;
}

/* === ПЛАВАЮЩИЕ СТРЕЛКИ === */
.gh-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4CAF50; /* Зеленый фон */
    color: white;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30; /* Поверх липких колонок */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.2s, visibility 0.3s;
    font-size: 20px;
    line-height: 1;
    user-select: none;
}

.gh-nav-btn:hover {
    background-color: #2E7D32;
    transform: translateY(-50%) scale(1.1);
}

/* Левая кнопка */
.gh-nav-btn.prev { left: -15px; }
/* Правая кнопка */
.gh-nav-btn.next { right: -10px; }

/* Класс для показа кнопок */
.gh-nav-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* Пульсация для правой стрелки, чтобы заметили */
@keyframes btnPulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}
.gh-nav-btn.next.visible {
    animation: btnPulse 2s infinite;
}
.gh-nav-btn.next.visible:hover {
    animation: none; /* Убираем пульсацию при наведении */
}

/* Блок итога */
.gh-summary-box {
    display: none;
    margin-top: 15px; padding: 15px;
    background-color: #F1F8E9;
    border: 2px solid #4CAF50; border-radius: 8px;
}
.gh-summary-content { display: flex; justify-content: space-between; align-items: center; }
.gh-summary-final-price { font-size: 22px; font-weight: 800; color: #2E7D32; }

/* Медиа-запросы */
@media (max-width: 1280px) {
    /* Стрелки чуть смещаем внутрь на маленьких экранах, чтобы не обрезались краем экрана */
    .gh-nav-btn.prev { left: 5px; }
    .gh-nav-btn.next { right: 5px; }
}

@media (max-width: 768px) {
    .gh-variations-table th, .gh-variations-table td { padding: 8px 4px; font-size: 12px; }
    .gh-price-cell { min-width: 75px; }
    .gh-summary-content { flex-direction: column; align-items: flex-start; }
    
    /* На мобильных стрелки можно сделать полупрозрачными, чтобы не перекрывали контент слишком сильно */
    .gh-nav-btn {
opacity: 0.8;
width: 36px; height: 36px; font-size: 18px;
    }
    .gh-nav-btn.visible { opacity: 0.85; }
}