/* Qoffa Smart — compact square category explorer */
body.index-page .categories-section {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, #f6f9f2 100%);
}

body.index-page .categories-section::before {
  top: 7%;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  text-align: center;
  font-size: clamp(3.2rem, 8vw, 8rem);
  color: rgba(28, 107, 73, .035);
}

body.index-page .categories-section .section-header {
  max-width: 690px;
  margin-inline: auto;
  margin-bottom: clamp(25px, 3.5vw, 38px);
  text-align: center;
}

body.index-page .categories-section .section-title {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

body.index-page .categories-section .section-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(28, 107, 73, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: #718078;
  font-size: .88rem;
  backdrop-filter: blur(8px);
}

body.index-page .categories-section .section-subtitle::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fresh-lime);
  box-shadow: 0 0 0 5px rgba(214, 237, 128, .2);
}

body.index-page .categories-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  width: min(100%, 940px);
  gap: clamp(8px, 1.4vw, 16px);
  margin-inline: auto;
}

body.index-page .category-card,
body.index-page .category-card:first-child,
body.index-page .category-card:nth-child(2) {
  grid-column: auto !important;
  grid-row: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: clamp(18px, 2.2vw, 28px);
  background: #dfeee0;
  box-shadow: 0 16px 32px rgba(28, 107, 73, .11);
  isolation: isolate;
  transition: transform .45s var(--motion-spring, cubic-bezier(.16, 1, .3, 1)), box-shadow .35s ease, border-color .35s ease;
}

body.index-page .category-card::after {
  content: '↗';
  position: absolute;
  z-index: 4;
  inset-inline-start: 12px;
  top: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 50%;
  background: rgba(15, 48, 32, .28);
  color: #fff;
  font: 800 .9rem/1 'DM Sans', sans-serif;
  opacity: 0;
  transform: translate(-5px, 5px);
  backdrop-filter: blur(8px);
  transition: transform .35s var(--motion-spring, ease), opacity .35s ease, background-color .35s ease, color .35s ease;
}

body.index-page .category-card:hover {
  transform: translateY(-8px) scale(1.025);
  border-color: rgba(214, 237, 128, .8);
  box-shadow: 0 26px 44px rgba(28, 107, 73, .19);
}

body.index-page .category-card:hover::after {
  opacity: 1;
  transform: translate(0, 0);
  background: var(--fresh-lime);
  color: var(--fresh-green);
}

body.index-page .category-image,
body.index-page .category-card .category-image {
  position: absolute;
  inset: 0;
  height: 100%;
  border-radius: inherit;
}

body.index-page .category-image::before {
  z-index: 1;
  background: linear-gradient(160deg, rgba(18, 46, 32, .02) 20%, rgba(7, 41, 27, .28) 100%);
}

body.index-page .category-image::after {
  z-index: 2;
  background: linear-gradient(180deg, rgba(5, 31, 20, .06) 10%, rgba(5, 31, 20, .12) 46%, rgba(5, 31, 20, .84) 100%);
}

body.index-page .category-image img {
  transform: scale(1.001);
  filter: saturate(1.1) contrast(1.02);
  transition: transform .75s var(--motion-spring, ease), filter .45s ease;
}

body.index-page .category-card:hover .category-image img {
  transform: scale(1.12) rotate(1.2deg);
  filter: saturate(1.22) contrast(1.06);
}

body.index-page .category-content {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: auto;
  padding: clamp(12px, 1.8vw, 18px);
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: start;
  color: #fff;
  transform: none;
}

body.index-page .category-content > i {
  grid-row: 1;
  align-self: start;
  justify-self: end;
  width: clamp(34px, 4vw, 44px);
  height: clamp(34px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, .27);
  border-radius: clamp(11px, 1.3vw, 15px);
  background: rgba(255, 255, 255, .16);
  color: var(--fresh-lime);
  font-size: clamp(.88rem, 1.3vw, 1.12rem);
  box-shadow: none;
  backdrop-filter: blur(9px);
  transition: transform .4s var(--motion-spring, ease), background-color .35s ease, color .35s ease;
}

body.index-page .category-content h3 {
  grid-row: 2;
  align-self: end;
  margin: 0;
  color: #fff;
  font-size: clamp(.94rem, 1.6vw, 1.22rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.04em;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .35);
}

body.index-page .category-link {
  display: none;
}

body.index-page .category-card:hover .category-content > i {
  transform: rotate(-9deg) scale(1.08);
  background: var(--fresh-lime);
  color: var(--fresh-green);
}

body.index-page .category-card:nth-child(1) .category-image::before {
  background: linear-gradient(155deg, rgba(241, 154, 87, .1), rgba(12, 70, 44, .26));
}

body.index-page .category-card:nth-child(2) .category-image::before {
  background: linear-gradient(155deg, rgba(214, 237, 128, .15), rgba(8, 79, 47, .27));
}

body.index-page .category-card:nth-child(3) .category-image::before {
  background: linear-gradient(155deg, rgba(126, 190, 150, .14), rgba(7, 64, 43, .29));
}

body.index-page .category-card:nth-child(4) .category-image::before {
  background: linear-gradient(155deg, rgba(241, 154, 87, .13), rgba(46, 90, 56, .29));
}

@media (max-width: 600px) {
  body.index-page .categories-section .section-header {
    margin-bottom: 23px;
  }

  body.index-page .categories-section .section-subtitle {
    max-width: 92%;
    justify-content: center;
    font-size: .76rem;
    text-align: center;
  }

  body.index-page .categories-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  body.index-page .category-card,
  body.index-page .category-card:first-child,
  body.index-page .category-card:nth-child(2) {
    border-radius: 17px;
  }

  body.index-page .category-content {
    padding: 9px;
  }

  body.index-page .category-content > i {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: .76rem;
  }

  body.index-page .category-content h3 {
    font-size: clamp(.61rem, 2.4vw, .82rem);
    line-height: 1.2;
  }

  body.index-page .category-card::after {
    display: none;
  }
}

@media (max-width: 360px) {
  body.index-page .categories-grid {
    gap: 6px;
  }

  body.index-page .category-content {
    padding: 7px;
  }

  body.index-page .category-content > i {
    width: 25px;
    height: 25px;
    font-size: .67rem;
  }

  body.index-page .category-content h3 {
    font-size: .58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.index-page .category-card,
  body.index-page .category-card:hover,
  body.index-page .category-image img,
  body.index-page .category-card:hover .category-image img,
  body.index-page .category-content > i {
    transform: none;
  }
}
