/* =======================
   MINIMAL THEME (APPLE STYLE)
   ======================= */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f9f9f9;
    color: #111;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease;
}

/* Общие стили */
button {
    font-family: inherit;
}

/* =======================
   Страницы
   ======================= */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* =======================
   Баннер
   ======================= */
.full-width-banner {
    width: 100%;
    height: 40vh;
    min-height: 250px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #eee;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9);
    transition: transform 0.6s ease;
}

.banner-image:hover {
    transform: scale(1.02);
}

/* =======================
   Контент под баннером
   ======================= */
.content-below-banner {
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.vitrin {
    max-width: 480px;
    margin: 0 auto;
}

.vitrin h1 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.vitrin p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.p2-text {
    color: #111;
    font-size: 14px;
    margin-top: 10px;
}

/* =======================
   Кнопки в шапке
   ======================= */
.header-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.b1 {
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
}

.b1:hover {
    background: #333;
    transform: translateY(-2px);
}

/* =======================
   Сетка товаров
   ======================= */
#product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f9f9f9;
}

.product {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    cursor: pointer;
}

.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}



.product img {
    /* Обязательно: занимает всю ширину карточки */
    width: 100%;

    /* Устанавливаем максимальную высоту, чтобы избежать слишком высоких фото 
       (если они не строго квадратные) и делаем их блочными элементами */
    display: block;

    /* Добавляем закругление */
    border-radius: 12px;

    /* Отступ от названия товара */
    margin-bottom: 10px;

    /* УБРАТЬ: position: absolute; top: 0; left: 0; height: 100%; object-fit: cover; */
}

.product h3 {
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 500;
}

.product p {
    color: #007aff;
    font-weight: 600;
    margin-bottom: 8px;
}

.add-to-cart-small {
    background: #007aff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-to-cart-small:hover {
    background: #005ecb;
}

/* =======================
   Шапка страниц
   ======================= */
.product-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.back-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #007aff;
    margin-right: 12px;
    padding: 8px;
}

.back-button:hover {
    opacity: 0.7;
}

.product-header h2 {
    font-size: 18px;
    margin: 0;
}

/* =======================
   Детали товара
   ======================= */
.product-detail {
    background: #f9f9f9;
    min-height: 100vh;
}

.product-gallery {
    background: #fff;
    padding: 24px;
    text-align: center;
}

#product-main-image {
    width: 100%;
    max-width: 340px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.product-info {
    background: #fff;
    margin-top: 10px;
    padding: 24px;
    border-radius: 16px 16px 0 0;
}

#product-title {
    font-size: 22px;
    margin-bottom: 6px;
    font-weight: 600;
}

