:root {
  --primary-color: #fbc531;
  --secondary-color: #2f3640;
  --background-color: #ffffff;
  --text-color: #2f3640;
  --accent-color: #e1b12c;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
     display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(90deg, var(--secondary-color), #353b48);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

header a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

header img.logo {
  height: 36px;
  max-width: 150px;
  width: auto;
  border-radius: 6px;
}

.logo-center {
  text-align: center;
  margin: 1rem auto;
}

.logo-center img {
  max-width: 150px;
  width: 100%;
  height: auto;
  border-radius: 8px;
}


header .site-name {
  font-size: 1.4rem;
  font-weight: bold;
}

header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header .logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

header .logo img {
  height: 40px;
  width: auto;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

header .logo img:hover {
  transform: scale(1.05);
}

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

header nav a {
  color: #fff;
  background-color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

header nav a:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}


main {
  padding: 1.5rem;
  max-width: 800px;
  margin: 1rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
      flex: 1 0 auto;
}

.product-image {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto 1rem auto;
  border-radius: 8px;
  transition: transform 0.3s ease;
}
.product-image:hover {
  transform: scale(1.05);
}

.product {
  border: 1px solid #dcdde1;
  background: #fff;
  /*border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05); */
  padding: 1rem;
  margin: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease;
}
.product:hover {
  transform: translateY(-2px);
}
.product img.product-image {
  width: 100px;
  height: auto;
  border-radius: 8px;
}

h1, h2, h3 {
  color: var(--secondary-color);
  margin-top: 0.5rem;
}

p {
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.availability-warning {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.buy-button {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary-color);
  color: var(--secondary-color);
  padding: 1rem;
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 12px;
  margin-top: 1rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.buy-button:hover,
.buy-button:focus {
  background: #ffeaa7;
  transform: translateY(-2px);
  outline: none;
}

.last-updated {
  font-size: 0.85rem;
  color: #718093;
  text-align: right;
  margin-top: 2rem;
}

.query-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #e9f7ef;
  border-left: 4px solid var(--primary-color);
  font-size: 0.95rem;
  border-radius: 8px;
}

footer {
  background-color: #dcdde1;
  color: #636e72;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
  margin-top: 3rem;
    flex-shrink: 0;
}

footer p {
  margin-bottom: 0.5rem;
}

.hidden {
  display: none;
}

html, body {
  height: 100%;
  margin: 0;
}

/* Aggiungi queste regole al tuo CSS */

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

.card {
  background: #fff;
  border: 1px solid #dcdde1;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease;
  padding: 0.5rem;
}

.card:hover {
  transform: translateY(-2px);
}

.card img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

.card img:hover {
  transform: scale(1.05);
}

.card-title {
  display: block;
  font-size: 1rem;
  color: var(--secondary-color);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  word-wrap: break-word;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 colonne uguali */
  gap: 1rem;
  margin-top: 1rem;
}

/* Responsive: per schermi più piccoli, meno colonne */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr); /* 2 colonne */
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr; /* 1 colonna su mobile */
  }
}

.card {
  background: #fff;
  border: 1px solid #dcdde1;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease;
  padding: 0.5rem;
}

.card:hover {
  transform: translateY(-2px);
}

.card img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

.card img:hover {
  transform: scale(1.05);
}

.card-title {
  display: block;
  font-size: 1rem;
  color: var(--secondary-color);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  word-wrap: break-word;
}
