@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 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-right {
  display: flex;
  gap: 10px;
}

.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 */


/* 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;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;

  max-height: 90vh;
  overflow-y: auto;

  padding: 20px;
}

.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%;
  }
}
.profile-menu {
  position: relative;
  display: inline-block;
}

.profile-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  color: white;
}

.dropdown {
  display: none;
  position: absolute;
  right: 0;
  background: white;
  min-width: 160px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px 0;
  z-index: 1000;
}

.dropdown a {
  display: block;
  padding: 10px 16px;
  color: #5a4631;
  text-decoration: none;
}

.dropdown a:hover {
  background: #f0e8d6;
}

.profile-menu.active .dropdown {
  display: block;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 768px) {

  .header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

}

@media (max-width: 768px) {

  .header {
    flex-direction: row;
    align-items: center;
  }

  .header-right {
    justify-content: center;
    width: 100%;
    margin-top: 10px;
  }

}

.logo {
  white-space: nowrap;
  font-size: 22px;
}
/* Mobile Header */

@media (max-width: 768px) {

  body {
    padding: 10px;
    padding-top: 60px;
  }

  .header {
    padding: 10px 15px;
  }

  .header a.logo {
    font-size: 1.3rem;
    padding: 0;
  }

  .header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .header a {
    font-size: 0.85rem;
    padding: 6px 8px;
    margin-left: 0;
  }

}

@media (max-width: 768px) {
  body {
    max-width: 100%;
  }
}

/* ===== MOBILE HEADER FIX ===== */

@media (max-width: 768px) {

  body {
    padding-top: 50px; /* reduce space for header */
  }

  .header {
    padding: 6px 10px;
  }

  .header a.logo {
    font-size: 1.2rem;
    padding: 0;
  }

  .header a {
    font-size: 0.75rem;
    padding: 4px 6px;
  }

  .header-right {
    gap: 4px;
  }

}

/* Hamburger */

.menu-toggle {
  display: none;
  font-size: 28px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Mobile header */

@media (max-width: 768px) {

  body {
    padding-top: 60px;
  }

  .header {
    padding: 10px 20px;
  }

  .logo {
    font-size: 20px;
  }

  .menu-toggle {
    display: block;
  }

  .header-right {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #a8997e;
    margin-top: 10px;
    border-radius: 8px;
  }

  .header-right a {
    padding: 12px;
    font-size: 16px;
    text-align: left;
  }

  .header-right.active {
    display: flex;
  }

}

@media (max-width: 768px) {

  .modal-content {
    width: 100%;
    max-width: none;
    border-radius: 12px;
    padding: 18px;
  }

  .modal-content img {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
  }
  .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
  
    font-size: 28px;
    width: 36px;
    height: 36px;
  
    border: none;
    background: transparent;
    cursor: pointer;
  }
}