/* Сброс базовых стилей */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Общие настройки */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: #f4f4f4;
  color: #333;
}


















.search-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-bar input,
.search-bar button,
.search-bar select {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* 📱 Мобільна адаптація */
@media (max-width: 768px) {
  .search-bar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .search-bar input,
  .search-bar button,
  .search-bar select {
    width: 100%;
    margin-bottom: 10px;
    font-size: 16px;
    padding: 12px;
  }

  .search-bar button {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
  }
}




/* Языки */
.translate .dropbtn {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
}







.breadcrumbs {
  font-size: 14px;
  margin: 10px 0;
  color: #666;
}

.breadcrumbs a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: #000;
}

.breadcrumbs a.active {
  font-weight: bold;
  color: #333;
}









/* Основной контент */
/* Основний макет */
.layout {
  display: flex;
  gap: 20px;
  max-width: 1220px;
  margin: 0px auto;
  padding: 0 15px;
}


.categories-sidebar {
  position: fixed;
  top: 130px; /* висота хедера, щоб виходило з-під нього */
  left: -250px; /* схований ліворуч */
  width: 250px;
  height: calc(100% - 60px); /* вся висота під хедером */
  background: #f8f9fa;
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
  transition: left 0.3s ease;
  z-index: 1100;
  padding: 20px;
  overflow-y: auto;
}

.categories-sidebar.active {
  left: 0; /* показати */
}

.categories-overlay {
  position: fixed;
  top: 130px; /* overlay теж з-під хедера */
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  background: rgba(50,50,100,0.5);
  display: none;
  z-index: 1099;
}

.categories-overlay.active {
  display: block;
}

.categories-btn {
  
  font-size: 16px;
  background: #4a90e2;
  color: #fff;
  border: none;
  padding: 8px 14px;
  margin-right: 10px;
  border-radius: 4px;
  cursor: pointer;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  margin-bottom: 10px;
}


.categories {
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.categories li {
  margin-bottom: 8px;
}

.categories a {
  text-decoration: none;
  color: #007BFF;
  font-weight: bold;
  display: block;
  padding: 6px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.categories a:hover {
  background: #f0f0f0;
  color: #0056b3;
}













@media (max-width: 768px) {
  .categories ul {
    display: flex;          /* робимо горизонтальний ряд */
    flex-wrap: wrap;        /* перенос на новий ряд при нестачі місця */
    list-style: none; 
    gap: 10px;
    justify-content: center;
  }

  .categories li {
    margin: 0;              /* прибираємо відступи */
    list-style: none;       /* прибираємо маркери */
  }

  .categories a {
    display: inline-block;  /* як кнопка/посилання */
    padding: 8px 12px;
    font-size: 16px;
    text-align: center;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
}

@media (max-width: 480px) {
  .categories ul {
    flex-direction: column; /* на дуже маленьких екранах — вертикально */
    align-items: stretch;
     list-style: none;
  }

  .categories a {
    text-align: center;
    font-size: 18px;
    width: 100%;
     list-style: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border-radius: 4px;
  }
}




/* Контент справа */
.main-content {
  flex: 1;                /* займає весь залишок */
  display: flex;
  flex-direction: column; /* секції йдуть у стовпчик */
  gap: 20px;
}
.sidebar h3 {
  margin-bottom: 10px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}


.sidebar ul li {
  margin-bottom: 8px;
}

.sidebar ul li a {
  text-decoration: none;
  color: #007BFF;
  font-weight: bold;
}

.sidebar ul li a:hover {
  color: #0056b3;
}





@media (max-width: 768px) {
  .layout {
    flex-direction: column; /* колонки превращаются в строки */
  }

  .sidebar {
    flex: 1;
    width: 100%;          /* сайдбар занимает всю ширину */
    margin-bottom: 20px;  /* отступ снизу */
    box-shadow: none;     /* убираем тень для простоты */
    border-radius: 0;     /* убираем скругления */
  }
}

@media (max-width: 480px) {
  .sidebar {
    display: none; /* скрываем сайдбар на очень маленьких экранах */
  }

  .mobile-categories {
    display: block;
    margin-bottom: 15px;
  }

  .mobile-categories select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
  }
}




/* Контент з товарами */

.vip-ads {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px;
}

.vip-ads h2 {
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
  color: #d4af37; /* золотой заголовок */
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* три карточки в ряд */
  gap: 20px;
}

.products {
  flex: 1;
}

.product-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.product-card img {
  width: 100%;
  height: 250px;       /* одинаковая высота */
  object-fit: cover;   /* обрезка фото */
  display: block;
}

.product-card h3 {
  font-size: 18px;
  margin: 10px 0;
  color: #333;
}

.product-card .price {
  font-size: 1.1em;
  color: #28a745;
  margin-bottom: 10px;
}

.product-card .btn {
  display: inline-block;
  padding: 8px 15px;
  background: #007BFF;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.product-card .btn:hover {
  background: #0056b3;
}


@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr); /* планшет: по две карточки */
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr; /* телефон: одна карточка */
  }

  .product-card img {
    height: 180px; /* фото чуть меньше на телефоне */
  }
}


