
/* ── Categories Modal (Global) ─────────────────────────── */
.cat-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.cat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.cat-modal-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  background: #fff;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(20px);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.cat-modal.active .cat-modal-content {
  transform: scale(1) translateY(0);
}

.cat-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.cat-modal-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
}

.btn-close-modal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-close-modal:hover {
  background: #E5E7EB;
  color: #111827;
  transform: rotate(90deg);
}

.cat-modal-body {
  padding: 32px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #E5E7EB transparent;
}

.cat-modal-body::-webkit-scrollbar {
  width: 6px;
}

.cat-modal-body::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 10px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.cat-item {
  position: relative;
  background: #fff;
  border: 2px solid #f3f4f6;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cat-item:hover {
  border-color: var(--brand-yellow);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.cat-item.selected {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-light);
}

.cat-item.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: var(--brand-yellow);
  color: #111827;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
}

.cat-img-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: #f3f4f6;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.cat-item:hover .cat-img-wrap {
  transform: scale(1.1);
}

.cat-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-item span {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.cat-modal-footer {
  padding: 24px 32px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  background: #fff;
}

.btn-continue {
  padding: 14px 48px;
  background: #111827;
  color: #fff;
  border-radius: 16px;
  font-weight: 800;
  font-size: 16px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-continue:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
  .cat-modal-content {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .cat-item {
    padding: 16px;
  }

  .cat-img-wrap {
    width: 60px;
    height: 60px;
  }

  .cat-modal-header {
    padding: 16px 20px;
  }

  .cat-modal-body {
    padding: 20px;
  }

  .cat-modal-footer {
    padding: 16px 20px;
  }

  .btn-continue {
    width: 100%;
  }
}
