/* ==============================================================================
   Azim Tools - Home Categories Styling & Precision Industrial Animations
   استایل و انیمیشن‌های ظریف و مدرن کارت‌های دسته‌بندی با حس سرعت و دقت صنعتی
   ============================================================================== */

.az-home-categories {
  padding: 38px 0 14px;
  position: relative;
  z-index: 2;
}

.az-home-categories-wrap {
  width: min(1200px, calc(100% - 30px));
  margin: auto;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(245, 185, 0, 0.2);
  background: linear-gradient(160deg, rgba(18, 23, 20, 0.95), rgba(9, 12, 10, 0.94));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.06);
  position: relative;
}

/* Subtle corner reticle accents indicating industrial calibration */
.az-home-categories-wrap::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 185, 0, 0.5), transparent);
}

.az-home-categories-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.az-home-categories-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  font-weight: 900;
  color: #d4af37;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.az-home-categories-head h2 {
  margin: 0;
  color: #f7f8f6;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.az-home-categories-head p {
  margin: 7px 0 0;
  color: #87938b;
  font-size: 11.5px;
  line-height: 1.6;
}

.az-home-categories-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(245, 185, 0, 0.35);
  border-radius: 12px;
  color: #f8d66a;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(245, 185, 0, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.az-home-categories-all:hover {
  background: rgba(245, 185, 0, 0.16);
  border-color: rgba(245, 185, 0, 0.7);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 185, 0, 0.25);
}

.az-home-categories-status {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 24px;
  margin: 2px 0 16px;
  color: #87938b;
  font-size: 10.5px;
}

.az-home-categories-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

/* ==============================================================================
   Precision Industrial Category Card
   کارت دسته‌بندی با انیمیشن‌های ظریف، خط لیزری هدایت و پاسخ‌دهی سریع فیزیکی
   ============================================================================== */
.az-home-category-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 106px;
  padding: 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(160deg, #141a16 0%, #0d120f 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.28s ease;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
}

/* Precision Top Laser Line (انبساط متقارن خط لیزری طلایی در هاور) */
.az-home-category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd84f 50%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 8px rgba(245, 185, 0, 0.6);
}

/* Precision High-Speed Metallic Shimmer Sweep (عبور بازتاب نور صیقلی فولاد صنعتی) */
.az-home-category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 25%,
    rgba(255, 216, 79, 0.05) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 216, 79, 0.05) 55%,
    transparent 75%
  );
  transform: translateX(120%);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

/* Hover State with Tactical Lift and Calibrated Glow */
.az-home-category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 185, 0, 0.5);
  background: linear-gradient(160deg, #19221c 0%, #101713 100%);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.45),
    0 0 25px rgba(245, 185, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.az-home-category-card:hover::before {
  transform: scaleX(1);
  opacity: 1;
}

.az-home-category-card:hover::after {
  transform: translateX(-120%);
}

.az-home-category-card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 0.1s;
}

/* Category Icon Housing */
.az-home-category-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #ffd84f, #c78600);
  color: #111;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease;
}

.az-home-category-card:hover .az-home-category-icon {
  transform: scale(1.07) rotate(-2deg);
  box-shadow: 0 8px 22px rgba(245, 185, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.5);
}

.az-home-category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.az-home-category-card:hover .az-home-category-icon img {
  transform: scale(1.12);
}

.az-home-category-copy {
  min-width: 0;
  position: relative;
  z-index: 2;
}

.az-home-category-index {
  display: block;
  margin-bottom: 4px;
  color: #9e8840;
  font-size: 7.5px;
  letter-spacing: 0.14em;
  font-weight: 950;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.az-home-category-card:hover .az-home-category-index {
  color: #ffd84f;
  text-shadow: 0 0 8px rgba(245, 185, 0, 0.45);
}

.az-home-category-copy strong {
  display: block;
  color: #eef2ee;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.az-home-category-card:hover .az-home-category-copy strong {
  color: #ffffff;
}

.az-home-category-copy small {
  display: block;
  margin-top: 4px;
  color: #7d8b82;
  font-size: 8.5px;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.25s ease;
}

.az-home-category-card:hover .az-home-category-copy small {
  color: #a0ada4;
}

/* Category Count & Arrow */
.az-home-category-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  position: relative;
  z-index: 2;
}

.az-home-category-count b {
  color: #f5c22a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  font-family: ui-monospace, monospace;
  transition:
    color 0.25s ease,
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    text-shadow 0.25s ease;
}

.az-home-category-card:hover .az-home-category-count b {
  color: #ffe17d;
  transform: scale(1.06);
  text-shadow: 0 0 12px rgba(245, 185, 0, 0.55);
}

.az-home-category-count span {
  color: #6f7a73;
  font-size: 7.5px;
  font-weight: 600;
  transition: color 0.25s ease;
}

.az-home-category-card:hover .az-home-category-count span {
  color: #8f9b93;
}

.az-home-category-count i {
  margin-top: 4px;
  color: #8c968f;
  font-style: normal;
  font-size: 13px;
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.25s ease;
}

.az-home-category-card:hover .az-home-category-count i {
  transform: translateX(-5px);
  color: #ffd84f;
}

/* Error and Retry State */
.az-home-categories-error {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  border: 1px dashed rgba(245, 185, 0, 0.22);
  border-radius: 16px;
  color: #a0aaa3;
}

.az-home-categories-error strong {
  display: block;
  color: #f3f4f3;
  font-size: 12.5px;
}

.az-home-categories-error span {
  display: block;
  margin-top: 7px;
  font-size: 9.5px;
}

.az-home-categories-retry {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(245, 185, 0, 0.35);
  background: rgba(245, 185, 0, 0.08);
  color: #f5d260;
  font: inherit;
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.az-home-categories-retry:hover {
  background: rgba(245, 185, 0, 0.18);
  color: #fff;
  border-color: rgba(245, 185, 0, 0.6);
}

/* Responsive Grid Rules */
@media (max-width: 1100px) {
  .az-home-categories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .az-home-categories {
    padding-top: 24px;
  }
  .az-home-categories-wrap {
    padding: 16px;
  }
  .az-home-categories-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .az-home-categories-head h2 {
    font-size: 20px;
  }
  .az-home-categories-all {
    width: 100%;
  }
  .az-home-categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .az-home-category-card {
    grid-template-columns: 42px 1fr auto;
    padding: 10px 10px;
  }
}

@media (max-width: 460px) {
  .az-home-categories-grid {
    grid-template-columns: 1fr;
  }
  .az-home-category-card {
    min-height: 94px;
  }
}

/* Accessibility: Respect Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  .az-home-category-card,
  .az-home-category-card::before,
  .az-home-category-card::after,
  .az-home-category-icon,
  .az-home-category-icon img,
  .az-home-category-count b,
  .az-home-category-count i,
  .az-home-categories-all {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