/* Заголовки */
h2 {
  margin-bottom: 15px;
  color: #444;
}





/* Футер */
footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 15px 0;
  margin-top: 20px;
}

@media (max-width: 768px) {
  footer {
    font-size: 0.9em;   /* текст немного меньше */
    padding: 12px 0;    /* компактнее отступы */
  }
}

@media (max-width: 480px) {
  footer {
    font-size: 0.8em;   /* ещё компактнее */
    padding: 10px 0;
  }
}





/* Сетка блога */
/* Сетка блога */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Карточка блога */
.blog-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card h3 {
  margin: 15px;
  font-size: 1.2em;
  color: #333;
}

.blog-card p {
  margin: 0 15px 15px;
  color: #666;
}

.blog-card a {
  display: block;
  margin: 0 15px 15px;
  text-decoration: none;
  color: #007BFF;
  font-weight: bold;
}

.blog-card a:hover {
  color: #0056b3;
}

/* 🔹 Адаптивность для телефона */
@media (max-width: 480px) {
  .blog-grid {
    grid-template-columns: 1fr; /* одна колонка */
  }

  .blog-card img {
    height: 150px; /* чуть ниже картинка */
  }

  .blog-card h3 {
    font-size: 1em; /* компактнее заголовок */
  }

  .blog-card p {
    font-size: 0.9em; /* текст меньше */
  }
}




.page-home .layout 
{ display:flex; }
.page-about .about-page 
{ max-width:1200px; }
.page-blog .blog-card { box-shadow:0 2px 8px rgba(0,0,0,0.1); }






/* Контейнер сторінки */
.contacts-page {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-family: "Didact Gothic", sans-serif;
}

/* Заголовок */
.contacts-page h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #007BFF;
  border-bottom: 2px solid #007BFF;
  padding-bottom: 10px;
}

/* Текст */
.contacts-page p {
  font-size: 1.1em;
  margin: 10px 0;
  color: #333;
}

.contacts-page p strong {
  color: #000;
}

