/* Build 1010 RC2.5.8 — Exact clean reference category strip */
.compact-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.compact-category-card.modern-category-card {
  position: relative;
  min-height: 150px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #e3e8ee;
  border-radius: 20px;
  background:
    radial-gradient(circle at 5% 0%, rgba(255, 101, 0, .14), transparent 46%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 12px 28px rgba(17, 31, 48, .09);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.compact-category-card.modern-category-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, #ff5a19, #ff8a3d);
  opacity: 0;
  transition: opacity .22s ease;
}

.compact-category-card.modern-category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 101, 0, .46);
  box-shadow: 0 20px 40px rgba(17, 31, 48, .15);
}

.compact-category-card.modern-category-card:hover::after {
  opacity: 1;
}

.modern-category-visual {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #eef2f6);
  box-shadow: inset 0 0 0 1px rgba(16, 31, 48, .06);
}

.modern-category-visual img,
.compact-category-card.modern-category-card .modern-category-visual img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 8px 10px rgba(17, 31, 48, .12));
}

.modern-category-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.modern-category-copy strong {
  color: #101820;
  font-size: 15px;
  line-height: 1.18;
}

.modern-category-copy small {
  color: #7a8491;
  font-size: 12px;
  font-weight: 650;
}

.modern-category-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff1e8;
  color: #ff5a19;
  font-size: 18px;
  font-weight: 900;
  transition: transform .22s ease, background .22s ease, color .22s ease;
}

.modern-category-card:hover .modern-category-arrow {
  transform: translateX(3px);
  background: #ff5a19;
  color: #fff;
}

