:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #626b74;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #dedbd2;
  --accent: #0f766e;
  --accent-dark: #0b4f4a;
  --warm: #c2410c;
  --shadow: 0 18px 50px rgba(31, 35, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Calibri, Cambria, 'Lucida Console';
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

button,
.checkout-button,
.hero-action {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  padding: 0.78rem 1rem;
}

button:hover,
.checkout-button:hover,
.hero-action:hover {
  background: var(--accent-dark);
}

.site-header {
  align-items: center;
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 800;
  gap: 0.65rem;
}

.brand img {
  display: block;
  height: 42px;
  object-fit: contain;
  width: 42px;
}

nav {
  align-items: center;
  display: flex;
  gap: 1rem;
}

nav > a {
  font-weight: 700;
}

.nav-logout {
  margin: 0;
}

.nav-logout button {
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
  padding: 0;
}

.nav-logout button:hover {
  background: transparent;
  color: var(--warm);
}

.cart-link {
  align-items: center;
  display: inline-flex;
  gap: 0.5rem;
}

.cart-link span {
  background: var(--warm);
  border-radius: 999px;
  color: #ffffff;
  display: inline-grid;
  font-size: 0.78rem;
  min-height: 1.35rem;
  min-width: 1.35rem;
  place-items: center;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(1rem, 4vw, 3rem);
}

.site-footer {
  background: #17201f;
  color: #ffffff;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
}

.site-footer section {
  display: grid;
  gap: 0.5rem;
}

.site-footer h2 {
  color: #ccfbf1;
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.site-footer a,
.site-footer p {
  color: #d9e3df;
  margin: 0;
}

.site-footer a:hover {
  color: #ffffff;
}

.store-hero {
  align-items: end;
  background:
    linear-gradient(90deg, rgba(9, 40, 38, 0.82), rgba(9, 40, 38, 0.25)),
    url("Hero.png") center/cover;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 390px;
  padding: clamp(1.2rem, 5vw, 4rem);
}

.store-hero h1,
.page-heading h1,
.detail-copy h1,
.checkout-form h1,
.empty-state h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1;
  margin: 0 0 1rem;
}

.store-hero p {
  max-width: 560px;
}

.eyebrow,
.product-info p {
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

.store-hero .eyebrow {
  color: #fed7aa;
}

.product-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 1.5rem;
}

.search-bar {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(200px, 0.8fr) minmax(250px, 1.2fr) minmax(170px, 0.7fr) auto;
  margin-top: 1.5rem;
  padding: 1rem;
}

.search-bar select {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 2.7rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.news-stack {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.news-banner {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.75rem 1rem;
}

.news-banner h2 {
  font-size: 1rem;
  margin: 0;
}

.news-banner p {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  line-height: 1.45;
  margin: 0.2rem 0 0;
  overflow: hidden;
}

.news-banner.expanded p {
  -webkit-line-clamp: unset;
  display: block;
}

.news-toggle {
  background: transparent;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
}

.news-toggle:hover {
  background: #ffedd5;
  color: #7c2d12;
}

.empty-results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
}

.empty-results h2,
.empty-results p {
  margin: 0.3rem 0;
}

.product-card,
.cart-line,
.order-line,
.summary,
.checkout-form,
.empty-state,
.account-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-card {
  overflow: hidden;
}

.product-card img {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.product-info {
  padding: 1rem;
}

.product-meta {
  align-items: start;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

.product-info h2,
.cart-line h2,
.summary h2 {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.product-info span,
.detail-copy strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Stile riutilizzabile per etichette discrete: piccola, in corsivo e grigia */
.product-info .muted-caption,
.detail-copy .muted-caption,
.page-heading .muted-caption {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  font-weight: 400;
  margin: 0 0 0.55rem;
  text-transform: none;
}

.price-box {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.price-box span,
.price-box strong {
  display: inline;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.price-box del {
  color: var(--muted);
  font-size: 0.95rem;
}

.price-box em {
  background: var(--warm);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  padding: 0.18rem 0.45rem;
}

.product-actions {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.product-actions a {
  color: var(--accent-dark);
  font-weight: 700;
}

.choose-variation {
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-dark);
  padding: 0.65rem 0.8rem;
}

.variation-badge {
  background: #ecfeff;
  border: 1px solid #67e8f9;
  border-radius: 999px;
  color: #155e75;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.45rem;
}

.stock-caption {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0 0 0.65rem;
}

.detail-layout,
.cart-layout,
.checkout-layout,
.account-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.auth-layout {
  display: grid;
  margin: 2rem auto;
  max-width: 520px;
}

.detail-layout {
  align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
}

.detail-layout img {
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 420px;
  object-fit: cover;
  width: 100%;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.buy-box,
.quantity-form,
.checkout-form {
  display: grid;
  gap: 0.8rem;
}

label {
  color: var(--muted);
  display: grid;
  gap: 0.4rem;
}

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 2.7rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.buy-box select {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 2.7rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.page-heading {
  margin-bottom: 1rem;
}

.page-heading p {
  color: var(--muted);
}

.cart-lines {
  display: grid;
  gap: 0.9rem;
}

.cart-line {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: 96px minmax(0, 1fr) 130px 100px;
  padding: 0.8rem;
}

.cart-line img {
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  width: 96px;
}

.cart-line p {
  color: var(--muted);
  margin: 0;
}

.order-line {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 120px;
  padding: 1rem;
}

.order-line h2 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.summary,
.checkout-form,
.empty-state,
.account-panel {
  padding: 1.2rem;
}

.account-panel {
  display: grid;
  gap: 0.8rem;
}

.account-panel h1,
.account-panel h2 {
  margin: 0;
}

.account-panel p {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.section-title a,
.orders-row a {
  color: var(--accent-dark);
  font-weight: 800;
}

.orders-table {
  display: grid;
  gap: 0.45rem;
}

.orders-head,
.orders-row {
  align-items: center;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 90px minmax(160px, 1fr) 110px 100px 90px;
}

.orders-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.orders-row {
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}

.summary {
  align-self: start;
  display: grid;
  gap: 0.8rem;
}

.summary p {
  display: flex;
  justify-content: space-between;
  margin: 0;
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 100%;
}

.ghost-button:hover {
  background: #f1eee7;
}

.form-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #991b1b;
  margin: 0;
  padding: 0.75rem;
}

.auth-switch {
  color: var(--muted);
  margin: 0.25rem 0 0;
  text-align: center;
}

.auth-switch a {
  color: var(--accent-dark);
  font-weight: 800;
}

.empty-state {
  margin: 3rem auto;
  max-width: 680px;
  text-align: center;
}

.empty-state a {
  color: var(--accent-dark);
  font-weight: 800;
}

@media (max-width: 820px) {
  .store-hero,
  .site-header,
  nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .store-hero {
    gap: 1.5rem;
    justify-content: end;
  }

  .detail-layout,
  .cart-layout,
  .checkout-layout,
  .account-layout,
  .search-bar {
    grid-template-columns: 1fr;
  }

  .news-banner {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .detail-layout img {
    min-height: 300px;
  }

  .cart-line {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .orders-head {
    display: none;
  }

  .orders-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .cart-line img {
    width: 78px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}