/* Карта */
.contacts-page .map {
  margin-top: 25px;
  border: 2px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.contacts-page iframe {
  width: 100%;
  height: 400px;
  border: none;
}

/* Адаптивність */
@media (max-width: 768px) {
  .contacts-page {
    padding: 15px;
  }
  .contacts-page h2 {
    font-size: 1.6em;
  }
  .contacts-page iframe {
    height: 300px;
  }
}











/* Контейнер блогу */
.blog-page {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.blog-page h2 {
  font-size: 2em;
  margin-bottom: 25px;
  color: #007BFF;
  border-bottom: 2px solid #007BFF;
  padding-bottom: 10px;
}

/* Сітка */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

/* Карточка */
.blog-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card h3 {
  margin: 15px;
  font-size: 1.3em;
  color: #333;
}

.blog-card p {
  margin: 0 15px 15px;
  color: #666;
  font-size: 0.95em;
}

.blog-card .btn {
  display: inline-block;
  margin: 0 15px 15px;
  padding: 8px 15px;
  background: #007BFF;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.blog-card .btn:hover {
  background: #0056b3;
}

/* 🔹 Адаптивність */
@media (max-width: 480px) {
  .blog-card img {
    height: 150px;
  }
  .blog-card h3 {
    font-size: 1.1em;
  }
  .blog-card p {
    font-size: 0.9em;
  }
}










/* Контейнер */
.about-page {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-family: "Didact Gothic", sans-serif;
}

/* Заголовки */
.about-page h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #007BFF;
  border-bottom: 2px solid #007BFF;
  padding-bottom: 10px;
}

.about-section h3,
.about-team h3 {
  font-size: 1.5em;
  margin-top: 25px;
  margin-bottom: 10px;
  color: #333;
}

/* Текст */
.about-page p {
  font-size: 1.05em;
  line-height: 1.6;
  color: #555;
}

/* Команда */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.team-card {
  background: #f9f9f9;
  border-radius: 8px;
  text-align: center;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.team-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.team-card h4 {
  margin: 5px 0;
  color: #007BFF;
}

.team-card p {
  color: #666;
  font-size: 0.95em;
}

/* 🔹 Адаптивність */
@media (max-width: 768px) {
  .about-page {
    padding: 15px;
  }
  .about-page h2 {
    font-size: 1.6em;
  }
  .team-card img {
    height: 150px;
  }
}





.search-bar {
  max-width: 1200px;
  width: 100%;
  margin: 5px auto;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-bar form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap; /* на десктопе НЕ переносим */
  width: 100%;
}

/* На мобильных включаем перенос */
@media (max-width: 768px) {
  .search-bar form {
    flex-wrap: wrap;   /* элементы переносятся */
    justify-content: flex-start; /* можно по центру или влево */
  }

  .search-bar input,
  .search-bar select,
  .search-bar button {
    flex: 1 1 100%;    /* каждый элемент занимает всю ширину */
  }
}


.search-bar input,
.search-bar select,
.search-bar button {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.search-bar button {
  background: #007BFF;
  color: #fff;
  cursor: pointer;
}

.search-bar button:hover {
  background: #0056b3;
}







/* Список оголошень */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* гибкая сетка */
  gap: 20px;
}

.ad-card {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
  overflow: hidden; /* чтобы картинка не вылазила */
}

.ad-card img {
  width: 100%;
  height: 220px;       /* одинаковая высота */
  object-fit: cover;   /* обрезка фото */
  border-radius: 5px;
  display: block;
}

.ad-card h3 {
  font-size: 18px;
  margin: 10px 0;
  color: #333;
}

.ad-card .price {
  font-size: 16px;
  font-weight: bold;
  color: #28a745;
  margin-bottom: 10px;
}

.ad-card .btn {
  display: inline-block;
  background: #007bff;
  color: #fff;
  padding: 8px 16px;
  margin-bottom: 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.ad-card .btn:hover {
  background: #0056b3;
}

/* 📱 Адаптив */
@media (max-width: 1024px) {
  .ads-grid {
    grid-template-columns: repeat(2, 1fr); /* планшет: по две карточки */
  }
}

@media (max-width: 768px) {
  .ads-grid {
    grid-template-columns: 1fr; /* телефон: одна карточка */
  }

  .ad-card img {
    height: 180px; /* фото чуть меньше на телефоне */
  }

  .sidebar {
    display: none; /* ховаємо категорії */
  }

  .mobile-categories {
    display: block;
    margin-bottom: 15px;
  }

  .mobile-categories select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
  }
}









.login-page {
  max-width: 400px;
  margin: 40px auto;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-page h2 {
  text-align: center;
  margin-bottom: 20px;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.social-login button {
  padding: 10px;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
}

.social-login .facebook { background: #3b5998; }
.social-login .apple { background: #000; }
.social-login .google { background: #db4437; }

.login-page form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-page input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-page button[type="submit"] {
  background: #007bff;
  color: #fff;
  padding: 10px;
  border: none;
  border-radius: 4px;
}









.register-page {
  max-width: 400px;
  margin: 40px auto;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.register-page h2 {
  text-align: center;
  margin-bottom: 20px;
}

.register-page form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.register-page input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.register-page button[type="submit"] {
  background: #28a745;
  color: #fff;
  padding: 10px;
  border: none;
  border-radius: 4px;
}











/* Секція account */
.account {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.account h2 {
  margin-bottom: 15px;
  color: #333;
}

.account-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account .btn {
  display: inline-block;
  padding: 8px 15px;
  background: #007BFF;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.account .btn:hover {
  background: #0056b3;
}

.account .btn-secondary {
  background: #6c757d;
}

.account .btn-secondary:hover {
  background: #5a6268;
}













form.add-ad-form {
  width: 100%;              /* на всю ширину контейнера */
  max-width: 800px;         /* можна задати обмеження */
  margin: 0 auto;           /* центрування */
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

form.add-ad-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

form.add-ad-form input,
form.add-ad-form textarea,
form.add-ad-form select {
  width: 100%;              /* 🔹 на всю ширину */
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box;
}

form.add-ad-form textarea {
  min-height: 100px;
  resize: vertical;
}

form.add-ad-form input[type="file"] {
  padding: 5px;
}

form.add-ad-form .btn {
  display: inline-block;
  width: 100%;              /* 🔹 кнопка теж на всю ширину */
  padding: 12px;
  background: #007BFF;
  color: #fff;
  text-align: center;
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.3s ease;
}

form.add-ad-form .btn:hover {
  background: #0056b3;
}


form.add-ad-form input[type="checkbox"] {
  width: auto;          /* не розтягувати */
  margin-right: 8px;    /* відступ від тексту */
  transform: scale(1.2); /* можна трохи збільшити */
  cursor: pointer;
}





.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.gallery img {
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}







@media (max-width: 480px) {
  /* Галерея товаров */
  .product-detail .gallery {
    flex-direction: column;   /* фото идут в колонку */
    align-items: center;      /* выравнивание по центру */
  }

  .product-detail .gallery img {
    flex: none;               /* убираем деление на проценты */
    width: 100%;              /* фото растягивается на всю ширину блока */
    max-width: 320px;         /* можно ограничить ширину */
    height: auto;
  }

  /* Превью загрузки фото */
  .preview-grid {
    grid-template-columns: 1fr; /* одна колонка */
  }

  .preview-grid img {
    width: 100%;
    max-width: 320px;
    height: auto;
  }
}











.vip-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.vip-label input {
  margin-right: 8px;
}

.vip-text {
  font-weight: bold;
  color: gold;
}




.auth-container {
  max-width: 420px;
  margin: 40px auto;
  padding: 25px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  font-family: Arial, sans-serif;
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"] {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.3s;
}

.auth-container input:focus {
  border-color: #007bff;
  outline: none;
}

.auth-container button {
  width: 100%;
  padding: 12px;
  background: #007bff;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.auth-container button:hover {
  background: #0056b3;
}

/* Соц-кнопки */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.social-login a {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
}

.social-login .google {
  background: #db4437;
}

.social-login .google:hover {
  background: #c23321;
}

.social-login .facebook {
  background: #3b5998;
}

.social-login .facebook:hover {
  background: #2d4373;
}


@media (max-width: 480px) {
  .container {
    gap: 10px;
  }
}

















.product-detail .gallery {
  display: flex;
  flex-wrap: wrap;       /* фото переносяться на новий ряд */
  gap: 15px;             /* відступи між фото */
  margin: 20px 0;
  justify-content: flex-start;
}

.product-detail .gallery img {
  flex: 1 1 calc(25% - 15px); /* три фото в ряд */
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.product-detail .gallery img:hover {
  transform: scale(1.05); /* легкий ефект при наведенні */
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gallery img,
.main-image img {
  width: 250px;            /* фиксированная ширина превью */
  height: 100px;           /* фиксированная высота */
  object-fit: cover;       /* обрезка фото */
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}


.gallery img:hover {
  transform: scale(1.05);  /* лёгкий эффект при наведении */
}



@media (max-width: 480px) {
  .product-detail .gallery img {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .product-detail .gallery img {
    flex: 1 1 calc(50% - 10px);
  }

  .product-detail .main-image img {
    width: 100%;        /* головне фото на всю ширину */
    max-width: 320px;   /* обмеження ширини */
    height: auto;       /* висота автоматично */
    object-fit: cover;  /* обрізка зайвого */
  }
}




@media (max-width: 480px) {
  .account h2,
  .auth-container h2 {
    font-size: 18px;
  }
  form.add-ad-form label {
    font-size: 14px;
  }
  form.add-ad-form .btn {
    font-size: 1em;
    padding: 10px;
  }
}







.preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 4 фото в ряд на десктопі */
  gap: 10px;
  width: 100%;
}

.preview {
  position: relative;
  width: 100%;
  
}

.preview-box {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
}


@media (max-width: 1024px) {
  .preview-grid {
    grid-template-columns: repeat(2, 1fr); /* планшет */
  }
}

@media (max-width: 480px) {
  .preview-grid {
    grid-template-columns: 1fr; /* телефон */
  }
}


.product-card.vip {
  border: 2px solid rgb(235, 216, 111);
  background: #fffbe6;
}

.vip-label {
  color: #eccb5b;
  font-weight: bold;
  margin-left: 10px;
}


















.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  margin-right: 10px;
}

/* скрываем стандартный чекбокс */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* бегунок */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 28px;
}

/* кружок внутри */
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

/* активное состояние */
.switch input:checked + .slider {
  background-color: gold; /* золотой фон для VIP */
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}






.upload-box {
  position: relative;
  width: 100%;
  padding-top: 100%; /* квадрат */
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f9f9f9;
  transition: 0.3s;
}

.upload-box:hover {
  border-color: #28a745;
  background: #eef9f0;
}

.upload-box::before {
  content: "+";
  position: absolute;
  font-size: 48px;
  color: #999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.upload-box input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0; /* скрываем стандартный input */
  cursor: pointer;
}







.photos {
  display: grid;                     /* делаем сетку */
  grid-template-columns: repeat(1, 1fr); /* всегда 2 столбца */
  gap: 10px;
}

.photos .preview {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.photos .preview-box {
  position: relative;
  width: 100%;
  padding-top: 100%;       /* квадрат */
  background: #f0f0f0;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  color: #999;
  cursor: pointer;
  overflow: hidden;
}

.photos .preview-box img {
  position: absolute;
  
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* планшет */
@media (max-width: 768px) {
  .photos {
    grid-template-columns: repeat(2, 1fr); /* по 2 фото */
  }
}

/* телефон */
@media (max-width: 480px) {
  .photos {
    grid-template-columns: 1fr; /* по одному фото */
  }
  .photos .preview-box {
    font-size: 1.5em;
  }
}















.btn-back {
  display: inline-block;
  padding: 8px 14px;
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 15px;
  transition: background 0.2s, color 0.2s;
}

.btn-back:hover {
  background: #e0e0e0;
  color: #000;
}

.btn-detail {
  display: inline-block;
  padding: 8px 12px;
  background: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-detail:hover {
  background: #0056b3;
}






.ad-buttons {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.ad-btn {
  flex: 1;
  padding: 10px;
  background: #007bff;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s ease;
}

.ad-btn:hover {
  background: #0056b3;
}

/* 📱 мобільні стилі */
@media (max-width: 480px) {
  .ad-buttons {
    flex-direction: column;   /* кнопки стають вертикально */
    gap: 12px;
  }

  .ad-btn {
    width: 100%;              /* кнопка на всю ширину */
    font-size: 18px;          /* трохи більший текст */
    padding: 12px;            /* більше місця для пальця */
  }
}
















