* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #222222;
  --accent-red: #bd234a;
  --accent-hover: #d82b57;
  --text-white: #ffffff;
  --text-gray: #a0a0a0;
  --text-dark: #1a1a1a;
  --font-title: 'Cormorant Garamond', serif;
  --font-body: 'Montserrat', sans-serif;
}

html {
  height: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
    max-width: 1280px;      /* Ограничиваем максимальную ширину контента */
    margin: 0 auto;         /* Центрируем весь блок по горизонтали */
    padding-left: 40px;     /* ✅ Отступ слева от края экрана */
    padding-right: 40px;    /* ✅ Отступ справа от края экрана */
    width: 100%;
}

/* Общий контейнер страницы */
.product-page-container {
    margin: 0 auto;
    padding: 20px;
    color: #ffffff;
    background-color: #0d0d0d;
    font-family: 'Inter', sans-serif;
}

/* Основная сетка */
.product-main-grid {
    display: grid;
    grid-template-columns: 38% 1fr; /* ✅ Ровно 35% под фото, остаток (~65%) под инфо */
    gap: 40px;                       /* Расстояние между левой и правой колонкой */
    margin-bottom: 50px;
}

/* Галерея */
.product-gallery {
    position: relative;
}

.main-image-wrapper {
    position: relative;
    background: #f4f4f4;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;                     /* Занимает все отведенные 35% */
    aspect-ratio: 1 / 1;             /* Сохраняет идеальный квадрат */
    height: 550px;                    /* Высота подстроится автоматически */
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* ✅ Отображает фото полностью, без обрезания снизу или сверху */
}

.image-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 2;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 6px;
    z-index: 2;
    transition: background 0.2s;
}

.gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }

.thumbnail-list {
    display: flex;
    justify-content: center; /* Центрирует миниатюры ровно по середине */
    gap: 12px;
    margin-top: 15px;
}

.thumb-item {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #1a1a1a;
    transition: border-color 0.2s;
}

