/* ==============================
   Базове скидання стилів
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  background: #2c2c2c; /* Темний фон */
  color: #eaeaea; /* Світлий текст для контрасту */
}
body {
  display: flex;
  flex-direction: column;
}
a {
  color:#5ea4cc;
  text-decoration: none;
}

/* Обгортка для контенту, щоб футер кріпився донизу */
.page-wrapper {
  flex: 1 0 auto;
}
.site-footer {
  flex-shrink: 0;
  background: #222;
  color: #7d7d7d;
  padding: 0.5rem 0;
  text-align: center;
}

/* Контейнер (центрування) */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =======================
   Шапка сайту (header)
======================= */
.site-header {
  background: #222;
  color: #fff;
  padding: 0rem 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo img {
  max-height: 70px;
  vertical-align: middle;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.main-nav a.active {
  text-decoration: underline;
}

/* =======================
   Бейдж кошика
======================= */
.cart-badge {
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  padding: 3px 8px;
  font-size: 0.8rem;
  margin-left: 5px;
  display: inline-block;
  min-width: 20px;
  text-align: center;
}

/* ====================
    SweetAlert
==================== */
.swal2-toast {
    padding: 0.1rem 0.5rem 0.2rem 1rem !important; 
	background: #525252 !important; 
	color: #ffffff !important; 
	border: 2px solid #212121 !important; 
}
.swal-popup-custom {
  background: #2c2c2c !important;
  border: 2px solid #e67e22 !important;
  color: #eaeaea !important;
  font-family: Arial, sans-serif;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
}
.swal-title-custom {
  font-size: 1rem !important;
  font-weight: bold;
}


/* ===================================
   СТИЛІ СТОРІНКИ ТОВАРУ (product.html)
   =================================== */

/* Загальний контейнер сторінки */
.product-page {
  padding: 2rem 0;
}

/* 1. Кнопка "Назад" */
.btn-back {
  background: none;
  color: #999;
  border: 1px solid #444;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  margin-top: 0; 
}
.btn-back:hover {
  background: #333;
  color: #fff;
  border-color: #555;
  transform: none;
}

/* 2. Новий Головний Макет (Grid) */
.product-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr; /* Зображення трохи більше за інфо */
  gap: 3rem; /* Більше простору між колонками */
  align-items: flex-start;
}

.product-gallery {
  min-width: 0;     /* Змушує Grid правильно обчислювати ширину */
  overflow: hidden; /* Примусово обрізає все, що виходить за межі */
}

/* 3. Ліва колонка (Галерея) */
.product-gallery .main-image-slider {
    width: 100%;
  overflow: hidden;
  position: relative;
}

.product-gallery .swiper-slide img,
.product-gallery .swiper-slide video {
  width: 100%;
  height: auto;
  max-height: 500px; 
  object-fit: contain; 
  border-radius: 8px;
}

/* Стилі Swiper (стрілки) */
.product-gallery .swiper-button-prev,
.product-gallery .swiper-button-next {
  color: #fff !important;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.product-gallery:hover .swiper-button-prev,
.product-gallery:hover .swiper-button-next {
  opacity: 1;
}

/* Пагінація (крапки) винесена за межі блоку */
.product-gallery .swiper-pagination {
  position: static !important; 
  margin-top: 1rem; 
  display: flex;
  justify-content: center;

  /* --- ВИПРАВЛЕННЯ --- */
  padding-bottom: 0.5rem !important; /* Перебиває динамічний padding */
  height: auto !important;         /* Перебиває динамічний height */
}
.product-gallery .swiper-pagination-bullet {
  background: #aaa;
  opacity: 0.6;
  transition: all 0.3s ease;
}
.product-gallery .swiper-pagination-bullet-active {
  background: #e67e22;
  opacity: 1;
  transform: scale(1.2);
}


/* 4. Права колонка (Інформація) */
.product-info {
  display: flex;
  flex-direction: column;
  height: 100%; /* Дозволяє кнопці притиснутися донизу */
  text-align: center;
}

.product-title {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #fff;
}

.price-box {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: #333;
  border-radius: 8px;
  border: 1px solid #444;
  display: inline-block; /* Щоб фон був лише під контентом */
}

.price-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #e67e22; /* Акцентний колір */
  line-height: 1;
}

.product-description {
  margin-bottom: 1.5rem;
  color: #ccc;
  line-height: 1.6;
  font-size: 1rem;
}

/* Селектор кольору */
.color-selector {
  margin: 0 0 1.5rem 0; /* Змінені відступи */
  padding: 10px;
  background: #3c3c3c;
  border: 1px solid #444;
  border-radius: 6px;
}
.color-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #e67e22;
}
.color-selector select {
  width: 100%;
  padding: 8px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #2c2c2c;
  color: #eaeaea;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}
.color-selector select:focus {
  outline: none;
  border-color: #e67e22;
}

/* Кнопка "Додати в кошик" */
.btn-add-to-cart {
  background: linear-gradient(45deg, #e67e22, #d35400);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  margin-top: 10px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 8px rgba(255, 140, 0, 0.3);
  width: 100%; /* На всю ширину колонки */
  margin-top: auto; /* Притискає кнопку донизу */
  padding: 1rem; /* Робимо кнопку більшою */
  font-size: 1.1rem;
}
.btn-add-to-cart:hover {
  background: linear-gradient(45deg, #d35400, #e67e22);
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(255, 140, 0, 0.5);
}


/* 5. Секція Характеристик (Новий вигляд) */
.product-details-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #444; /* Чіткий розділювач */
}

.product-details-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.specs-list {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Дві колонки */
  gap: 1rem 2rem; /* Відступ між рядками і колонками */
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px dashed #444; /* Легкий розділювач */
  font-size: 1rem;
}

.spec-label {
  color: #999; /* Назва характеристики */
  margin-right: 1rem;
}

.spec-value {
  color: #fff; /* Значення */
  font-weight: 600;
  text-align: right;
}

/* ===================================
   РЕКОМЕНДОВАНІ ТОВАРИ
   =================================== */
.recommended-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #444;
}
.recommended-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

/* Сітка та картка товару (для рекомендованих) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.product-card {
  background: #3c3c3c;
  color: #f1f1f1;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}
.product-card img {
  max-width: 100%;
  height: auto;
}
.product-card .price {
  font-weight: bold;
  margin: 0.5rem 0;
}
.product-card .btn {
  background: #e67e22;
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}
.product-card .btn:hover {
  background-color: #d35400;
}


/* =======================
   АДАПТИВНІСТЬ (Хедер, Футер, Сторінка Товару)
======================= */

/* Адаптивність для планшетів (максимальна ширина 1024px) */
@media (max-width: 1024px) {
  .container {
    width: 95%;
    padding: 0 1rem;
  }
  .site-header .container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .main-nav ul {
    display: flex;
    flex-wrap: wrap;
  }
  .main-nav a {
    font-size: 1.3rem; 
    white-space: nowrap;
    padding: 0.4rem 0.45rem; 
  }
  .products-grid {
    gap: 1rem;
  }
  .product-card {
    padding: 0.8rem;
  }
}

/* Для екранів до 768px (планшети) */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .main-nav ul {
    flex-wrap: wrap;
  }
  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;           
  }
  
  /* Адаптація сторінки товару */
  .product-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .product-info {
    height: auto;
  }
  .product-info .btn-add-to-cart {
    margin-top: 1.5rem;
  }
  .product-title {
    font-size: 2rem;
  }
  .price-value {
    font-size: 2rem;
  }
}

