@import url('https://fonts.googleapis.com/css2?family=Quicksand&display=swap');

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: #f7f3f0;
  color: #5a4631;
  padding: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-top: 70px; /* space for fixed header */
}

/* Header */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  background-color: #a8997e;
  padding: 15px 30px;
  box-shadow: 0 2px 5px rgba(122, 94, 58, 0.6);
  font-family: 'Quicksand', sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10000;
  box-sizing: border-box;
}

.header > * {
  max-width: 900px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
}

.header a {
  color: white;
  text-align: center;
  padding: 10px 16px;
  text-decoration: none;
  font-size: 1.1rem;
  border-radius: 6px;
  font-weight: 700;
  transition: background-color 0.3s ease;
  margin-left: 1rem;
}

.header a.logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 10px 20px 10px 0;
  cursor: pointer;
  margin-left: 0;
}

.header a:hover {
  background-color: #7a674a;
  color: white;
}

.header a.active {
  background-color: #7a674a;
  pointer-events: none;
  cursor: default;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Responsive header for mobile */
@media screen and (max-width: 600px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
  }
  .header > * {
    flex-direction: column;
    align-items: flex-start;
  }
  .header a, .header-right {
    float: none;
    display: block;
    text-align: left;
    margin-left: 0;
    padding: 8px 0;
    font-size: 1rem;
  }
  .header-right {
    width: 100%;
    margin-top: 10px;
    gap: 10px;
  }
  .header a.logo {
    font-size: 1.5rem;
    padding-bottom: 5px;
  }
}

/* Products Section */

section.products {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  justify-items: center;
}

section.products figure {
  width: 100%;
  max-width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

section.products img {
  max-width: 100%;
  border-radius: 8px;
  object-fit: cover;
  height: 200px; /* fixed height for uniformity */
}

section.products figcaption {
  margin-top: 12px;
  font-weight: 600;
  color: #7a5e3a;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 5px rgba(122, 94, 58, 0.15);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

section.products figure:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Responsive tweaks for products */
@media (max-width: 700px) {
  section.products {
    grid-template-columns: 1fr; /* one column on small screens */
    margin-top: 20px;
  }
  section.products figure {
    max-width: 90vw;
    margin-bottom: 20px;
  }
  section.products img {
    height: auto;
  }
}

/* Buttons */

.btn-catalog {
  display: block;
  margin: 40px auto 0 auto;
  padding: 15px 40px;
  background-color: #a8997e;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 40px;
  width: fit-content;
  box-shadow: 0 4px 10px rgba(168,153,126,0.7);
  transition: background-color 0.3s ease;
}

.btn-catalog:hover,
.btn-catalog:focus {
  background-color: #7a674a;
  outline: none;
}

/* Footer */

footer {
  text-align: center;
  margin-top: 50px;
  font-size: 0.9rem;
  color: #a8997e;
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0; top: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.modal-content img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* Add to Cart Button */

#addToCartBtn {
  background-color: #a8997e;
  color: white;
  font-weight: 700;
  padding: 10px 30px;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  margin-top: 15px;
  font-size: 1rem;
  width: 100%;
  max-width: 260px;
}

#addToCartBtn:hover {
  background-color: #7a674a;
}

/* Quantity Buttons inside cart */

.qty-btn {
  padding: 6px 14px;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 6px;
  border: 1.5px solid #a8997e;
  background-color: white;
  cursor: pointer;
  user-select: none;
}

.qty-btn:hover,
.qty-btn:focus {
  background-color: #7a674a;
  color: white;
  border-color: #7a674a;
  outline: none;
}

/* Responsive header-right on small screens */

@media screen and (max-width: 600px) {
  .header-right {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
}
