
/* ── Card carousel ──────────────────────────────────── */

/* ── Country multi-select dropdown ──────────────────── */

/* ── Clear button ───────────────────────────────────── */

.clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d8dbe6;
  background: #ffffff;
  color: #6b7383;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.clear-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(200, 40, 40, 0.4);
  box-shadow: 0 8px 16px rgba(21, 32, 51, 0.12);
  color: #c82828;
}

.clear-btn:focus-visible {
  outline: 2px solid #6b7383;
  outline-offset: 2px;
}

.clear-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}


.country-multiselect-wrap {
  position: relative;
}

.country-multiselect-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.country-multiselect-btn:focus,
.country-multiselect-btn[aria-expanded="true"] {
  border-color: rgba(43, 92, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(43, 92, 255, 0.10);
}

.country-multiselect-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.country-multiselect-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.country-multiselect-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(21, 32, 51, 0.14);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px 0;
}

.country-multiselect-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.12s;
  user-select: none;
}

.country-multiselect-option:hover {
  background: #f4f6fb;
}

.country-multiselect-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2b5cff;
  cursor: pointer;
  flex-shrink: 0;
}

.country-multiselect-option--all {
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  padding-bottom: 11px;
  font-weight: 500;
}

/* ── Card carousel ──────────────────────────────────── */

.card-carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.card-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
  will-change: transform;
}

.card-carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.card-carousel-slide--symbol {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #f8fbff 0%, #e4eaf5 55%, #d5deec 100%);
}

.card-emoji {
  font-size: clamp(2.8rem, 6vw, 4rem);
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(21, 32, 51, 0.25));
}

.card-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-carousel-slide img.card-svg-icon {
  width: clamp(2.8rem, 6vw, 4rem);
  height: clamp(2.8rem, 6vw, 4rem);
  object-fit: contain;
}

.card-carousel--empty {
  display: grid;
  place-items: center;
  height: 100%;
}

.card-no-img {
  width: 52px;
  height: 52px;
  opacity: 0.55;
}

.card-carousel-prev,
.card-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #152033;
  transition: background 0.15s, box-shadow 0.15s;
  padding: 0;
}

.card-carousel-prev:hover,
.card-carousel-next:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(21, 32, 51, 0.18);
}

.card-carousel-prev { left: 7px; }
.card-carousel-next { right: 7px; }

.card-carousel-dots {
  position: absolute;
  bottom: 7px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.card-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  pointer-events: all;
  transition: background 0.15s, transform 0.15s;
}

.card-carousel-dot.active {
  background: #fff;
  transform: scale(1.35);
}

/* ── Card top / title / categories (kept here for specificity) */

.card-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}


.card-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.card h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.edit-entity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d8dbe6;
  background: #ffffff;
  color: #2b5cff;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.edit-entity-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(43, 92, 255, 0.5);
  box-shadow: 0 8px 16px rgba(21, 32, 51, 0.12);
}

.edit-entity-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.download-db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d8dbe6;
  background: #ffffff;
  color: #1b3ea8;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.download-db-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 62, 168, 0.45);
  box-shadow: 0 8px 16px rgba(21, 32, 51, 0.12);
}

.download-db-btn:focus-visible {
  outline: 2px solid #1b3ea8;
  outline-offset: 2px;
}

.download-db-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.restore-db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #cfe1d5;
  background: #f4fbf6;
  color: #1f7a38;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.restore-db-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 122, 56, 0.45);
  box-shadow: 0 8px 16px rgba(21, 32, 51, 0.12);
}

.restore-db-btn:focus-visible {
  outline: 2px solid #1f7a38;
  outline-offset: 2px;
}

.restore-db-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.restore-db-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.new-product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d2d7ef;
  background: #f6f8ff;
  color: #2b5cff;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.new-product-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(43, 92, 255, 0.45);
  box-shadow: 0 8px 16px rgba(21, 32, 51, 0.12);
}

.new-product-btn:focus-visible {
  outline: 2px solid #2b5cff;
  outline-offset: 2px;
}

.new-product-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.restore-status-panel.user-menu-panel {
  position: relative;
  display: block;
  min-width: 100%;
  margin: 0 0 16px;
  padding-top: 32px;
}

.restore-status-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted, #60708a);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.15s;
}

.restore-status-close:hover {
  background: rgba(21, 32, 51, 0.08);
}

.restore-status-close:focus-visible {
  outline: 2px solid var(--primary, #2b5cff);
  outline-offset: 2px;
}

.restore-status-panel[hidden] {
  display: none;
}

.restore-status-panel.status-success {
  border-color: rgba(31, 122, 56, 0.26);
  background: #f4fbf6;
}

.restore-status-panel.status-error {
  border-color: rgba(229, 72, 77, 0.3);
  background: #fff6f6;
}

.restore-status-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.restore-status-message {
  margin: 8px 0 0;
  color: #4b596f;
  line-height: 1.45;
}

.restore-status-list {
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  color: #2f3a50;
  line-height: 1.4;
}

.restore-status-list:empty {
  display: none;
}

.restore-status-reload {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid rgba(43, 92, 255, 0.25);
  background: rgba(43, 92, 255, 0.07);
  color: #1b3ea8;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.restore-status-reload:hover {
  background: rgba(43, 92, 255, 0.13);
  border-color: rgba(43, 92, 255, 0.4);
}

.restore-status-reload svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.card-categories {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
  min-width: 0;
  text-align: left;
}

.name-item-content {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.geo-country {
  color: #2f3a50;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.geo-country-flag {
  margin-right: 6px;
  font-size: 1rem;
  line-height: 1;
}

.geo-state-badge {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid rgba(43, 92, 255, 0.35);
  border-radius: 0;
  background: rgba(43, 92, 255, 0.10);
  color: #3650a0;
  font-size: 0.72rem;
  line-height: 1.2;
}

@media (max-width: 1040px) {
  .hero-card,
  .product-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .search-toolbar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .search-toolbar .field:first-child {
    grid-column: 1 / -1;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {

  .topbar-inner,
  .section-header,
  .results-meta {
    align-items: start;
  }

  .hero-card {
    padding: 26px;
  }

  .stats,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.35rem;
  }
}

/* ── Collapsed / expanded card ──────────────────────── */

.card.card--collapsed .card-expanded { display: none; }
.card:not(.card--collapsed) .card-collapsed { display: none; }

.card-collapsed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
}

.card-collapsed-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-mini-emoji {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-mini-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-mini-icon--empty {
  display: inline-grid;
  place-items: center;
}

.card-mini-icon--empty svg {
  width: 28px;
  height: 28px;
}

.card-collapsed-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-collapsed-actions,
.card-expanded-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-collapsed-names {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  height: calc(0.9rem * 1.45 * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.toggle-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d8dbe6;
  background: #ffffff;
  color: #2b5cff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.toggle-collapse-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(43, 92, 255, 0.5);
  box-shadow: 0 8px 16px rgba(21, 32, 51, 0.12);
}

.toggle-collapse-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.toggle-collapse-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}