/* ───────── CSS Variables ───────── */
:root {
  --card-w: 130px;
  --gap: 11px;
  /* Badge positioning variables */
  --badge-margin-top: 10px;
  --badge-margin-side: 7px;
  --badge-height: 20px;
  --badge-spacing: 3px;
}

/* ───────── Base Styles ───────── */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Open Sans', system-ui, sans-serif;
  background: #f1f5f9;
  color: #111827;
}

button,
input,
select,
textarea {
  font-family: 'Open Sans', system-ui, sans-serif !important;
}

/* ───────── Typography ───────── */
h1 {
  text-align: center;
  margin: 24px 0 8px;
  font-size: 1.6rem;
}

h2 {
  display: block;
  margin: 16px 0 6px;
  padding: 0 var(--gap);
  font-size: 1.1rem;
  font-weight: 600;
}

/* ───────── Layout Sections ───────── */
.header-section {
  position: relative;
}

.main-content {
  /* Controlled by JavaScript */
}

.category-section {
  margin-bottom: 20px;
}

/* ───────── Loading Spinner ───────── */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #6b7280;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* ───────── Error Messages ───────── */
#error {
  text-align: center;
  color: #dc2626;
  margin-top: 40px;
}

/* ───────── Utility Icons ───────── */
.ton-icon-white {
  width: 0.5rem;
  height: 0.5rem;
  vertical-align: 0.0em;
  padding-left: 2px;
  padding-right: 1px;
}

.ton-icon-blue {
  width: 0.6rem;
  height: 0.6rem;
  vertical-align: -0.05em;
}

/* ───────── Mobile Responsive Breakpoints ───────── */
@media (max-width: 700px) {
  :root {
    --card-w: 120px;
    --gap: 8px;
    --badge-margin-top: 7px;
    --badge-margin-side: 5px;
  }

  .category-section > h2 {
     margin: 12px 0 6px;
}

}