.random-section {
  margin-top: 34px;
  padding: 26px;
  border: 1px solid #e5e9ee;
  border-radius: 24px;
  background: linear-gradient(145deg, #fffaf6, #fff);
  box-shadow: 0 14px 38px rgba(17, 31, 48, .08);
}

.section-subtitle {
  margin: 7px 0 0 38px;
  color: #7a8491;
  font-size: 13px;
}

.random-refresh {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid #ffcab0;
  border-radius: 12px;
  background: #fff;
  color: #e84f0d;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.random-refresh:hover {
  transform: translateY(-2px);
  background: #ff5a19;
  color: #fff;
}

.random-refresh span {
  font-size: 21px;
}

.random-products-grid {
  transition: opacity .14s ease, transform .14s ease;
}

.random-products-grid.is-changing {
  opacity: .2;
  transform: translateY(4px);
}

@media (max-width: 1380px) {
  .compact-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .compact-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compact-category-card.modern-category-card {
    min-height: 132px;
    grid-template-columns: 64px minmax(0, 1fr) 30px;
    padding: 14px;
  }
  .modern-category-visual {
    width: 64px;
    height: 64px;
  }
  .modern-category-visual img,
  .compact-category-card.modern-category-card .modern-category-visual img {
    width: 47px;
    height: 47px;
  }
}

@media (max-width: 560px) {
  .compact-category-grid {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .compact-category-card.modern-category-card {
    min-width: 0;
    min-height: 112px;
  }
  .random-section {
    margin-top: 26px;
    padding: 18px 12px;
    border-radius: 19px;
  }
  .random-section .section-head {
    align-items: flex-start;
    gap: 14px;
  }
  .random-refresh {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }
  .section-subtitle {
    margin-left: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modern-category-card,
  .modern-category-arrow,
  .random-products-grid {
    transition: none !important;
  }
}

/* Bright visual layer */
.compact-category-card.modern-category-card {
  min-height: 164px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff5a19, #ff8d42);
  box-shadow: 0 16px 34px rgba(232, 79, 13, .24);
}
.compact-category-card.modern-category-card:nth-child(3n+2) {
  background: linear-gradient(135deg, #132f4c, #245a82);
  box-shadow: 0 16px 34px rgba(19, 47, 76, .22);
}
.compact-category-card.modern-category-card:nth-child(3n+3) {
  background: linear-gradient(135deg, #7a3cf0, #a55cf5);
  box-shadow: 0 16px 34px rgba(122, 60, 240, .22);
}
.compact-category-card.modern-category-card::before {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -48px;
  top: -54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.compact-category-card.modern-category-card::after {
  height: 5px;
  background: rgba(255, 255, 255, .82);
}
.compact-category-card.modern-category-card:hover {
  border-color: transparent;
  box-shadow: 0 23px 48px rgba(17, 31, 48, .25);
}
.modern-category-visual {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
}
.modern-category-copy {
  position: relative;
  z-index: 1;
}
.modern-category-copy strong {
  color: #fff;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.modern-category-copy small {
  color: rgba(255, 255, 255, .85);
}
.modern-category-arrow {
  position: relative;
  z-index: 1;
  color: #132f4c;
  background: #fff;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .16);
}
.modern-category-card:hover .modern-category-arrow {
  color: #ff5a19;
  background: #fff;
}

/* Real photo layout */
.compact-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.compact-category-card.modern-category-card {
  min-height: 190px;
  grid-template-columns: minmax(0, 1fr) 46%;
  grid-template-rows: 1fr;
  padding: 22px;
}
.modern-category-visual {
  order: 2;
  width: 100%;
  height: 146px;
  overflow: hidden;
  border-radius: 18px;
}
.modern-category-visual img,
.compact-category-card.modern-category-card .modern-category-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}
.modern-category-copy {
  order: 1;
  align-self: center;
  padding: 0 4px 42px 0;
}
.modern-category-copy strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.18;
  overflow-wrap: normal;
  word-break: normal;
}
.modern-category-copy small {
  margin-top: 3px;
  font-size: 13px;
}
.modern-category-arrow {
  position: absolute;
  left: 22px;
  bottom: 19px;
}
@media (max-width: 1100px) {
  .compact-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .compact-category-grid { grid-template-columns: 1fr; }
  .compact-category-card.modern-category-card {
    min-height: 168px;
    grid-template-columns: minmax(0, 1fr) 42%;
    padding: 17px;
  }
  .modern-category-visual { height: 132px; }
  .modern-category-copy strong { font-size: 17px; }
  .modern-category-arrow { left: 17px; bottom: 15px; }
}

/* Build 1010 RC2.5.5 — clean light category cards without counters */
.compact-category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.compact-category-card.modern-category-card,
.compact-category-card.modern-category-card:nth-child(3n+2),
.compact-category-card.modern-category-card:nth-child(3n+3) {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e2e7ed;
  border-radius: 22px;
  background: #fff;
  color: #101820;
  box-shadow: 0 12px 30px rgba(17, 31, 48, .10);
}
.compact-category-card.modern-category-card::before,
.compact-category-card.modern-category-card::after {
  display: none;
}
.compact-category-card.modern-category-card:hover {
  transform: translateY(-6px);
  border-color: #ff8d56;
  box-shadow: 0 22px 44px rgba(17, 31, 48, .16);
}
.modern-category-visual {
  order: 1;
  width: 100%;
  height: 205px;
  flex: 0 0 205px;
  border-radius: 0;
  background: #f2f4f6;
  box-shadow: none;
}
.modern-category-visual img,
.compact-category-card.modern-category-card .modern-category-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.modern-category-card:hover .modern-category-visual img {
  transform: scale(1.045);
}
.modern-category-copy {
  order: 2;
  width: 100%;
  min-height: 65px;
  display: flex;
  justify-content: center;
  padding: 15px 54px 15px 18px;
  text-align: left;
}
.modern-category-copy strong {
  color: #101820;
  font-size: 16px;
  line-height: 1.22;
  text-shadow: none;
  -webkit-line-clamp: 2;
}
.modern-category-arrow {
  left: auto;
  right: 17px;
  bottom: 15px;
  color: #fff;
  background: #ff5a19;
  box-shadow: none;
}
.modern-category-card:hover .modern-category-arrow {
  color: #fff;
  background: #e84f0d;
  transform: translateX(3px);
}
@media (max-width: 1180px) {
  .compact-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .compact-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .compact-category-grid { grid-template-columns: 1fr; }
  .compact-category-card.modern-category-card { min-height: 245px; }
  .modern-category-visual { height: 180px; flex-basis: 180px; }
}

/* Build 1010 RC2.5.6 — compact horizontal category strip */
.premium-category-section {
  overflow: hidden;
}
.compact-category-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(145px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding: 3px 3px 13px;
  scrollbar-width: thin;
  scrollbar-color: #ffb38c #f2f4f6;
}
.compact-category-card.modern-category-card,
.compact-category-card.modern-category-card:nth-child(3n+2),
.compact-category-card.modern-category-card:nth-child(3n+3) {
  min-width: 145px;
  min-height: 82px;
  height: 82px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e1e6eb;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(17, 31, 48, .07);
}
.compact-category-card.modern-category-card:hover {
  transform: translateY(-3px);
  border-color: #ff8d56;
  box-shadow: 0 12px 24px rgba(17, 31, 48, .12);
}
.modern-category-visual {
  order: 1;
  width: 58px;
  height: 60px;
  flex: none;
  overflow: hidden;
  border-radius: 9px;
  background: #f3f5f7;
}
.modern-category-visual img,
.compact-category-card.modern-category-card .modern-category-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modern-category-copy {
  order: 2;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  align-self: center;
  text-align: left;
}
.modern-category-copy strong {
  color: #101820;
  font-size: 12px;
  line-height: 1.18;
  font-weight: 850;
  -webkit-line-clamp: 3;
}
.modern-category-arrow {
  display: none;
}
@media (max-width: 1250px) {
  .compact-category-grid {
    grid-template-columns: repeat(9, 155px);
  }
}
@media (max-width: 620px) {
  .compact-category-grid {
    display: grid;
    grid-template-columns: repeat(9, 148px);
    gap: 8px;
    overflow-x: auto;
  }
  .compact-category-card.modern-category-card {
    min-width: 148px;
    min-height: 78px;
    height: 78px;
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 9px;
  }
  .modern-category-visual {
    width: 54px;
    height: 56px;
  }
  .modern-category-copy strong {
    font-size: 11.5px;
  }
}

/* Build 1010 RC2.5.7 — exact reference category card layout */
.compact-category-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  overflow: visible;
  padding: 3px 0 12px;
}
.compact-category-card.modern-category-card,
.compact-category-card.modern-category-card:nth-child(3n+2),
.compact-category-card.modern-category-card:nth-child(3n+3) {
  min-width: 0;
  width: 100%;
  height: 82px;
  min-height: 82px;
  display: grid;
  grid-template-columns: 59px minmax(0, 1fr) 32px;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid #dfe4e9;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(17, 31, 48, .07);
}
.modern-category-visual {
  order: 1;
  width: 59px;
  height: 62px;
  overflow: hidden;
  border-radius: 9px;
  background: #f0f2f4;
}
.modern-category-visual img,
.compact-category-card.modern-category-card .modern-category-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}
.modern-category-copy {
  order: 2;
  min-width: 0;
  width: auto;
  min-height: 0;
  padding: 0;
  align-self: center;
  text-align: left;
}
.modern-category-copy strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #101820;
  font-size: 11.5px;
  line-height: 1.16;
  font-weight: 900;
  text-shadow: none;
  word-break: normal;
  overflow-wrap: anywhere;
}
.modern-category-arrow {
  order: 3;
  position: static;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #ff5a19;
  box-shadow: none;
  font-size: 16px;
  font-weight: 900;
}
.modern-category-card:hover .modern-category-arrow {
  color: #fff;
  background: #e84f0d;
  transform: translateX(2px);
}
@media (max-width: 1250px) {
  .compact-category-grid {
    grid-template-columns: repeat(9, 164px);
    overflow-x: auto;
  }
}
@media (max-width: 620px) {
  .compact-category-grid {
    grid-template-columns: repeat(9, 164px);
    gap: 8px;
    overflow-x: auto;
  }
  .compact-category-card.modern-category-card {
    min-width: 164px;
    height: 80px;
    min-height: 80px;
    grid-template-columns: 57px minmax(0, 1fr) 30px;
    gap: 7px;
    padding: 8px;
  }
  .modern-category-visual {
    width: 57px;
    height: 62px;
  }
  .modern-category-arrow {
    width: 30px;
    height: 30px;
  }
}

/* Build 1010 RC2.5.8 — exact clean reference without arrows */
.compact-category-grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 9px;
}
.compact-category-card.modern-category-card,
.compact-category-card.modern-category-card:nth-child(3n+2),
.compact-category-card.modern-category-card:nth-child(3n+3) {
  height: 82px;
  min-height: 82px;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #e4e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 13px rgba(17, 31, 48, .055);
}
.modern-category-visual {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f7f7f7;
}
.modern-category-visual img,
.compact-category-card.modern-category-card .modern-category-visual img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}
.modern-category-copy strong {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
  -webkit-line-clamp: 3;
}
.modern-category-arrow {
  display: none !important;
}
@media (max-width: 1250px) {
  .compact-category-grid {
    grid-template-columns: repeat(9, 172px);
    overflow-x: auto;
  }
}
@media (max-width: 620px) {
  .compact-category-grid {
    grid-template-columns: repeat(9, 172px);
  }
  .compact-category-card.modern-category-card {
    min-width: 172px;
    grid-template-columns: 60px minmax(0, 1fr);
  }
}
