/* Fees page — table + drawer. Inherits typography/colors from styles.css. */

/* Compact hero so the browse table sits above the fold on a 1080p screen. */
.section--hero.fees-hero {
  padding: 2.5rem 1.5rem 1rem;
}
.fees-hero h1 {
  font-size: clamp(1.8rem, 1.8vw + 0.9rem, 2.5rem);
  line-height: 1.12;
  margin-bottom: 0.75rem;
}
.fees-hero .lede {
  font-size: 0.98rem;
  margin-bottom: 1.25rem;
}
.fees-hero .numbers {
  margin-top: 1rem;
}
.fees-hero .numbers .n {
  padding: 0.65rem 1rem;
  gap: 0.15rem;
}
.fees-hero .numbers .n strong {
  font-size: 1.25rem;
}
.fees-hero .numbers .n span {
  font-size: 0.78rem;
  line-height: 1.3;
}
/* Collapse the gap between hero and the browse section. */
.fees-hero + .section {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.fees-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.fees-toolbar__filters {
  display: flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.25rem;
  border-radius: 8px;
}

.fees-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  color: inherit;
  font-weight: 500;
}

.fees-tab.is-active {
  background: var(--color-primary, #2a5fdf);
  color: white;
}

.fees-search {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  font-size: 0.95rem;
}

/* ── Browse table ───────────────────────────────────────────── */

.fees-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: white;
}

.fees-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.fees-table thead th {
  text-align: left;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}

.fees-table tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: top;
}

.fees-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Source column — keep "Office page ↗" on one line. */
.fees-table thead th:last-child,
.fees-table tbody td:last-child {
  white-space: nowrap;
}

/* Jurisdiction column: flag + code on one line. */
.fees-juris-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.fees-flag {
  width: 1.6em;
  height: 1.2em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.fees-globe {
  font-size: 1.2em;
  line-height: 1;
}
.fees-juris-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(42, 95, 223, 0.4);
}
.fees-juris-link:hover {
  color: var(--color-primary, #2a5fdf);
  border-bottom-color: var(--color-primary, #2a5fdf);
}

.fees-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.fees-row:hover,
.fees-row:focus {
  background: rgba(42, 95, 223, 0.04);
  outline: none;
}

.fees-row:focus {
  box-shadow: inset 0 0 0 2px var(--color-primary, #2a5fdf);
}

.fees-row--unavailable {
  cursor: default;
  opacity: 0.6;
}

.fees-row--unavailable:hover {
  background: transparent;
}

.fees-loading,
.fees-empty {
  text-align: center;
  color: rgba(0, 0, 0, 0.55);
  font-style: italic;
  padding: 2rem !important;
}

.muted {
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.9em;
}

.error {
  color: #c0392b;
}

/* Right-type chips */
.chip {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip--patent     { background: #e0eafc; color: #1c4ab0; }
.chip--trademark  { background: #fdebd0; color: #a35100; }
.chip--design     { background: #e6f4ea; color: #1b6e3d; }

/* ── Drawer ────────────────────────────────────────────────── */

.fees-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: flex-end;
  z-index: 200;  /* above site-header (z-index 100) */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.fees-drawer[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}

.fees-drawer__inner {
  background: white;
  width: min(720px, 100%);
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.18s ease;
  display: flex;
  flex-direction: column;
}

.fees-drawer[aria-hidden="false"] .fees-drawer__inner {
  transform: translateX(0);
}

.fees-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.fees-drawer__header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.fees-drawer__close {
  appearance: none;
  background: transparent;
  border: 0;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.45);
  padding: 0 0.5rem;
}

.fees-drawer__close:hover {
  color: rgba(0, 0, 0, 0.9);
}

.fees-drawer__meta {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.015);
}

.fees-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1rem;
  row-gap: 0.3rem;
  margin: 0;
  font-size: 0.92rem;
}

.fees-meta dt {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.6);
}

.fees-meta dd {
  margin: 0;
  word-break: break-word;
}

.fees-notes {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.7);
}

.fees-drawer__body {
  padding: 1rem 1.5rem 2rem;
  flex: 1;
}

.fees-group {
  margin-bottom: 2rem;
}

.fees-group h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-primary, #2a5fdf);
}

.fees-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fees-detail-table thead th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.fees-detail-table tbody td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: top;
}

.fees-detail-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* Prevent body scroll while drawer is open */
body.drawer-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .fees-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .fees-table thead th:nth-child(2),
  .fees-table tbody td:nth-child(2) {
    display: none;
  }
}