.thumb-item.active, .thumb-item:hover {
    border-color: #d62839;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Информация справа */
.tag-pill {
    border: 1px solid #444;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 8px;
}
.product-title {
    font-family: 'Playfair Display', serif;
    font-size: 38px;
    margin: 15px 0 5px 0;
}
.product-subtitle { color: #aaa; margin-bottom: 20px; }
.product-price-block { font-size: 36px; font-weight: bold; color: var(--accent-red); margin-bottom: 20px; }
.product-short-desc { color: #ccc; font-size: 14px; line-height: 1.6; margin-bottom: 25px; }

/* Сетка характеристик */
.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 30px; /* Увеличили вертикальный отступ между строками до 16px */
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    padding: 22px 0;
    margin-bottom: 25px;
    font-size: 14.5px; /* Увеличили базовый размер текста (был 13px) */
}

.spec-item {
    display: flex;
    align-items: flex-start; /* Выравниваем иконку и текст по верхней линии */
    gap: 12px;
}

/* Иконки: фиксируем ширину, чтобы они стояли ровно друг под другом */
.spec-item i {
    font-size: 18px;
    color: #ffffff;
    width: 22px;
    text-align: center;
    flex-shrink: 0; /* Не дает иконке сжиматься */
    margin-bottom: 5px; /* Легкая подгонка под первую строчку текста */
}

/* Названия полей (Материал, Особенности и т.д.) */
.spec-item span {
    color: #999999;
    width: 120px;   /* ✅ КРИТИЧЕСКИ ВАЖНО: фиксированная ширина выравнивает значения справа */
    flex-shrink: 0; /* Не дает названию сжиматься */
    font-size: 14px;
}

/* Значения (Фарфор, Двойные стенки и т.д.) */
.spec-item strong {
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    flex-grow: 1;   /* Занимает всё оставшееся место */
    line-height: 1.4;
}

/* Кнопки */
.stock-status { color: #4CAF50; font-size: 17px; font-weight: 600; margin-bottom: 15px; padding-top: 40px;}
.purchase-action-row { display: flex; gap: 15px; align-items: center; }

.quantity-picker input {
    background: transparent;
    color: #fff;
    border: none;
    width: 45px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    outline: none; /* Убирает рамку при фокусе */
}
/* Убираем стрелочки для Chrome, Safari, Edge, Opera */
.quantity-picker input[type="number"]::-webkit-outer-spin-button,
.quantity-picker input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Убираем стрелочки для Firefox */
.quantity-picker input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield; /* Стандартное свойство */
}
.quantity-picker button { background: #1a1a1a; color: #fff; border: none; width: 35px; height: 42px; cursor: pointer; }
.quantity-picker button:hover { background: #2c2c2c; }
.quantity-picker input { background: #0d0d0d; color: #fff; border: none; width: 40px; text-align: center; font-weight: bold; }

.btn-primary-pink {
    background: var(--accent-red);
    color: #fff;
    border: none;
    padding: 0 25px;
    height: 42px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary-pink:hover { background: var(--accent-hover); }

.btn-outline-fav {
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    padding: 0 25px;
    height: 42px;
    border-radius: 6px;
    cursor: pointer;
}

/* Нижние блоки */
.product-bottom-grid {
    display: grid;
    grid-template-columns: 38% 1fr; /* ✅ Ровно 35% под "О чае", остаток под "О происхождении" */
    gap: 40px;                       /* Такое же расстояние, чтобы разделительная линия идеальна совпала */
    align-items: stretch;            /* "Уход" и "Описание" одной высоты — по более длинному */
}

.info-card {
    background-color: #2c2c2c;
    border-radius: 16px;
    padding: 24px; /* ✅ Уменьшили отступ с 30px, чтобы сделать блок более компактным */
    border: 1px solid #1f1f1f;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    /* Высота по тексту вместо фиксированных 265px: меньше пустоты,
       а длинный текст не обрезается */
    min-height: 180px;
}

.info-card h3 {
    margin-top: 3px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

/* Иконка в заголовке */
.info-card h3 i {
    font-size: 20px;
    color: var(--accent-red);
}

/* Текст внутри блока "О чае" */
.info-card p {
    color: #b3b3b3;
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 14px;
}

/* Карточки шагов заваривания (5 иконок снизу) */
.brewing-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;                        /* Чуть уменьшаем отступы между 5 плашками */
    margin-top: 15px;
    text-align: center;
}

.step-item {
    background: #1c1c1c;
    padding: 6px 4px; /* Увеличили внутренние отступы карточки */
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #262626;
}

/* Иконка (была 20px -> стала 28px) */
.step-item i {
    font-size: 26px;
    color: #ffffff; /* Сделали иконку ярче для читаемости */
    margin-bottom: 4px;
}

/* Главное значение, например "90-95 °C" (было 12px -> стало 15px) */
.step-item span {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

/* Подпись снизу, например "температура воды" (была 9.5px -> стала 11.5px) */
.step-item small {
    display: block;
    font-size: 11.5px;
    color: #999999; /* Сделали текст чуть светлее */
    line-height: 1.2;
    margin-top: 1px;
}

/* Правый блок "О происхождении" */
.origin-card {
    background-color: #2c2c2c; /* ✅ Добавлена точка с запятой */
    position: relative;
    max-height: 280px;         /* ✅ Фиксируем максимальную высоту карточки */
    overflow-y: auto;          /* ✅ Появляется вертикальная прокрутка при избытке текста */
    padding-right: 18px;       /* Запас справа, чтобы скроллбар не налегал на текст */
}

/* Оформление самого текста */
.origin-card .desc-text {
    margin: 0;
    word-wrap: break-word;     /* Защита от вылезания длинных слов без пробелов */
}

.origin-card strong {
    color: #ffffff;
    font-weight: 600;          /* Можно поставить 400 вместо 600, если жирный шрифт кажется слишком плотным */
    font-size: 16px;
    line-height: 1.6;
}

/* --- Стилизация аккуратного скроллбара под тёмную тему --- */

/* Для Chrome, Edge, Safari, Opera */
.origin-card::-webkit-scrollbar {
    width: 6px;                /* Узкая полоса прокрутки */
}

.origin-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.origin-card::-webkit-scrollbar-thumb {
    background: #555555;       /* Цвет бегунка */
    border-radius: 4px;
}

.origin-card::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red, #bd234a); /* Подсветка акцентным цветом при наведении */
}

/* Для Firefox */
.origin-card {
    scrollbar-width: thin;
    scrollbar-color: #555555 rgba(0, 0, 0, 0.2);
}

/* =========================================================
   Адаптивность (десктоп выше 1024px не меняется)
   ========================================================= */
@media (max-width: 1024px) {
    /* Фото и описание — друг под другом */
    .product-main-grid,
    .product-bottom-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .product-gallery {
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    /* Квадрат по ширине экрана вместо фиксированных 550px */
    .main-image-wrapper {
        height: auto;
    }

    .thumbnail-list {
        flex-wrap: wrap;
    }

    .info-card {
        height: auto;
    }
}

@media (max-width: 768px) {
    .product-page-container {
        padding: 16px;
    }

    .product-title {
        font-size: 28px;
    }

    .product-price-block {
        font-size: 28px;
    }

    /* Характеристики в одну колонку */
    .specs-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 16px 0;
    }

    .spec-item {
        height: auto;
        min-height: 32px;
    }

    .purchase-action-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .btn-primary-pink {
        flex: 1 1 auto;
        justify-content: center;
    }

    .btn-outline-fav {
        flex: 1 1 100%;
    }

    .thumb-item {
        width: 52px;
        height: 52px;
    }

    .info-card {
        padding: 18px;
    }

    .brewing-steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .brewing-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .spec-item span {
        width: 105px;
    }
}
