:root {
  color-scheme: light;
  --paper: #f7f2ea;
  --ink: #1f2520;
  --muted: #687065;
  --line: #ded4c7;
  --red: #7d1f2a;
  --rose: #c8646a;
  --gold: #b5802c;
  --green: #2f6f5e;
  --blue: #355f7c;
  --white: #fffaf2;
  --shadow: 0 14px 34px rgba(30, 24, 16, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 16px 14px 36px;
}

.home-shell {
  display: grid;
  align-content: center;
  min-height: 100dvh;
}

.home-header {
  padding: 0 2px 26px;
}

.home-header h1 {
  max-width: 8ch;
}

.home-grid {
  display: grid;
  gap: 12px;
}

.home-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.home-card span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 10vw, 3.2rem);
  line-height: 0.95;
}

.home-card strong {
  color: var(--red);
  font-size: 1.7rem;
}

.home-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.9rem;
}

.home-card.muted {
  background: #f0e8dc;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 14px;
}

.topbar > div:nth-child(2) {
  flex: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.lang {
  min-width: 34px;
  height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  cursor: pointer;
}

.lang:last-child {
  border-right: 0;
}

.lang.active {
  background: var(--green);
  color: white;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 11vw, 3.45rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--red);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.icon-button span {
  font-size: 1.45rem;
  line-height: 1;
}

.search-band {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 0;
  background: rgba(247, 242, 234, 0.96);
  backdrop-filter: blur(12px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-box span {
  color: var(--gold);
  font-size: 1.35rem;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.stats {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.stats strong {
  color: var(--red);
  font-size: 1.15rem;
}

.quick-filters,
.experience-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.quick-filters::-webkit-scrollbar,
.experience-filters::-webkit-scrollbar {
  display: none;
}

.experience-filters {
  padding-bottom: 16px;
}

.pill,
.experience-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.experience-pill {
  background: #eef2ea;
  color: #294438;
}

.pill.active,
.experience-pill.active {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 16px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

select {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 9px;
}

.content {
  padding-top: 4px;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 10px;
}

.toolbar label {
  width: min(100%, 180px);
}

.wine-list {
  display: grid;
  gap: 10px;
}

.wine-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.wine-card:has(.wine-main:focus-visible) {
  outline: 3px solid rgba(181, 128, 44, 0.45);
}

.wine-main {
  display: grid;
  grid-template-columns: 54px 8px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 13px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.image-wrap {
  display: grid;
  width: 54px;
  height: 68px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #efe6d9;
}

.bottle-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.category-dot {
  width: 8px;
  height: 50px;
  border-radius: 8px;
  background: var(--green);
}

.wine-card[data-category="Spumanti"] .category-dot {
  background: var(--gold);
}

.wine-card[data-category="Bianchi"] .category-dot {
  background: #d8a946;
}

.wine-card[data-category="Rosati"] .category-dot {
  background: var(--rose);
}

.wine-card[data-category="Rossi"] .category-dot {
  background: var(--red);
}

.wine-card[data-category="Birre"] .category-dot {
  background: var(--green);
}

.wine-title {
  min-width: 0;
}

.wine-title strong,
.wine-title small {
  display: block;
  overflow-wrap: anywhere;
}

.wine-title strong {
  font-size: 1rem;
  line-height: 1.18;
}

.wine-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.price {
  color: var(--red);
  font-weight: 850;
  white-space: nowrap;
}

dl {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 0.86rem;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.profile h2 {
  margin: 0;
  color: var(--blue);
  font-size: 0.92rem;
}

.profile h3,
.profile p {
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2ea;
  color: #2d4638;
  font-size: 0.77rem;
}

.empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.wine-modal {
  width: min(100%, 760px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.wine-modal::backdrop {
  background: rgba(31, 37, 32, 0.42);
}

.modal-card {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px;
  background: rgba(247, 242, 234, 0.92);
  backdrop-filter: blur(12px);
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 0 14px 28px;
}

.modal-hero {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}

.modal-image-wrap {
  display: grid;
  width: 136px;
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #efe6d9;
}

.modal-bottle {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-title {
  min-width: 0;
}

.modal-title p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.modal-title h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 8vw, 3rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.modal-title strong {
  color: var(--red);
  font-size: 1.2rem;
}

.modal-section {
  padding: 2px 0;
}

.modal-dl {
  grid-template-columns: 116px minmax(0, 1fr);
  font-size: 0.92rem;
}

.modal-section.profile {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.modal-section.profile h3 {
  color: var(--blue);
  font-size: 1rem;
}

@media (min-width: 680px) {
  .shell {
    padding-top: 24px;
  }

  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wine-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wine-modal {
    padding: 24px 0;
  }

  .modal-card {
    min-height: auto;
    border-radius: 8px;
    overflow: hidden;
  }
}
