* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* Запобігає появі горизонтального скролу на рівні сторінки */
}

body {
  background: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* Кнопка перемикання мови */
.lang-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
}

/* Шапка (Header / Hero) */
.header {
  position: relative;
  width: 100%;
  min-height: 35vh;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.75)),
    url('./image/bg1.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1.5rem 1rem 3rem; /* Зменшено бокові відступи для мобільних */
  color: #fff;
}

@media (min-width: 768px) {
  .header {
    padding: 1.5rem 2rem 4rem;
  }
}

/* Кнопка перемикання мови у верхньому правому кутку */
.header .lang-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

@media (min-width: 768px) {
  .header .lang-btn {
    top: 1.5rem;
    right: 2rem;
  }
}

/* Контейнер логотипа */
.header-top {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem; /* Відступ від кнопки мови на малих екранах */
}

.logo-img {
  max-height: 10em;
  height: auto;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6))
          drop-shadow(0 0 12px rgba(255, 255, 255, 0.25));
  transition: transform 0.25s ease;
}

.logo-link:hover .logo-img {
  transform: scale(1.05);
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: auto;
  width: 100%;
  padding: 0 0.5rem;
}

.hero-content h1 {
  font-size: clamp(1.5rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.9rem;
  word-break: break-word;
}

.hero-content p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.9;
  margin-bottom: 1.8rem;
}

.hero-cta {
  display: inline-block;
  background: #0284c7;
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.hero-cta:hover {
  background-color: #0369a1;
  transform: translateY(-2px);
}

/* Каталог */
.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

@media (min-width: 768px) {
  .container {
    margin: 3rem auto;
    padding: 0 1.25rem;
  }
}

h1 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
  }
}

.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
  cursor: pointer;
}

.card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background-color: #f8fafc;
  border-radius: 8px;
  display: block;
  padding: 10px;
}

.card h3 {
  margin: 0.9rem 0 0.4rem;
  font-size: 1.15rem;
}

.card .price {
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.card button {
  margin-top: auto;
  padding: 0.7rem;
  border: none;
  background: #0f172a;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.card button:hover {
  background: #1e293b;
}

/* Плаваюча кнопка кошика */
.cart-floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: #0284c7;
  color: #ffffff;
  border: none;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.4);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

@media (min-width: 768px) {
  .cart-floating-btn {
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
  }
}

.cart-floating-btn:hover {
  transform: scale(1.08);
  background-color: #0369a1;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Модальне вікно кошика */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 0.75rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  .modal-content {
    padding: 1.8rem;
  }
}

.close-btn {
  position: absolute;
  right: 1rem;
  top: 0.8rem;
  font-size: 1.6rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.close-btn:hover {
  color: #0f172a;
}

.cart-total {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.2rem 0;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

/* Форма оформлення */
form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

form h3 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

form input,
form select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

form input:focus,
form select:focus {
  border-color: #0284c7;
}

form select.placeholder-active {
  color: #8a8a8a !important;
}

form select {
  background-color: #ffffff !important;
  /* color: #1e293b !important; */
  appearance: none; /* Прибирає стандартну системну стрілочку в деяких браузерах */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  cursor: pointer;
}
/* 8a8a8a */

/* Колір для першої опції-підказки (коли нічого не обрано) */
form select option[value=""] {
  color: #8a8a8a;
}

form select option {
  color: #1e293b;
  background-color: #ffffff;
}

/* Кастомний випадаючий список */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 0.95rem;
  background-color: #fff;
  color: #8a8a8a; /* Сірий колір за замовчуванням (плейсхолдер) */
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.custom-select-wrapper.selected .custom-select-trigger {
  color: #1e293b; /* Чорний колір, коли країна обрана */
}

.custom-select-trigger:hover {
  border-color: #0284c7;
}

/* Стрілочка */
.custom-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #64748b;
  transition: transform 0.2s ease;
}

.custom-select-wrapper.open .custom-arrow {
  transform: rotate(180deg);
}

/* Випадаюче меню зі списком країн (суворо в межах ширини батьківського блоку) */
.custom-options {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 1100;
  box-sizing: border-box;
}

.custom-select-wrapper.open .custom-options {
  display: block;
}

.custom-option {
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  color: #1e293b;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.custom-option:hover {
  background-color: #f1f5f9;
}

.submit-btn {
  background: #16a34a;
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 0.4rem;
  transition: background-color 0.2s ease;
}

.submit-btn:hover {
  background: #15803d;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.cart-row span {
  word-break: break-word;
}

.cart-row button {
  background: #ef4444;
  border: none;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  flex-shrink: 0;
}

.cart-row button:hover {
  background: #dc2626;
}

/* Сторінка товару (Product Details) */
.product-detail-container {
  margin-top: 1.5rem;
}

.detail-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0.5rem;
}

.back-btn {
  background: none;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #475569;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.detail-lang-btn {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.detail-lang-btn:hover {
  background: #1e293b;
}

/* Макет сторінки товару */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  width: 100%;
}

@media (min-width: 900px) {
  .product-detail-layout {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    padding: 2.5rem;
  }
}

/* Галерея та слайдер товару */
.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0; /* Запобігає вибиванню гріда */
}

.slider-main-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  background: #f8fafc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

@media (min-width: 768px) {
  .slider-main-wrapper {
    height: 420px;
  }
}

.slider-main-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.2rem;
  transition: opacity 0.2s ease-in-out;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.15s ease;
  user-select: none;
  z-index: 5;
}

.slider-arrow:hover {
  background: rgba(2, 132, 199, 0.9);
  transform: translateY(-50%) scale(1.08);
}

.prev-arrow {
  left: 8px;
}

.next-arrow {
  right: 8px;
}

.slider-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  max-width: 100%;
}

.thumb-item {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  overflow: hidden;
  padding: 4px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

@media (min-width: 768px) {
  .thumb-item {
    width: 70px;
    height: 70px;
  }
}

.thumb-item:hover {
  border-color: #94a3b8;
}

.thumb-item.active {
  border-color: #0284c7;
  transform: scale(1.03);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.detail-info {
  min-width: 0;
}

.detail-info h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  word-break: break-word;
}

@media (min-width: 768px) {
  .detail-info h1 {
    font-size: 2.2rem;
  }
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0284c7;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .detail-price {
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
  }
}

.detail-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 1.5rem;
  word-break: break-word;
}

.detail-add-btn {
  width: 100%;
  max-width: 320px;
  padding: 0.9rem 1.5rem;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 2rem;
}

.detail-add-btn:hover {
  background: #0369a1;
}

/* Таблиця характеристик */
.specs-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid #e2e8f0;
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table td {
  padding: 0.6rem 0.4rem;
  font-size: 0.9rem;
  word-break: break-word;
}

@media (min-width: 768px) {
  .specs-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
  }
}

.specs-table td.spec-name {
  font-weight: 600;
  color: #64748b;
  width: 45%;
}

.specs-table td.spec-val {
  color: #0f172a;
}

/* Футер */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2.5rem 1rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid #1e293b;
}

@media (min-width: 768px) {
  .footer {
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 5rem;
  }
}

.footer-container {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.footer-title {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1.2rem;
}

.contact-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.footer-email-box {
  margin-bottom: 1.8rem;
}

.contact-value {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.3px;
  user-select: all;
  word-break: break-all;
}

.footer-phones-box {
  margin-bottom: 2rem;
}

.phones-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (min-width: 540px) {
  .phones-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.phone-chip {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  user-select: all;
}

.phone-number {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.4px;
}

.footer-bottom {
  max-width: 640px;
  margin: 0 auto;
  padding-top: 1.2rem;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}