.product-price {
    font-size: 26px;
    color: #007aff;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Выбор размера */
.size-selector h3 {
    font-size: 15px;
    margin-bottom: 10px;
}

.sizes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-btn {
    padding: 10px 18px;
    border: 1.5px solid #ddd;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
}

.size-btn:hover {
    border-color: #007aff;
}

.size-btn.selected {
    background: #007aff;
    border-color: #007aff;
    color: white;
}

/* =======================
   Метаданные и описание
   ======================= */
.product-meta {
    background: #f4f4f4;
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 14px;
    color: #555;
}

.product-description h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.product-description p {
    color: #666;
    line-height: 1.6;
    white-space: pre-line;
    margin: 0 0 12px;
}

/* =======================
   Кнопки действий
   ======================= */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.add-to-cart-btn {
    background: #007aff;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.add-to-cart-btn:hover {
    background: #005ecb;
    transform: translateY(-2px);
}

/* =======================
   Корзина
   ======================= */
.cart-content {
    padding: 20px;
}

.cart-item {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cart-item-image {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
}

.cart-item-details {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

.cart-item-price {
    color: #007aff;
    font-weight: 600;
    margin-top: 4px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ff3b30;
    font-size: 18px;
    cursor: pointer;
}

.cart-item-remove:hover {
    opacity: 0.7;
}

/* =======================
   Итог корзины
   ======================= */
.cart-total {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.cart-total h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.checkout-btn {
    background: #111;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.checkout-btn:hover {
    background: #333;
}

.empty-cart {
    text-align: center;
    color: #777;
    padding: 50px 0;
}

/* =======================
   Счётчик корзины
   ======================= */
#cart-count {
    background: #007aff;
    color: white;
    border-radius: 50%;
    padding: 3px 7px;
    font-size: 12px;
    margin-left: 4px;
}

/* =======================
   Галерея товара
   ======================= */
.product-thumbnails {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.25s ease;
    object-fit: cover;
}

.thumbnail.active,
.thumbnail:hover {
    opacity: 1;
    border: 2px solid #007aff;
}

/* =======================
   Адаптивность
   ======================= */
@media (max-width: 480px) {
    #product-list {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }

    .vitrin h1 {
        font-size: 26px;
    }
}

/* === Price + Button refresh === */
.price {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 1;
    margin: 8px 0 14px;
}

.price .amount {
    font-variant-numeric: tabular-nums;
}

.price .currency {
    opacity: .7;
    font-weight: 700;
    margin-left: 2px;
}

/* универсальная кнопка */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 14px;
    background: #007aff;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 8px 20px rgba(0, 122, 255, .25);
    cursor: pointer;
    transition: transform .06s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn-primary:hover {
    box-shadow: 0 10px 24px rgba(0, 122, 255, .33);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: .5;
    cursor: default;
}

/* === Product gallery === */
.gallery {
    position: relative;
    margin-bottom: 18px;
    background: #fff;
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

#gallery-main {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 22px;
    display: block;
    background: #f4f6f8;
    object-fit: contain;
    max-height: min(78vh, 760px);
}

.gallery .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .35);
    cursor: pointer;
}

.gallery .prev {
    left: 8px;
}

.gallery .next {
    right: 8px;
}

.gallery .nav:active {
    transform: translateY(-50%) scale(.98);
}

.thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 2px 2px;
    -webkit-overflow-scrolling: touch;
}

.thumb {
    width: 58px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    opacity: .6;
    border: 2px solid transparent;
    cursor: pointer;
    flex: 0 0 auto;
    background: #fff;
}

.thumb.active {
    opacity: 1;
    border-color: #007aff;
}

.card-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.buy-now {
    background: #111;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-now:hover {
    background: #333;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.add-to-cart-btn,
.buy-now-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-to-cart-btn {
    background: #007aff;
    color: #fff;
    border: none;
}

.add-to-cart-btn:hover {
    background: #005ecb;
}

.buy-now-btn {
    background: #111;
    color: #fff;
    border: none;
}

.buy-now-btn:hover {
    background: #333;
}
/* ==== АНИМАЦИЯ КНОПКИ КОРЗИНЫ ==== */
#cart-button {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  display: inline-flex; /* чтобы сохранялась форма кнопки */
  pointer-events: none; /* пока скрыта — не кликается */
}

#cart-button.visible {
  opacity: 1;
  pointer-events: auto;
}
.header-buttons {
  position: relative;
  height: 60px;
}

#cart-button {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 15px);
}
.product-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.share-btn {
  background: #ededed;
  border: none;
  color: #000;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: all .3s ease;
}
.share-btn:hover {
  background: #dcdcdc;
}
/* === Плавные переходы между страницами === */
.page {
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.page.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Чтобы не было резкого мигания при старте */
.page:first-of-type {
  opacity: 1;
  transform: translateY(0);
}
.promo-section {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

#promo-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#apply-promo {
  background: #111;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#apply-promo:hover {
  background: #333;
}

#promo-message {
  font-size: 14px;
  color: green;
  margin-top: 5px;
}

.order-comment {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-comment label {
  font-size: 14px;
  color: #555;
}

#order-comment {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  resize: vertical;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  margin-right: 8px;
}
#product-description-text {
    white-space: pre-line;
}
