* {
  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;
    /* Квадрат до 550px (не шире колонки): фото чая квадратные, поэтому
       вписываются целиком — без обрезки и без светлых полос по бокам */
    width: min(100%, 550px);
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    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: 17px; line-height: 1.55; 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: center;
    gap: 12px; /* Увеличили зазор между иконкой, подписью и значением */
}

/* Иконки характеристик (были мелкие -> стали 20px) */
.spec-item i {
    font-size: 20px;
    color: #ffffff; /* Сделали иконки более четкими и белыми */
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Серые подписи (Тип чая, Происхождение и т.д.) */
.spec-item span {
    color: #999999;
    width: 125px; /* Слегка расширили подпись, чтобы вмещались длинные слова */
    font-size: 14px;
    flex-shrink: 0; /* длинное значение не сжимает подпись — все значения с одной линии */
}

/* Значения (Шу Пуэр, Мэнхай и т.д.) */
.spec-item strong {
    flex: 1;
    min-width: 0;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
}

/* Кнопки */
.stock-status { color: #4CAF50; font-size: 17px; font-weight: 600; margin-bottom: 15px; }
.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; /* слева "Описание", справа "Рекомендуемый способ заваривания" */
    gap: 40px;                       /* Такое же расстояние, чтобы разделительная линия идеальна совпала */
    align-items: stretch;            /* оба блока одной высоты — по более высокому */
}

.info-card {
    background-color: #2c2c2c;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid #1f1f1f;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    /* min-height, а не height: длинное описание и шаги заваривания не обрезаются */
    min-height: 200px;
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    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: 15.5px;
    line-height: 1.6;
    margin-bottom: 0;
}

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

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

.step-item {
    background: transparent; /* без чёрной заливки — цвет как у фона блока */
    padding: 10px 6px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #3d3d3d; /* рамка светлее — плашки видно и без заливки */
}

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

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

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

/* Правый блок "О происхождении" */
.origin-card {
    background-color: #2c2c2c /* ✅ Выравниваем фон с левым блоком */
    position: relative;
    overflow: hidden;
}

.origin-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.origin-card li {
    margin-bottom: 5px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #b3b3b3;
}

.origin-card li:last-child {
    margin-bottom: 0;
}

.origin-card strong {
    color: #ffffff;
    font-weight: 600;
}

/* =========================================================
   Адаптивность (десктоп выше 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;
    }
}
