main {
  padding: 2rem;
  background-image: url(../../img/main_banners/f1_wallpaper.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: 'Segoe UI', sans-serif;
}

.top-legend {
  text-align: center;
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: #1d231e;
  text-shadow: 1px 1px 3px rgb(8, 8, 7);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "Exo 2", sans-serif;
}

.top-legend {
  width: 100%;
  background-image: url('/img/main_banners/f1redflag\ Banner.jpg'); /* replace with your image */
  background-size: cover;
  background-position: center;
  border-radius: 5px;
  color: white;
  text-align: center;
  font-size: 3rem;
  font-weight: bold;
  padding: 3rem 1rem;
  margin: 0;
  position: relative;
  text-shadow: 1px 1px 4px rgba(0,0,0,1);
  margin-bottom: 5%;
}


.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 2fr));
  gap: 1.2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.grid-item {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  text-align: center;
  padding: 2rem 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item a {
  text-decoration: none;
  color: #333;
  font-size: 2.1rem;
  font-weight: 600;
  display: block;
  opacity: 0.7;
}

.grid-item {
  display: flex;
  justify-content: end; /* centers horizontally */
  align-items: end;     /* centers vertically */
  text-align: end;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.grid-item:hover a {
  color: #70baef; /* accent color on hover */
  opacity: 1;
}

.grid-item {
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.grid-item a {
  position: relative;
  z-index: 2;
  color: white;
  text-shadow: 1px 1px 3px black;
  font-weight: bold;
  padding: 0 1rem;
}

/* Overlay for all grid items */
.grid-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 12px;
  pointer-events: none;
}

/* Specific backgrounds per category */
.gi-first {
  background-image: url('../../img/motor_gorra/60669291_9FIFTY_MCLAREN_25_MCLAREN_ORG_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.gi-second {
  background-image: url('../../img/motor_gorra/60594951_59FIFTY_F1MEXICORACE_RBULLF1_SKY_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.gi-third {
  background-image: url('../../img/motor_gorra/60669227_9SEVENTY_REDBULLTEAMLINE_RBULLF1_NAV_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.gi-forth {
  background-image: url('../../img/motor_gorra/60669232_59FIFTY_RBULLF1_ECOM_RBULLF1_NAV_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.gi-fifth {
  background-image: url('../../img/motor_gorra/60747541_59FIFTY_REDBULL_RACING_WHT_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.gi-sixth {
  background-image: url('../../img/motor_gorra/60593294_9FIFTY_VISACASHAPPREDBULL24_VCARBS_WHITE_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-seventh {
  background-image: url('../../img/motor_gorra/60667949_59FIFTY_HAASF1_ECOM_HAASF1_BLK_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-eight {
  background-image: url('../../img/motor_gorra/60505560_9FIFTY_HAASF1TEAM_HAASF1_BLK_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-ninth {
  background-image: url('../../img/motor_gorra/60669265_59FIFTY_ALPINE_ECOM_ALPINE_BLK_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-tenth {
  background-image: url('../../img/motor_gorra/60669357_9SEVENTY_ALPINE_25_MIAMI_ALPINE_WHT_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-eleventh {
  background-image: url('../../img/motor_gorra/60669362_9SEVENTYSS_ALPINE_GRY_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-twelvth {
  background-image: url('../../img/motor_gorra/60669364_9SEVENTY_ALPINE_25_SILVERSTONE_ALPINE_MULTI_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-thirteen {
  background-image: url('../../img/motor_gorra/60573663_9FIFTYSTRETCHSNAP_MONACORACE_MCLAREN_MULTI_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-fourtheen {
  background-image: url('../../img/motor_gorra/60504225_9FIFTY_ANTTNO_MCLAREN_BLK_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-fiftheen {
  background-image: url('../../img/motor_gorra/60747542_59FIFTY_DTC_MIAMI_MCLAREN_WHT_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-sixtheen {
  background-image: url('../../img/motor_gorra/60747544_59FIFTY__RACING_MCLAREN_F1TEAM_BLKWHT_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-seventheen {
  background-image: url('../../img/motor_gorra/60669289_59FIFTY_MCLAREN_ECOM_MCLAREN_ORG_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gi-eighteen {
  background-image: url('../../img/motor_gorra/60593259_59FIFTY_MOTORSPORTS24_MCLAREN_GRY_3QL.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
