/* === Base === */
:root {
  --color-bg: #fafafa;
  --color-text: #222;
  --color-accent: #00664d;
  --color-accent-hover: #004d3a;
  --max-width: 975px;
  --radius: 8px;
  --space: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  /* font-family: monospace, sans-serif; */
  line-height: 1.6;
  background: var(--color-bg);
  color: var(--color-text);
}

/* === Layout === */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: var(--space);
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
}

nav ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

nav a {
  text-decoration: none;
  color: var(--color-accent);
  font-weight: 500;
}

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

footer {
  padding: var(--space);
  background: #fff;
  border-top: 1px solid #ddd;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

#logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.cart-link {
  font-size: 1.4rem;
}
.cart-link:hover {
  text-decoration: underline;
}

.footer-contact-link {
  color: var(--color-text);
}
.footer-contact-link img {
  vertical-align: middle;
}

#hero {
  font-family: monospace;
  font-size: 1rem;
}

/* === Product layout === */
.product {
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

/* Image gallery */
.product-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.product-images img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  border: 1px solid #ddd;
}

.thumbnail-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.thumbnail-row img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  cursor: pointer;
  opacity: 0.8;
  transition:
    opacity 0.2s,
    border-color 0.2s;
}

.thumbnail-row img:hover {
  opacity: 1;
  border-color: var(--color-accent);
}

/* Product info */
.product-info h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
  color: var(--color-accent);
}

.product-info p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.price {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-accent);
}

/* === Components === */
button {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
}

button:hover {
  background: var(--color-accent-hover);
}

/* === Category === */

.product-category {
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  justify-items: center;
}

@media (min-width: 650px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 975px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  overflow: hidden;
  width: 300px;
}

.product-card .price {
  font-weight: normal;
  color: black;
  font-size: 1rem;
}

.product-card:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

.product-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover img {
  transform: scale(1.03);
}

.product-card a {
  color: var(--color-accent);
  font-weight: bold;
  text-decoration: none;
}

/* === Typography === */
h2 {
  font-size: 1.25rem;
  margin: 0.5rem 0;
  color: var(--color-accent);
}

.price {
  font-weight: bold;
  color: var(--color-accent);
  font-size: 1.1rem;
}

/* === Cart === */
.cart-product-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-product-details {
  /* text-transform: lowercase; */
  font-size: 0.7rem;
  flex-grow: 1;
  min-width: 0;
  word-break: break-word;
}

.cart-product-name {
  text-decoration: underline;
}
.cart-product-weight-price {
  font-weight: bold;
}

.cart-product-quantity {
  height: 50px;
}

.cart-product-remove {
  background: none;
  padding: 0 3px;
  font-size: 0.7rem;
  position: absolute;
  top: 0;
  left: 50px;
  transform: translate(-50%, -20%);
  color: red;
  border: 0.01rem solid red;
  border-radius: calc(infinity * 1px);
}

#order-result {
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1.4rem;
}
#order-result-id {
  cursor: pointer;
}

/* === Notification === */
#notification {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #e9f9f0; /* light green background */
  color: #1a7f49; /* dark green text */
  border: 1px solid #b8e4c2;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition:
    opacity 0.3s,
    transform 0.3s;
  z-index: 1000;
}

#notification.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* === Utility === */
.w-fit {
  width: max-content;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.self-center {
  align-self: center;
}

.gap-1 {
  gap: 1px;
}

.gap-2 {
  gap: 2px;
}

.gap-3 {
  gap: 3px;
}

.gap-10 {
  gap: 10px;
}

.no-underline {
  text-decoration-line: none;
}

.text-accent {
  color: var(--color-accent);
}

.relative {
  position: relative;
}

.required::after {
  content: " *";
  color: red;
}

/* === Responsive tweaks === */
@media (min-width: 650px) {
  nav ul {
    gap: 1rem;
  }

  .product {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }

  .product-images {
    flex: 1;
  }

  .product-info {
    flex: 1;
  }
}
