/* Početna: hero, traka prednosti, kartice kategorija. Zajedničke sekcije su u sections.css. */

/* Hero (Figma 5:90) */
.gsm-hero {
  display: flex;
  align-items: center;
  min-height: 460px;
  background-color: var(--gsm-dark);
  background-position: center;
  background-size: cover;
}

.gsm-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 342px;
  margin-left: 80px;
  padding: 67px 0 95px;
}

.gsm-hero .gsm-hero__title {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--gsm-white);
  font-family: var(--gsm-font-heading);
  font-size: 56px;
  font-weight: 800;
  line-height: 68px;
  letter-spacing: 0;
  white-space: nowrap;
}

/* SVG crte ima marginu za sjenku: pozicija iz Figme (12,147) minus margina (5.5,3.5) */
.gsm-hero__line {
  display: block;
  width: 206px;
  height: 17px;
  margin: 7.5px 0 0 6.5px;
}

.gsm-hero .gsm-hero__text {
  margin: 12.5px 0 31px;
  color: var(--gsm-white);
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
}

/* Kategorije (Figma 15:278) */
.gsm-catcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px 38px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gsm-catcards li {
  margin: 0;
}

.gsm-catcard {
  position: relative;
  display: block;
  height: 110px;
  text-decoration: none;
}

.gsm-catcard__body {
  position: absolute;
  top: 2px;
  left: 58px;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  height: 106px;
  padding: 0 17px 0 59px;
  border-radius: 0 53px 53px 0;
  background: var(--gsm-light);
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.gsm-catcard__name {
  color: var(--gsm-text-2);
  font-size: 14px;
  font-weight: 700;
  line-height: 17px;
}

.gsm-catcard__arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

/* Slika 110px; PNG ima i sjenku, pa je 116.6px pomjerena kao u Figmi */
.gsm-catcard .gsm-catcard__img {
  position: absolute;
  top: -1.3px;
  left: -3.3px;
  width: 116.6px;
  max-width: none;
  height: 116.6px;
  border-radius: 50%;
  transition: transform 0.25s;
}

.gsm-catcard:hover .gsm-catcard__body {
  background: #eceef2;
}

.gsm-catcard:hover .gsm-catcard__arrow {
  transform: translateX(4px);
}

.gsm-catcard:hover .gsm-catcard__img {
  transform: scale(1.04);
}

/* Tablet */
@media (max-width: 1100px) {
  .gsm-hero__content {
    margin-left: 0;
  }
}

/* Mobilni */
@media (max-width: 767px) {
  .gsm-hero {
    position: relative;
    min-height: 360px;
    background-position: 65% center;
  }

  /* Tamni prelaz slijeva da tekst bude čitljiv preko gitare */
  .gsm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      90deg,
      rgba(9, 16, 23, 0.85) 0%,
      rgba(9, 16, 23, 0.4) 70%,
      rgba(9, 16, 23, 0) 100%
    );
  }

  .gsm-hero > .gsm-container {
    position: relative;
  }

  .gsm-hero__content {
    padding: 40px 0 48px;
  }

  .gsm-hero .gsm-hero__title {
    font-size: 38px;
    line-height: 46px;
  }

  .gsm-hero__line {
    width: 160px;
    height: 13px;
  }

  .gsm-hero .gsm-hero__text {
    font-size: 17px;
    line-height: 22px;
  }

  .gsm-catcards {
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
  }

  .gsm-catcard {
    height: 80px;
  }

  .gsm-catcard__body {
    top: 2px;
    left: 40px;
    height: 76px;
    padding: 0 10px 0 48px;
  }

  .gsm-catcard__name {
    font-size: 13px;
  }

  .gsm-catcard .gsm-catcard__img {
    width: 84.8px;
    height: 84.8px;
    top: -1px;
    left: -2.4px;
  }
}

/* Traka prednosti (Figma 10:136) */
.gsm-features {
  position: relative;
  z-index: 5;
  background: var(--gsm-light);
}

.gsm-features__list {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 90px;
  margin: 0;
  padding: 15px 0 0;
  list-style: none;
  box-sizing: border-box;
}

.gsm-feature {
  position: relative;
  margin: 0;
}

.gsm-feature__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 12px;
  color: #17191d;
  text-align: center;
  text-decoration: none;
}

.gsm-feature__icon {
  width: 24px;
  height: 24px;
}

.gsm-feature__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  white-space: nowrap;
}

.gsm-feature__text {
  font-size: 10px;
  font-weight: 400;
  line-height: 12px;
  white-space: nowrap;
}

.gsm-feature__link:hover .gsm-feature__title {
  color: var(--gsm-orange);
}

/* Popover sa detaljima, samo za uređaje sa hoverom */
.gsm-feature__details {
  display: none;
}

@media (hover: hover) {
  .gsm-feature__details {
    position: absolute;
    top: 100%;
    left: 50%;
    display: block;
    width: 300px;
    padding: 16px 18px;
    border-radius: var(--gsm-radius);
    background: var(--gsm-white);
    box-shadow: 0 12px 32px rgba(9, 16, 23, 0.16);
    color: #3a3f47;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition:
      opacity 0.15s,
      transform 0.15s,
      visibility 0.15s;
  }

  .gsm-feature__details::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--gsm-white);
    transform: translateX(-50%) rotate(45deg);
  }

  .gsm-feature__details p {
    margin: 0 0 8px;
  }

  .gsm-feature__details a {
    color: var(--gsm-orange);
    font-weight: 600;
    text-decoration: none;
  }

  .gsm-feature:hover .gsm-feature__details,
  .gsm-feature:focus-within .gsm-feature__details {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* Manji ekrani: jedan red sa horizontalnim scrollom umjesto mreže (mreža je zauzimala
   pola ekrana na telefonu). Lista ide do ivica ekrana, gutter je padding da se vidi da ima još. */
@media (max-width: 1023px) {
  .gsm-features__list {
    justify-content: flex-start;
    gap: 28px;
    min-height: 0;
    margin: 0 calc(-1 * var(--gsm-gutter));
    padding: 14px var(--gsm-gutter);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 0 var(--gsm-gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .gsm-features__list::-webkit-scrollbar {
    display: none;
  }

  .gsm-feature {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .gsm-feature__link {
    padding-bottom: 0;
  }

  /* overflow bi odsjekao popover, a na ovim širinama ionako vodimo na stranicu */
  .gsm-feature__details {
    display: none !important;
  }
}