/* Для дуже вузьких екранів (до 480px) */
@media (max-width: 480px) {
  /* --- Хедер --- */
  .site-header .container {
    padding-top: 0px;
    padding-left: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
	  max-height: 90px;
  }
  .main-nav ul li a {
    position: relative;
    top: -19px;
  }
  .logo img {
    max-height: 70px;
	  padding-right: 15px;
  }
  .site-footer {
    padding: 0.1rem 0;
  }
  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;           
  }
  .logo img {
    max-height: 60px;
  }
  .main-nav ul li a {
    top: -5px;
  }
  .main-nav ul {
    gap: 0.5rem;       
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .main-nav li {
    display: flex;
    align-items: center; 
	  margin-top: 15px;
  }
  .main-nav a {
    font-size: 0.9rem; 
    white-space: nowrap;
    padding: 0.4rem 0.5rem; 
  }
  
  /* --- Сторінка товару --- */
  .product-page {
    padding: 1rem 0;
  }
  .btn-back {
    margin-bottom: 1.5rem;
  }
  .product-layout {
    gap: 1.5rem;
  }
  .specs-list {
    grid-template-columns: 1fr; /* Характеристики в одну колонку */
    gap: 0.5rem;
  }
  .spec-item {
    padding: 0.6rem 0;
  }
  .product-title {
    font-size: 1.8rem;
  }
  .price-value {
    font-size: 1.8rem;
  }
  .product-details-section h3,
  .recommended-section h3 {
    font-size: 1.3rem;
  }
  
  /* --- Рекомендовані --- */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .product-card {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Подальші мікро-адаптації хедера */
@media screen and (max-width: 443px) {
  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;           
  }
  .logo img {
    max-height: 45px;
  }
  .main-nav ul li a {
    top: -5px;
  }
  .main-nav ul {
    gap: 0.5rem;       
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .main-nav li {
    display: flex;
    align-items: center; 
	  margin-top: 15px;
  }
  .main-nav a {
    font-size: 0.84rem; 
    white-space: nowrap;
    padding: 0.4rem 0.5rem; 
  }
}

@media screen and (max-width: 407px) {
  .main-nav a {
    font-size: 0.78rem; 
    white-space: nowrap;
    padding: 0.4rem 0.4rem; 
  }
}

@media screen and (max-width: 390px) {
  .logo img {
	 padding-right: 8px;
  }
}
	  
@media screen and (max-width: 380px) {
  .main-nav a {
    font-size: 0.75rem; 
    white-space: nowrap;
    padding: 0.3rem 0.4rem; 
  }
}
	 
@media screen and (max-width:369px) {
  .main-nav a {
    font-size: 0.75rem; 
    white-space: nowrap;
    padding: 0.3rem 0.225rem; 
  }
}
@media screen and (max-width:339px) {
 .main-nav a {
    font-size: 0.6rem; 
    white-space: nowrap;
    padding: 0.3rem 0.3rem; 
  }
  .logo img {
	 padding-right: 0px;
  }
}
.product-gallery .swiper-pagination {
  /* 1. Головна зміна: витягуємо крапки з контейнера */
  position: static !important; 
  
  /* 2. Додаємо відступ зверху, щоб вони не прилипали до фото */
  margin-top: 1rem;
  
  /* 3. Допоміжні стилі для центрування */
  display: flex;
  justify-content: center;
  padding-bottom: 0.5rem; /* Додатковий відступ знизу */
}

/* Стиль для самих крапок */
.product-gallery .swiper-pagination-bullet {
  background: #aaa; /* Колір неактивної крапки */
  opacity: 0.6;
  transition: all 0.3s ease;
}

/* Стиль для активної крапки */
.product-gallery .swiper-pagination-bullet-active {
  background: #e67e22; /* Акцентний колір */
  opacity: 1;
  transform: scale(1.2); /* Робимо її трохи більшою */
}