/* === Сброс базовых отступов и установка box-sizing для более предсказуемой верстки === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.top-bar {
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;    
  top: 0;
  left: 0;
  background: url('../images/background_steel.png') center center;;
  z-index: 100;
}

.top-bar-logo {
  width: 50%;
  max-width: 700px;
  min-width: 200px;
  height: auto;
  margin: auto;
  background-size: cover;
  background-position: center;
}

/* === Основной стиль body === */
body {
  font-family: 'Roboto', sans-serif;
  background: url('../images/background_steel.png') center center;
  line-height: 1.6;
}

/* === Контейнер для выравнивания контента по центру === */
.container {
  width: 90%;
  max-width: 1200px;
  min-width: 200px;
  margin: auto;
  padding: 40px 20px;
}

.container h1{
  font-size: 36px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  background: 
        linear-gradient(135deg, 
            #505050 0%, 
            #ffffff 50%, 
            #6a6a6a 100%);
    background-clip: text;
    color: transparent;
    text-shadow: 
        0 1px 1px rgba(255,255,255,0.1),
        0 -1px 1px rgba(0,0,0,0.3),
        1px 0 1px rgba(0,0,0,0.2),
        -1px 0 1px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

.container p {
  margin-bottom: 3px;
  background: 
    linear-gradient(135deg, 
      #505050 0%, 
      #ffffff 50%, 
      #6a6a6a 100%);
  background-clip: text;
  color: transparent;
  text-shadow: 
    0 1px 1px rgba(255,255,255,0.1),
    0 -1px 1px rgba(0,0,0,0.3),
    1px 0 1px rgba(0,0,0,0.2),
    -1px 0 1px rgba(0,0,0,0.2);
  letter-spacing: 1px;
}

/* === Хедер с фоновым изображением === */
.header {
  padding-top: 250px;
  min-height: 500px;
  background: url('../images/background_steel.png') center center;
  padding: 20px 0;
  position: relative;
}

/* === Секция героя (Hero) === */
.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* === Текст поверх фонового изображения === */
.hero-text {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 600px;
}

.hero-text h1,
.hero-text h2 {
  font-size: 36px;
  background: 
    linear-gradient(135deg, 
      #505050 0%, 
      #ffffff 50%, 
      #6a6a6a 100%);
  background-clip: text;
  color: transparent;
  text-shadow: 
    0 1px 1px rgba(255,255,255,0.1),
    0 -1px 1px rgba(0,0,0,0.3),
    1px 0 1px rgba(0,0,0,0.2),
    -1px 0 1px rgba(0,0,0,0.2);
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.hero-text p {
  font-size: 24px;
  margin-bottom: 3px;
  background: 
    linear-gradient(135deg, 
      #505050 0%, 
      #ffffff 50%, 
      #6a6a6a 100%);
  background-clip: text;
  color: transparent;
  text-shadow: 
    0 1px 1px rgba(255,255,255,0.1),
    0 -1px 1px rgba(0,0,0,0.3),
    1px 0 1px rgba(0,0,0,0.2),
    -1px 0 1px rgba(0,0,0,0.2);
  letter-spacing: 1px;
}


.metal-background {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url('background_steel.png') center center;
}

.welder-container {
  position: relative;
  width: 80%;
  padding: 20px;
}

.welder-photo {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
  mask-image: 
    linear-gradient(to bottom, 
      rgba(0,0,0,0.2) 0%, 
      rgba(0,0,0,0.8) 10%,
      white 20%,
      white 80%,
      rgba(0,0,0,0.8) 90%,
      rgba(0,0,0,0.2) 100%
    ),
    radial-gradient(
      circle at center,
      white 70%,
      rgba(255,255,255,0.3) 90%,
      transparent 100%
    );
  
  -webkit-mask-image: 
    linear-gradient(to bottom, 
      rgba(0,0,0,0.2) 0%, 
      rgba(0,0,0,0.8) 10%,
      white 20%,
      white 80%,
      rgba(0,0,0,0.8) 90%,
      rgba(0,0,0,0.2) 100%
    ),
    radial-gradient(
      circle at center,
      white 70%,
      rgba(255,255,255,0.3) 90%,
      transparent 100%
    );
  
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.welder-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-image-slice: 1;
  border-radius: 5px;
  pointer-events: none;
  z-index: 2;
}

.welder-sparks {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

/* Искры сварки */
.spark {
  position: absolute;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, #ff8c00, #ff4500, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 2s infinite;
}

/* Анимация сварки */
@keyframes sparkle {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty));
    opacity: 0;
  }
}

/* === Карточки товаров в каталоге === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.card {
  background: #000000;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
}

.card p{
  font-size: 20px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  background: 
        linear-gradient(135deg, 
            #505050 0%, 
            #ffffff 50%, 
            #6a6a6a 100%);
    background-clip: text;
    color: transparent;
    text-shadow: 
        0 1px 1px rgba(255,255,255,0.1),
        0 -1px 1px rgba(0,0,0,0.3),
        1px 0 1px rgba(0,0,0,0.2),
        -1px 0 1px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* === Секция "О нас" === */
.about {
  background: url('background_steel.png') center center;;
  padding: 60px 0;
}

.about h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
  margin-bottom: 20px;
  background: 
        linear-gradient(135deg, 
            #505050 0%, 
            #ffffff 50%, 
            #6a6a6a 100%);
    background-clip: text;
    color: transparent;
    text-shadow: 
        0 1px 1px rgba(255,255,255,0.1),
        0 -1px 1px rgba(0,0,0,0.3),
        1px 0 1px rgba(0,0,0,0.2),
        -1px 0 1px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

.about p {
  font-size: 16px;
  text-align: center;
  max-width: 800px;
  margin: auto;
  font-size: 16px;
  font-size: 18px;
  margin-bottom: 20px;
  background: 
        linear-gradient(135deg, 
            #505050 0%, 
            #ffffff 50%, 
            #6a6a6a 100%);
    background-clip: text;
    color: transparent;
    text-shadow: 
        0 1px 1px rgba(255,255,255,0.1),
        0 -1px 1px rgba(0,0,0,0.3),
        1px 0 1px rgba(0,0,0,0.2),
        -1px 0 1px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

/* === Карусельная галерея === */
.carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  width: 100%;
  padding: 0 20px;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  max-width: 1200px;
  position: relative;
}

.carousel-track {
  display: grid;
  transition: transform 1s 0.5s ease;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  will-change: transform;
  padding: 10px 0;
}

.carousel-item {
  flex: 0 0 calc(33.333% - 14px);
  min-width: 0;
  min-width: 280px;
  width: 280px;
  height: auto;
  aspect-ratio: 1/1.4;
}

/* === Карточки в карусели === */
.gallery-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.gallery-image {
  width: 100%;
  height: 70%;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  padding: 15px;
  text-align: center;
  font-size: 1rem;
  height: 30%; /* Оставшиеся 30% для текста */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Кнопки карусели === */
.carousel-btn {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.prev-btn {
  left: 10px;
}

.next-btn {
  right: 10px;
}

/* === Заголовки секций === */
.section-title {
  text-align: center;
  width: 100%;
  margin: auto;
  font-size: 32px;
  font-weight: 700;background: 
    linear-gradient(135deg, 
      #505050 0%, 
      #ffffff 50%, 
      #6a6a6a 100%);
  background-clip: text;
  color: transparent;
  text-shadow: 
    0 1px 1px rgba(255,255,255,0.1),
    0 -1px 1px rgba(0,0,0,0.3),
    1px 0 1px rgba(0,0,0,0.2),
    -1px 0 1px rgba(0,0,0,0.2);
  letter-spacing: 1px;
}

/* === Кнопка закрытия окна === */
.btn {
  text-align: center;
  margin: auto;
}

.contact-container {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 20px 0;
}

.metal-button {
  background: linear-gradient(145deg, #424242, #a3a3a3);
  border: none;
  color: #000;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px auto;
  cursor: pointer;
  border-radius: 8px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.2),
    inset 0 2px 2px rgba(255, 255, 255, 0.5),
    inset 0 -2px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  width: auto;
}

.metal-button::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, 
    rgba(255, 255, 255, 0.3) 0%, 
    rgba(255, 255, 255, 0) 50%);
  transform: rotate(45deg);
  z-index: 1;
  pointer-events: none;
}

.metal-button:hover {
  background: linear-gradient(145deg, #7c7c7c, #e3e3e3);
  color: #000000;
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.4),
    inset 0 -2px 2px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.metal-button:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 2px 2px rgba(255, 255, 255, 0.3),
    inset 0 -2px 2px rgba(0, 0, 0, 0.1);
}

/* Работа с панелью */
.contact-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 20px;
  width: 320px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 5;
  margin-top: 10px;
}

.contact-panel.active {
  align-items: center;
  justify-content: center;
  opacity: 1;
  width: 70%;
  max-width: 600px;
  min-width: 200px;
  visibility: visible;
  margin-top: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  margin: 15px 0;
  padding: 10px;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.contact-item:hover {
  background: #f0f0f0;
}

.contact-icon {
  width: 24px;
  height: 24px;
  margin-right: 15px;
}

.contact-text {
  color: #333;
  text-decoration: none;
  font-size: 14px;
}

.contact-item.phone .contact-icon {
  background: url('../images/telephone.png') no-repeat center;
  background-size: contain;
  margin-right: 15px;
}

.contact-item.telegram .contact-icon {
  background: url('../images/telegramm.png') no-repeat center;
  background-size: contain;
  margin-right: 15px;
}

.contact-item.email .contact-icon {
  background: url('../images/gmail.png') no-repeat center;
  background-size: contain;
  margin-right: 15px;
}

.body-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
}

.copy-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #e0e0e0;
}

.copy-btn.copied {
  background: #4CAF50;
  color: white;
}

.copy-btn::after {
  content: 'Копировать';
}

.copy-btn.copied::after {
  content: 'Скопировано!';
}

.copy-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>') no-repeat center;
}

.btn-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.telegram-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 15px 30px;
  background: #0088cc;
  color: white;
  text-decoration: none;
  font-size: 18px;
  font-weight: bold;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.telegram-btn:hover {
  background: #0077b3;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.telegram-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0, 136, 204, 0.3);
}

.telegram-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.telegram-btn:hover::before {
  left: 100%;
}

.telegram-icon {
  background: url('../images/teleg_3D.png') no-repeat center;
  background-size: contain;
  width: 25px;
  height: 25px;
  margin-right: 10px;
}

@media (max-width: 505px) {
  .hero-text h1,
  .hero-text h2 {
    font-size: 25px;
  }
  .hero-text p {
    font-size: 18px;
  }
  .about h2 {
    font-size: 17px;
  }
  .about p {
    font-size: 14px;
  }
  .contact-text{
    font-size: 12px;
  }
  .copy-btn{
    font-size: 10px;
  }
}

@media (max-width: 391px){
  .contact-text{
    font-size: 9px;
  }
}

@media (max-width: 340px) {
  .hero-text h1,
  .hero-text h2 {
    font-size: 20px;
  }
  .hero-text p {
    font-size: 12px;
  }
  .about h2 {
    font-size: 14px;
  }
  .about p {
    font-size: 10px;
  }
  .contact-icon{
    width: 18px;
    height: 18px;
  }
  .contact-text{
    font-size: 8px;
  }
  .copy-btn{
    font-size: 8px;
  }
}

@media (max-width: 768px) {
  .carousel-item {
    min-width: 220px;
    width: 220px;
  }
  
  .carousel-btn {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 100px) {
  .carousel-track {
    grid-auto-columns: calc((100% - 20px) / 2); /* 2 фото */
  }
}