*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: #ffffff; /* jasne tło */
  color: #222;
}

.hero {
  position: relative;
  background-image: url('../images/transport.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 55vh;
  min-height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding-bottom: 20px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero h1 {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 800;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.05em;
  margin: 0;
}

.truck-cards-wrapper {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.truck-cards {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(to right, #f0f0f0, #bbbaba);
  height: 31vh;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

.truck-card {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  background: #fff;
  color: #2e3b4e;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  border-right:3px solid #2e3b4e;
  border-bottom:3px solid #2e3b4e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.truck-card span {
  position: relative;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.truck-card::before,
.truck-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: all 0.3s ease;
}

/* Gradient na hover */
.truck-card::before {
  background: linear-gradient(135deg, #2e3b4e 0%, #4b6584 100%);
  transform: translateY(100%);
}

.truck-card::after {
  content: "Przejdź do sekcji →";
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(100%);
}

.truck-card:hover::before {
  transform: translateY(0);
}

.truck-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.truck-card:hover span {
  opacity: 0;
}

/* Ukryj kafelki na telefonie */
@media screen and (max-width: 900px) {
  .truck-cards {
    display: none;
  }
}

main h3 {
  color: #d27b4f;
  font-size: 1.8rem;
}

/* Kontener dla całej sekcji ciężarówek */
.trucks-container {
  background-color: #c1bdbd;
  padding: 20px 25px;
  box-sizing: border-box;
}

/* Nagłówek grupy (typ tira) */
.truck-group-header {
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  color: #2e3b4e;
  margin: 40px 0 30px 0;
  padding: 10px 0;
  background-color: #c1bdbd;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 2px solid #2e3b4e;
}

/* Ciężarówki - jasne tło, bardziej widoczna linia oddzielająca */
.truck-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 0;
  gap: 30px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #c1bdbd;
  border-bottom: 2px solid #2e3b4e; /* wyraźniejsza linia */
}

/* Tekst ciężarówki */
.truck-text {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.6;
  color: #333;
  padding: 0 20px;
}

/* Dane ciężarówki */
.truck-text .data-line {
  padding: 18px 0 0 0;
  border-top: 1px solid #2e3b4e;
  width: 100%;
  font-size: 1.5rem;
  color: #333;
  text-align: left; /* wyrównanie do lewej */
}

.truck-text .data-line:first-of-type {
  border-top: none;
}

/* Obraz ciężarówki */
.truck-image {
  flex: 0 0 70%;
  text-align: right;
}

.truck-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

/* Responsywność */
@media screen and (max-width: 900px) {
  .truck-section {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .truck-text,
  .truck-image {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: center;
  }

  .truck-image {
    text-align: center;
  }

  .truck-group-header {
    font-size: 1.5rem;
    margin: 20px 0;
  }
}

/* === RESPONSYWNOŚĆ: MOBILE-FIRST PODEJŚCIE === */

@media screen and (max-width: 768px) {
  .hero {
    height: 40vh;
    padding-bottom: 10px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .truck-cards-wrapper {
    display: none; /* już wcześniej było, ale dla pewności */
  }

  .trucks-container {
    padding: 15px;
  }

  .truck-section {
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 15px;
  }

  .truck-text {
    font-size: 1rem;
    padding: 0;
  }

  .truck-text .data-line {
    font-size: 1.1rem;
    padding: 10px 0 0;
    text-align: left;
  }

  .truck-image img {
    max-width: 100%;
    height: auto;
  }

  .truck-group-header {
    font-size: 1.3rem;
    margin: 20px 0 15px;
    padding: 8px 0;
  }
}

/* TABLETY - np. iPad */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .truck-cards {
    height: auto;
    flex-wrap: wrap;
  }

  .truck-card {
    flex: 1 1 50%;
    min-height: 150px;
    font-size: 1rem;
  }

  .truck-section {
    flex-direction: column;
    gap: 20px;
  }

  .truck-text {
    font-size: 1.1rem;
  }

  .truck-text .data-line {
    font-size: 1.3rem;
    text-align: left;
  }

  .truck-group-header {
    font-size: 1.5rem;
  }
}

/* Telefony bardzo małe (np. SE) */
@media screen and (max-width: 480px) {
  .truck-text .data-line {
    font-size: 1rem;
  }

  .truck-text h3 {
    font-size: 1.2rem;
  }

  .truck-group-header {
    font-size: 1.1rem;
  }
}
