/* =================================
   Category page — compact app grid
   target style: downloade.app /category/*
   ================================= */

:root {
  --card-bg: #ffffff;
  --card-border: #f3f4f6;
  --card-border-hover: #d1d5db;
  --card-bg-hover: #f9fafb;
  --text-primary: #101828;
  --text-secondary: #4a5565;
  --theme: #1E77FF;
}

/* layout container */
.cat-wrap {
  width: 100%;
  max-width: 1248px;
  min-height: 70vh;
  margin: 0 auto;
  padding: 16px 24px 48px;
  box-sizing: border-box;
}

/* page header */
.cat-header {
  margin-bottom: 24px;
}

.cat-title {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.cat-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* grid */
.cat-app-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.cat-app-grid > * {
  min-width: 0;
}

/* card */
.cat-app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cat-app-card:hover {
  border-color: var(--card-border-hover);
  background: var(--card-bg-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.cat-app-card__icon {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}

.cat-app-card__name {
  display: block;
  width: 100%;
  max-width: 100%;
  color: var(--text-primary);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-app-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.cat-app-card__rating svg {
  width: 12px;
  height: 12px;
  fill: #FDC700;
  flex-shrink: 0;
}

/* load more */
.cat-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.cat-load-more {
  min-width: 160px;
  height: 44px;
  padding: 0 24px;
  background: #ffffff;
  border: 1px solid var(--card-border-hover);
  border-radius: 22px;
  color: var(--theme);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.cat-load-more:hover {
  background: var(--theme);
  border-color: var(--theme);
  color: #ffffff;
}

.cat-load-more:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ad spacing */
.cat-wrap .ad-box {
  margin: 16px 0;
}

/* ===== breakpoints ===== */
@media (max-width: 1023px) {
  .cat-app-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .cat-title {
    font-size: 28px;
  }
}

@media (max-width: 767px) {
  .cat-wrap {
    padding: 12px 16px 32px;
  }
  .cat-app-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .cat-app-card {
    padding: 12px;
  }
  .cat-title {
    font-size: 24px;
  }
  .cat-subtitle {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .cat-app-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .cat-app-card {
    padding: 12px;
  }
  .cat-app-card__icon {
    width: 56px;
    height: 56px;
  }
  .cat-title {
    font-size: 22px;
  }
}
