*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Open Sans", sans-serif;
  background: #fff;
  color: #1e293b;
  line-height: 1.6;
  min-height: 100vh;
}

main { max-width: 1140px; margin: 0 auto; padding: 24px 20px; }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: 16px; font-size: 13px; }
.breadcrumbs a { color: #94a3b8; text-decoration: none; }
.breadcrumbs a:hover { color: #64748b; text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: #cbd5e1; }

/* Card */
.card {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  background: #fff;
  overflow: hidden;
}

.card__title {
  display: flex;
  align-items: center;
  padding: 30px 40px;
}
.card__title h3 {
  flex: 1; margin: 0; color: #252525;
  font-family: "Montserrat", sans-serif;
  font-weight: 600; font-size: 20px;
  text-transform: uppercase; line-height: 1.3;
}
.card__title .icon {
  flex-shrink: 0; background: #009afe; color: #fff;
  padding: 10px 14px; transition: 200ms;
  margin-left: 20px; text-decoration: none; font-size: 18px;
}
.card__title .icon:hover { background: #252525; }
.card__title .count {
  font-family: "Montserrat", sans-serif;
  font-size: 13px; color: #999; font-weight: 400;
  margin-left: 12px;
}

.card__body { padding: 0 40px; margin-bottom: 25px; }

/* Description */
.description-text {
  font-family: "Open Sans", sans-serif; font-weight: 300;
  line-height: 27px; font-size: 16px; color: #555;
  white-space: pre-wrap; margin-bottom: 24px;
}

/* Children list (category page) */
.children-list { list-style: none; }
.children-list li {
  border-bottom: 1px solid #eee; transition: 200ms;
}
.children-list li:last-child { border-bottom: none; }
.children-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; text-decoration: none; color: #252525;
  font-family: "Montserrat", sans-serif; font-size: 14px; transition: 200ms;
}
.children-list li a:hover { color: #009afe; }
.children-list .item-name { font-weight: 500; flex: 1; }
.children-list .item-folder { color: #009afe; font-weight: 600; font-size: 15px; }
.children-list .item-price {
  font-family: "Fjalla One", sans-serif;
  font-size: 16px; color: #252525; white-space: nowrap; margin-left: 16px;
}

.no-items {
  color: #999; font-style: italic; padding: 20px 0;
  font-family: "Open Sans", sans-serif;
}

/* Card Footer */
.card__footer {
  padding: 30px 40px;
  display: flex; flex-flow: row nowrap;
  align-items: center; position: relative;
}
.card__footer::before {
  content: ""; position: absolute; display: block; top: 0; left: 40px;
  width: calc(100% - 80px); height: 3px;
  background: linear-gradient(to right, #009afe 0%, #009afe 20%, #ddd 20%, #ddd 100%);
}
.card__footer .recommend { flex: 1; }
.card__footer .recommend p {
  margin: 0; font-family: "Montserrat", sans-serif;
  text-transform: uppercase; font-weight: 600; font-size: 12px; color: #999;
}
.card__footer .recommend h3 {
  margin: 0; font-size: 16px; font-family: "Montserrat", sans-serif;
  font-weight: 600; text-transform: uppercase; color: #009afe;
}
.card__footer .recommend h3 a { color: #009afe; text-decoration: none; }
.card__footer .recommend h3 a:hover { text-decoration: underline; }
.card__footer .action button {
  cursor: pointer; border: 1px solid #009afe; padding: 14px 30px;
  border-radius: 200px; color: #fff; background: #009afe;
  font-family: "Open Sans", sans-serif; font-size: 16px; transition: 200ms;
}
.card__footer .action button:hover { background: #fff; color: #009afe; }
.card__footer .info {
  flex: 1; font-family: "Montserrat", sans-serif;
  font-size: 13px; color: #999;
}
.card__footer .info strong { color: #009afe; }

/* Tree view (index page) */
.category-block { margin-bottom: 2px; border-bottom: 1px solid #eee; }
.category-block:last-child { border-bottom: none; }
.category-header {
  padding: 16px 0; font-family: "Montserrat", sans-serif;
  font-weight: 600; font-size: 15px; color: #009afe;
  cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; user-select: none;
  transition: 200ms; text-transform: uppercase;
}
.category-header:hover { color: #252525; }
.category-header .toggle { font-size: 12px; color: #999; transition: transform 0.2s; }
.category-block.collapsed .toggle,
.subcategory-block.collapsed .toggle { transform: rotate(-90deg); }
.category-block.collapsed .category-services,
.subcategory-block.collapsed .category-services { display: none; }
.category-services { padding-left: 0; }
.subcategory-block { margin: 0; border-bottom: 1px solid #f0f0f0; }
.subcategory-block:last-child { border-bottom: none; }
.subcategory-header {
  padding: 12px 0 12px 20px; font-family: "Montserrat", sans-serif;
  font-weight: 600; font-size: 13px; color: #555;
  cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; user-select: none; transition: 200ms;
}
.subcategory-header:hover { color: #009afe; }
.service-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 12px 20px; border-bottom: 1px solid #f5f5f5; gap: 16px;
}
.service-row:last-child { border-bottom: none; }
.service-row:hover { background: #fafafa; }
.service-row-link {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-decoration: none; color: inherit; gap: 16px;
}
.service-row-link:hover .service-row-name { color: #009afe; }
.service-row-name {
  flex: 1; min-width: 200px; font-size: 14px;
  font-family: "Open Sans", sans-serif; transition: 200ms;
}
.service-row-price {
  font-family: "Fjalla One", sans-serif;
  font-size: 16px; color: #252525; white-space: nowrap;
}
.category-link { text-decoration: none; color: inherit; flex: 1; }
.category-link:hover { text-decoration: underline; }

/* Search */
.search-section {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap;
}
.search-section label {
  font-family: "Montserrat", sans-serif; font-weight: 600;
  font-size: 13px; color: #999; text-transform: uppercase; white-space: nowrap;
}
.search-input {
  flex: 1; min-width: 200px; padding: 12px 18px;
  border: 1px solid #ddd; font-size: 15px;
  font-family: "Open Sans", sans-serif; outline: none; transition: 200ms;
}
.search-input:focus { border-color: #009afe; }
.search-input::placeholder { color: #bbb; }

.btn {
  cursor: pointer; border: 1px solid #009afe; padding: 12px 28px;
  border-radius: 200px; font-family: "Open Sans", sans-serif;
  font-size: 15px; font-weight: 600; transition: 200ms; white-space: nowrap;
}
.btn-primary { background: #009afe; color: #fff; }
.btn-primary:hover { background: #fff; color: #009afe; }
.btn-secondary { background: #fff; color: #999; border-color: #ddd; }
.btn-secondary:hover { border-color: #009afe; color: #009afe; }

/* States */
.loading-container, .empty-container, .error-container {
  text-align: center; padding: 60px 20px;
}
.spinner {
  width: 40px; height: 40px; border: 4px solid #eee;
  border-top-color: #009afe; border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text, .empty-text {
  font-size: 15px; color: #999; font-family: "Open Sans", sans-serif;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.error-container { color: #dc2626; }
.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-text { font-size: 15px; }

/* Responsive */
@media (max-width: 768px) {
  .search-section { flex-direction: column; align-items: stretch; }
  .card__title { padding: 20px; }
  .card__title h3 { font-size: 16px; }
  .card__body { padding: 0 20px; }
  .card__footer { padding: 20px; flex-wrap: wrap; gap: 16px; }
  .card__footer::before { left: 20px; width: calc(100% - 40px); }
  .service-row { padding-left: 10px; }
  .subcategory-header { padding-left: 10px; }
}

@media (max-width: 600px) {
  main { padding: 16px 12px; }
}
