/* ===== Basic Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Arial, sans-serif;
  background: #F2F0EA;
  color: #2E2A24;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

html { scroll-behavior: smooth; } /* smooth scroll for nav links */

/* ===== Loader ===== */
#loader {
  position: fixed;
  inset: 0;
  background: #F2F0EA;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.4s ease;
}
#loader.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #e0dccf;
  border-top-color: #A5936F;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Header ===== */
header {
  background: #A5936F;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.logo { color: white; font-size: 1.4rem; }
.logo span { color: #2E2A24; }

.navbar { display: flex; gap: 1.2rem; }
.navbar a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.navbar a:hover { color: #2E2A24; }

.cart {
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}
#clearCartBtn {
  background: white;
  color: #A5936F;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
#clearCartBtn:hover { background: #f0f0f0; }

/* ===== Hero (gradient background) ===== */
.hero {
  background: linear-gradient(135deg, #A0D4E0, #F2F0EA);
  padding: 3rem 1rem;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}
.hero h2 { font-size: 1.7rem; margin-bottom: 0.5rem; }
.hero-text p { margin-bottom: 1rem; color: #4a453b; }
.hero-emoji { font-size: 5rem; }

.shop-now-btn {
  display: inline-block;
  background: #A5936F;
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.shop-now-btn:hover {
  background: #7d6f52;
  transform: scale(1.05);
}

/* ===== Search Bar ===== */
.search-wrap { margin: 1.5rem 0 0.5rem; }
#searchInput {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #A5936F;
  border-radius: 25px;
  font-size: 0.95rem;
}
#searchInput:focus { outline: none; border-color: #7d6f52; }

/* ===== Filter Buttons ===== */
.filters {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #A5936F;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.filter-btn.active,
.filter-btn:hover {
  background: #A5936F;
  color: white;
  transform: scale(1.05);
}

/* ===== Product Grid (Mobile first: 1 column) ===== */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-bottom: 2rem;
}

.product-card {
  position: relative;
  background: white;
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.product-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}
.product-emoji { font-size: 2.8rem; margin-bottom: 0.5rem; }
.rating { font-size: 0.85rem; color: #A5936F; margin-bottom: 0.3rem; }
.desc { font-size: 0.8rem; color: #6b6255; margin-bottom: 0.4rem; }
.price { color: #A5936F; font-weight: bold; margin: 0.4rem 0; }

/* Badges */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  color: white;
}
.badge-new { background: #3d8bfd; }
.badge-sale { background: #e63946; }
.badge-bestseller { background: #ffb703; color: #2E2A24; }

.add-btn {
  background: #A5936F;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease, transform 0.2s ease;
}
.add-btn:hover { background: #7d6f52; transform: scale(1.05); }
.add-btn.added { background: #2e7d32; }

#noResults {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b6255;
  padding: 2rem 0;
}

/* ===== Contact Info ===== */
.contact-info {
  background: #A0D4E0;
  padding: 2.5rem 1rem;
}
.contact-info h2 { text-align: center; margin-bottom: 1.5rem; }
.contact-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
.contact-form input,
.contact-form textarea {
  padding: 0.6rem 0.8rem;
  border: 1px solid #d8d3c6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}
.error-msg { color: #c0392b; font-size: 0.8rem; min-height: 1em; }
.form-success { color: #2e7d32; font-weight: bold; text-align: center; }

/* ===== Footer ===== */
footer { background: #2E2A24; color: white; padding: 2rem 1rem 1rem; }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 1rem;
}
.footer-inner h3, .footer-inner h4 { margin-bottom: 0.5rem; }
.footer-inner a {
  display: block;
  color: #cfc9ba;
  text-decoration: none;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}
.footer-inner a:hover { color: white; }
.copyright {
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid #4a453b;
  padding-top: 1rem;
}

/* ===== Tablet screens (768px and up) ===== */
@media (min-width: 768px) {
  .hero-inner { flex-direction: row; justify-content: space-between; text-align: left; }
  .products { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { flex-direction: row; justify-content: center; align-items: flex-start; }
  .contact-details { text-align: left; }
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ===== Desktop screens (1024px and up) ===== */
@media (min-width: 1024px) {
  .products { grid-template-columns: repeat(3, 1fr); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}
