/* styles.css — полный файл с исправлениями для мобильных */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Manrope', sans-serif;
  background: #f9f7f3;
  color: #1e1e1e;
  line-height: 1.7;
  font-weight: 400;
}

:root {
  --bg: #f9f7f3;
  --dark: #1e1e1e;
  --gray: #555;
  --light: #ffffff;
  --accent: #b8965d;
  --accent-dark: #98753c;
  --error: #c62828;
  --success: #2e7d32;
}

/* Контейнер с комфортными отступами */
.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px; /* комфортные отступы по бокам на мобильных */
  }
}

/* Hero — баннер */
.hero {
  height: 100vh;
  min-height: 600px; /* уменьшили, чтобы текст влезал */
  background: linear-gradient(rgba(249,247,243,0.3), rgba(249,247,243,0.5)),
              url('https://spb-office.com/upload/medialibrary/acd/h9u10g4eu7f7881fuaf9u32o2c0u1w9p/ducatti_01.jpg') center/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 15px;
}

.hero-content {
  max-width: 100%;
  width: 100%;
  padding: 0 10px;
}

.hero h1 {
  font-size: clamp(2.4rem, 8vw, 5rem); /* уменьшили максимальный размер — теперь влезает */
  line-height: 1.05;
  margin-bottom: 1rem;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  word-break: break-word; /* перенос длинных слов */
}

.hero p {
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  max-width: 90%;
  margin: 0 auto 2rem;
  color: #333;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

@media (min-width: 600px) {
  .hero-buttons {
    flex-direction: row;
    gap: 24px;
  }
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #111;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn-outline {
  border: 2px solid var(--dark);
  color: var(--dark);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(0,0,0,0.05);
}

/* Секции */
section {
  padding: 80px 0;
}

.section-title {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.intro-text {
  max-width: 900px;
  margin: 0 auto 60px;
  font-size: 1.15rem;
  text-align: center;
  color: #444;
}

/* Товары — с отступами от краёв */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin: 0 -10px; /* компенсируем паддинг */
}

@media (max-width: 768px) {
  .products-grid {
    margin: 0 -15px;
    gap: 20px;
  }
}

.product-card {
  background: var(--light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transition: all 0.4s;
}

.product-card:hover {
  transform: translateY(-10px);
}

.product-card img {
  width: 100%;
  height: 340px;
 /* object-fit: cover;*/
}

.product-info {
  padding: 24px;
  text-align: center;
}

.product-info h3 {
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}

.product-size {
  font-size: 1rem;
  color: #666;
}

.price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 12px;
}

/* Галерея шоурума — с отступами */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 0 -10px;
  width: calc(100% + 20px);
}

@media (max-width: 768px) {
  .gallery-grid {
    margin: 0 -15px;
    gap: 12px;
  }
}

.gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#lightbox img {
  max-width: 92%;
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(0,0,0,0.7);
  pointer-events: none; /* чтобы клик по фото не закрывал */
}

#lightbox .close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: white;
  font-size: 3.5rem;
  cursor: pointer;
  z-index: 10000;
}

#lightbox .prev,
#lightbox .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 5rem;
  cursor: pointer;
  user-select: none;
  z-index: 10000;
}

#lightbox .prev {
  left: 30px;
}

#lightbox .next {
  right: 30px;
}

/* Форма — строго по центру */
.form-container {
  background: var(--light);
  padding: 40px 20px;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 15px 50px rgba(0,0,0,0.1);
}

.form-container h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  text-align: center;
  margin-bottom: 1.5rem;
}

form {
  display: grid;
  gap: 18px;
}

input, textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  font-size: 1rem;
  background: #fafafa;
}

.form-message {
  padding: 14px;
  border-radius: 10px;
  text-align: center;
}

.success { background: rgba(46,125,50,0.1); color: #2e7d32; }
.error { background: rgba(198,40,40,0.1); color: #c62828; }

/* Футер */
footer {
  background: #111;
  color: #ccc;
  padding: 60px 0 30px;
  text-align: center;
}

.contacts {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.contacts a {
  color: #eee;
  font-size: 1rem;
}

/* Адаптивность */
@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .form-container {
    padding: 30px 15px;
    border-radius: 0;
    margin: 0 -15px;
  }
}

@media (min-width: 769px) {
  .form-container {
    padding: 60px 40px;
  }
}