:root {
  --bg-page: #f5f0e8;
  --bg-surface: #fcfaf6;
  --bg-card-border: rgba(34, 28, 22, 0.1);
  --text-main: #1f1b18;
  --text-muted: #665d54;
  --accent-dark: #181614;
  --accent-warm: #8c633f;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 14px rgba(24, 20, 16, 0.06);
  --shadow-lg: 0 14px 34px rgba(24, 20, 16, 0.16);
}

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

body {
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #baaa89;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #fdedd4 0%, #baaa89 100%);
  background-size: 180px 180px, cover;
  background-repeat: repeat, no-repeat;
  color: var(--text-main);
  line-height: 1.45;
  padding-bottom: 110px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Header */
.site-header {
  background: rgba(252, 250, 246, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-monogram {
  width: 60px;
  height: auto;
  border-radius: 5px;
  display: grid;
  background-color:#5F482F;
  place-items: center;
}

.brand-monogram img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-warm);
}

.brand h1 {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ede5d8;
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 999px;
}

.header-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #159a68;
}

/* Notice banner */
.notice-banner {
  margin-top: 20px;
  background: #E3ADEC;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.notice-pill {
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.notice-banner p {
  font-size: 0.9rem;
  color: #5F482F;
}

.notice-banner strong {
  color: var(--text-main);
}

/* Controls */
.controls {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  font-family: inherit;
  font-size: 0.96rem;
  padding: 13px 16px 13px 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(24, 22, 20, 0.08);
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.filter-btn:hover {
  border-color: var(--accent-dark);
}

.filter-btn.active {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
}

.results-meta {
  margin-top: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-warm);
  text-decoration: underline;
  cursor: pointer;
}

/* Swatch Grid */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
}

.swatch-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  min-height: 225px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.swatch-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(24, 20, 16, 0.12);
}

.swatch-card.selected {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

.swatch-card.unavailable {
  opacity: 0.62;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title-group .linea-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card-title-group .color-name {
  font-size: 1.32rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.check-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  opacity: 0.65;
  transition: all 0.15s ease;
}

.swatch-card.selected .check-circle {
  background: #181614;
  border-color: #181614;
  color: #ffffff;
  opacity: 1;
}

.card-middle {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tono-real-badge {
  background: #111111;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
}

.status-badge {
  background: rgba(255, 255, 255, 0.88);
  color: #181614;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  border-radius: 999px;
}

.card-bottom {
  margin-top: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.code-chip {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.yarn-illustration {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.yarn-illustration svg {
  width: 64px;
  height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.yarn-caption {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.72;
}

/* Footer */
.site-footer {
  margin-top: 38px;
  padding: 22px 0;
  border-top: 1px solid var(--bg-card-border);
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-brand {
  margin-top: 6px;
  font-weight: 700;
  color: var(--text-main);
}

/* Floating Selection Bar */
.selection-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--bg-card-border);
  box-shadow: var(--shadow-lg);
  padding: 12px 0;
  z-index: 40;
}

.selection-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.selection-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 600px;
}

.selection-summary strong {
  font-size: 0.9rem;
}

.selected-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #efe9df;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.mini-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.selection-actions {
  display: flex;
  gap: 10px;
}

.btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn-primary {
  background: #159a68;
  color: #ffffff;
}

.btn-secondary {
  background: #e8e0d4;
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

/* Toast */
.toast {
  position: fixed;
  top: 78px;
  right: 18px;
  background: var(--accent-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .swatch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .swatch-card {
    min-height: 195px;
    padding: 14px 14px 12px;
  }

  .card-title-group .color-name {
    font-size: 1.12rem;
  }

  .notice-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .selection-actions {
    width: 100%;
  }

  .selection-actions .btn {
    flex: 1;
  }
}
