/**
 * Стилі кастомної картки товару
 * Файл: your-theme/assets/css/single-product-custom.css
 * (або вставте в style.css / підключіть через wp_enqueue_style)
 */

/* ══════════════════════════════════════════════════
   CSS ЗМІННІ
══════════════════════════════════════════════════ */
:root {
    --ch-primary:       #2563EB;   /* синій — кнопка "Купити"        */
    --ch-danger:        #E04B28;   /* помаранчевий — кнопка "Кредит" */
    --ch-text:          #1A1A1A;
    --ch-text-muted:    #6B7280;
    --ch-border:        #E5E7EB;
    --ch-bg-alt:        #F5F5F5;   /* сірий фон кожного 2-го рядка   */
    --ch-tab-active:    #2563EB;
    --ch-radius:        12px;
    --ch-radius-sm:     8px;
    --ch-font:          'Inter', 'Roboto', sans-serif;
    --ch-max-width:     1200px;
}

/* ══════════════════════════════════════════════════
   ОБГОРТКА СТОРІНКИ
══════════════════════════════════════════════════ */
.ch-product-page {
    font-family: var(--ch-font);
    color: var(--ch-text);
    max-width: var(--ch-max-width);
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ══════════════════════════════════════════════════
   BREADCRUMBS
══════════════════════════════════════════════════ */
.ch-breadcrumbs {
    padding: 14px 0;
    font-size: 13px;
    color: var(--ch-text-muted);
}
.ch-breadcrumbs a {
    color: var(--ch-text-muted);
    text-decoration: none;
}
.ch-breadcrumbs a:hover {
    color: var(--ch-primary);
}

/* ══════════════════════════════════════════════════
   ДВОКОЛОНЧАТИЙ ГРІД
══════════════════════════════════════════════════ */
.ch-product {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .ch-product {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ══════════════════════════════════════════════════
   ГАЛЕРЕЯ
══════════════════════════════════════════════════ */
.ch-product__gallery {
    position: relative;
}

/* Бейдж наявності */
.ch-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}
.ch-badge--instock    { background: #D1FAE5; color: #065F46; }
.ch-badge--backorder  { background: #FEF3C7; color: #92400E; }
.ch-badge--outofstock { background: #FEE2E2; color: #991B1B; }

/* Велике фото */
.ch-gallery__main {
    width: 100%;
    border-radius: var(--ch-radius);
    overflow: hidden;
    background: #fff;
/*     border: 1px solid var(--ch-border); */
    margin-bottom: 12px;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ch-gallery__main-img {
/*     width: 100%; */
	max-height: 400px;
    height: 100% !important;
    object-fit: contain;
    transition: opacity .2s;
}

/* Мініатюри */
.ch-gallery__thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.ch-gallery__thumb {
    width: 80px;
    height: 80px;
/*     border-radius: var(--ch-radius-sm); */
    border: 1px solid transparent;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s;
    outline: none;
}
.ch-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ch-gallery__thumb--active,
.ch-gallery__thumb:hover {
    border-color: #000;
}
.ch-gallery__thumb:focus-visible {
    box-shadow: 0 0 0 3px rgba(37,99,235,.35);
}

/* ══════════════════════════════════════════════════
   ПРАВА КОЛОНКА — ІНФОРМАЦІЯ
══════════════════════════════════════════════════ */
.ch-product__info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Назва */
.ch-product__title {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--ch-text);
}

/* Атрибути (колір тощо) */
.ch-product__attributes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ch-attr {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.ch-attr__label {
    color: var(--ch-text-muted);
    min-width: 52px;
}
.ch-attr__values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ch-attr__values--colors { gap: 8px; }
.ch-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--ch-border);
    cursor: pointer;
    transition: transform .15s;
}
.ch-color-swatch:hover { transform: scale(1.15); }

/* Ключові характеристики (Потужність / WiFi) */
.ch-product__key-specs {
    display: flex;
    flex-direction: column;
    gap: 4px;
	max-width: 400px;

}
.ch-key-spec {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 2px 0;
}
.ch-key-spec__label {
    font-weight: 600;
    color: var(--ch-text);
}
.ch-key-spec__value {
    color: var(--ch-text-muted);
}

/* Цінова зона */
.ch-product__price-box {
    background: #F6F6F6;
/*     border: 1px solid var(--ch-border); */
    border-radius: var(--ch-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
	max-width: 400px;
}

.ch-product__price{
	font-size: 35px;
	font-weight: 700;
}

.ch-product__price .price {
    font-size: 32px;
    font-weight: 700;
    color: var(--ch-text);
}
.ch-product__price ins {
    text-decoration: none;
}
.ch-product__price del {
    font-size: 18px;
    color: var(--ch-text-muted);
    margin-right: 8px;
}

.quantity.spinners-added{
	max-width: 120px;
	margin-bottom: 20px;
	background: transparent;
	font-size: 25px;
}

/* Дії */
.ch-product__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* WooCommerce кнопка "Add to cart" — перезапис */
.ch-product__actions .single_add_to_cart_button,
.ch-product__actions button[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .1s;
    background: var(--ch-primary);
    color: #fff;
	background: linear-gradient(137deg, #37569f 0%, #4d82c2 63.46%);
}
.ch-product__actions .single_add_to_cart_button:hover {
    opacity: .88;
    transform: translateY(-1px);
}

/* Кнопка кредиту */
.ch-btn--credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--ch-danger);
    color: #fff;
    text-decoration: none;
    transition: opacity .2s, transform .1s;
}
.ch-btn--credit svg {
    width: 20px;
    height: 20px;
}
.ch-btn--credit:hover {
    opacity: .88;
    transform: translateY(-1px);
}

/* Логотипи платіжних систем */
.ch-product__payment-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ch-product__payment-logos img {
    height: 28px;
    object-fit: contain;
    opacity: .8;
}

/* ══════════════════════════════════════════════════
   ВКЛАДКИ
══════════════════════════════════════════════════ */
.ch-tabs-section {
    border-top: 1px solid var(--ch-border);
    padding-top: 0;
}

/* Навігація */
.ch-tabs__nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--ch-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ch-tabs__nav::-webkit-scrollbar { display: none; }

.ch-tab {
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ch-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
    outline: none;
    margin-bottom: -1px;
}
.ch-tab:hover {
    color: var(--ch-tab-active);
	background: transparent;
}

.ch-tab:focus {
    color: var(--ch-tab-active);
	background: transparent;
}

.ch-tab--active {
    color: var(--ch-tab-active);
    border-bottom-color: var(--ch-tab-active);
    font-weight: 600;
}
.ch-tab:focus-visible {
    outline: 2px solid var(--ch-primary);
    outline-offset: -2px;
}

/* Панелі */
.ch-tab-panel {
    padding: 32px 0;
}
.ch-tab-panel[hidden] { display: none; }
.ch-tab-panel__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--ch-text);
}
.ch-tab-panel__empty {
    color: var(--ch-text-muted);
    font-size: 14px;
}

/* ══════════════════════════════════════════════════
   ТАБЛИЦЯ ХАРАКТЕРИСТИК
══════════════════════════════════════════════════ */
.ch-specs-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: var(--ch-radius-sm);
    overflow: hidden;
}
.spec-row {
    display: flex;
    padding: 12px 16px;
    background: #fff;
    gap: 16px;
}
.spec-row--odd {
    background: var(--ch-bg-alt);
}
.spec-row__label {
    flex: 0 0 55%;
    max-width: 55%;
    font-size: 14px;
    color: var(--ch-text);
}
.spec-row__value {
    flex: 1;
    font-size: 14px;
    color: var(--ch-text);
    font-weight: 500;
}

@media (max-width: 600px) {
    .spec-row {
        flex-direction: column;
        gap: 4px;
    }
    .spec-row__label {
        flex: none;
        max-width: 100%;
        color: var(--ch-text-muted);
        font-size: 13px;
    }
}

/* ══════════════════════════════════════════════════
   ТАБЛИЦЯ КОДІВ ПОМИЛОК
══════════════════════════════════════════════════ */
.ch-error-table {
    border-radius: var(--ch-radius-sm);
    overflow: hidden;
    border: 1px solid var(--ch-border);
}
.ch-error-table__head {
/*     display: grid; */
/*     grid-template-columns: 120px 1fr; */
    background: var(--ch-text);
    color: #fff;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
/*     gap: 16px; */
}
.ch-error-table__row {
/*     display: grid; */
/*     grid-template-columns: 120px 1fr; */
    padding: 12px 16px;
/*     gap: 16px; */
    background: #fff;
    border-top: 1px solid var(--ch-border);
}
.ch-error-table__row--odd {
    background: var(--ch-bg-alt);
}
.ch-error-table__code {
    font-size: 14px;
    font-weight: 700;
    color: var(--ch-primary);
}
.ch-error-table__desc {
    font-size: 14px;
    color: var(--ch-text);
    line-height: 1.5;
}

@media (max-width: 500px) {
    .ch-error-table__head,
    .ch-error-table__row {
        grid-template-columns: 80px 1fr;
    }
}
