@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: #fafafa;
  color: #333;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

a, button, input, select {
  transition: all 0.3s ease;
  font-family: inherit;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 70px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease;
}

.navbar:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.logo {
  font-size: 26px;
  font-weight: 700;
  color: #c76d5a;
  letter-spacing: 1px;
  position: relative;
}

.logo::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: #c76d5a;
  transition: width 0.3s ease;
}

.logo:hover::after {
  width: 100%;
}

.search-container {
  display: flex;
  align-items: center;
  width: 40%;
  max-width: 500px;
  position: relative;
}

#search-bar {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 25px;
  outline: none;
  background: #fff;
}

#search-bar:focus {
  border-color: #c76d5a;
  box-shadow: 0 0 6px rgba(199,109,90,0.3);
}

#search-btn {
  position: absolute;
  right: 14px;
  border: none;
  background: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
}

#search-btn:hover {
  color: #c76d5a;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-icons i {
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
  color: #444;
}

.nav-icons i:hover {
  color: #c76d5a;
  transform: scale(1.1);
}

.login-btn {
  padding: 8px 16px;
  background-color: #c76d5a;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s;
}

.login-btn:hover {
  background-color: #b65b48;
  transform: translateY(-2px);
}

/* ==========================
   HERO SECTION
========================== */
.hero {
  position: relative;
  text-align: center;
  color: white;
  overflow: hidden;
}

.hero img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  filter: brightness(55%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
}

.hero h1 {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
  animation: fadeUp 0.8s ease forwards;
}

.hero p {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: #eee;
  animation: fadeUp 1.1s ease forwards;
}

/* ==========================
   HERO BACKGROUND SLIDE
========================== */
.hero {
  position: relative;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: white;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(55%);
  transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
  opacity: 1;
  z-index: 0;
}

.hero.fade-out::before {
  opacity: 0;
  transform: scale(1.05) translateX(-15px);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero h1,
.hero p {
  position: relative;
  z-index: 3;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}

/* ==========================
   FILTER BAR
========================== */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 60px;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  margin: 25px auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.dropdown {
  position: relative;
  display: inline-block;
  margin-right: 15px;
}

.dropbtn {
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
}

.dropbtn:hover {
  background: #c76d5a;
  color: white;
  border-color: #c76d5a;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #fff;
  min-width: 160px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border-radius: 6px;
  z-index: 1;
  padding: 10px;
  animation: fadeIn 0.3s ease;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  text-decoration: none;
  color: #333;
  margin-bottom: 8px;
}

.dropdown-content a:hover {
  color: #c76d5a;
}

.color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 6px;
  border: 1px solid #ccc;
}

.blue { background: #1e90ff; }
.grey { background: #777; }
.red { background: #c0392b; }
.yellow { background: #f1c40f; }

.sort select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* ==========================
   PRODUCT GRID
========================== */
.product-card .product-info {
  padding: 15px; /* Adjust this value as needed */
  text-align: left; /* Ensure text aligns nicely if card is centered */
}

.products {
  display: flex;
  flex-wrap: wrap; /* Allows items to wrap to the next line */
  justify-content: center; /* Centers the cards (especially good for the last line) */
  gap: 20px; /* Adds space between your cards */
  padding: 20px 0; /* Give the section some breathing room */
}

.product-card {
  /* --- The Fix --- */
  flex-grow: 0;   /* <<< This is the key: Don't grow! */
  flex-shrink: 1; /* Allow it to shrink if the screen is too small */
  flex-basis: 280px; /* Set a consistent base width for all cards */
  
  /* --- Styling for the "Square" look --- */
  border-radius: 8px;
  overflow: hidden; /* This keeps the image corners rounded */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  background-color: #fff;
}

.product-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-card img {
  width: 100%; /* Make the image fill the card's width */
  display: block; /* Removes any bottom spacing */
  
  /* --- This makes it a perfect square --- */
  aspect-ratio: 1 / 1; 
  object-fit: cover; /* This crops the image to fit, rather than stretching it */
}

.product-card:hover img {
  transform: scale(1.05);
}

.product-name {
  margin-top: 12px;
  font-weight: 500;
  font-size: 15px;
}

.price {
  color: #c76d5a;
  font-weight: 600;
  margin-top: 5px;
  font-size: 16px;
}



/* ==========================
   PAGINATION
========================== */
.pagination {
  text-align: center;
  margin: 30px 0 60px;
}

.pagination a {
  text-decoration: none;
  color: #333;
  margin: 0 8px;
  border: 1px solid #ccc;
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.3s;
}

.pagination a.active,
.pagination a:hover {
  background: #c76d5a;
  color: #fff;
  border-color: #c76d5a;
}

/* ==========================
   MODAL ENHANCEMENTS
========================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 18px;
  width: 95%;
  max-width: 580px;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalPop 0.35s ease forwards;
  position: relative;
}

/* Smooth open animation */
@keyframes modalPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Close button redesign */
.close-btn {
  position: absolute;
  top: 12px;
  right: 15px;
  background: rgba(240, 240, 240, 0.9);
  border: none;
  border-radius: 50%;
  font-size: 22px;
  width: 32px;
  height: 32px;
  color: #555;
  cursor: pointer;
  transition: 0.3s ease;
}
.close-btn:hover {
  background: #c76d5a;
  color: #fff;
}

/* Main image */
.modal-img-container {
  width: 100%;
  text-align: center;
  border-radius: 14px;
  overflow: hidden;
}
.modal-img-container img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 14px;
}

/* Product info under image */
.modal-product-info {
  margin-top: 14px;
  padding: 0 20px;
}
.modal-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-name-row h2 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}
.favorite-icon {
  font-size: 22px;
  color: #bbb;
  cursor: pointer;
  transition: 0.3s;
}
.favorite-icon:hover,
.favorite-icon.active {
  color: #c76d5a;
}
#modal-price {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  color: #c76d5a;
}

/* Variant gallery */
.variant-gallery {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.variant-gallery img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.3s;
}
.variant-gallery img.active,
.variant-gallery img:hover {
  border-color: #c76d5a;
}

/* Description */
.modal-desc {
  color: #555;
  font-size: 15px;
  line-height: 1.5;
  padding: 0 20px 15px;
  text-align: justify;
}

/* Footer buttons */
.modal-footer {
  display: flex;
  justify-content: space-evenly;
  gap: 15px;
  padding: 14px 20px 18px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #eee;
}
.add-cart-btn,
.buy-btn {
  flex: 1;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.3s;
}
.add-cart-btn {
  background: #eee;
  color: #444;
}
.add-cart-btn:hover {
  background: #c76d5a;
  color: #fff;
}
.buy-btn {
  background: #c76d5a;
  color: #fff;
}
.buy-btn:hover {
  background: #b65846;
}


/* ==========================
   FOOTER
========================== */
footer {
  background-color: #111;
  color: #ddd;
  padding: 60px 70px 40px;
  border-top: 3px solid transparent;
  border-image: linear-gradient(to right, #c76d5a, #b65b48);
  border-image-slice: 1;
}

.newsletter {
  text-align: center;
  margin-bottom: 50px;
}

.newsletter p {
  font-size: 16px;
}

.newsletter span {
  color: #c76d5a;
  font-weight: 600;
}

.subscribe {
  margin-top: 20px;
}

.subscribe input {
  padding: 10px 15px;
  border: none;
  border-radius: 25px 0 0 25px;
  width: 250px;
}

.subscribe button {
  padding: 10px 20px;
  border: none;
  background-color: #c76d5a;
  color: white;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  transition: 0.3s;
}

.subscribe button:hover {
  background-color: #b65b48;
}

.footer-columns {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer-columns div {
  flex: 1 1 200px;
  margin: 10px;
}

.footer-columns div h4 {
  margin-bottom: 15px;
  color: #fff;
}

.footer-columns a {
  display: block;
  color: #bbb;
  text-decoration: none;
  margin-bottom: 8px;
  transition: 0.3s;
}

.footer-columns a:hover {
  color: #c76d5a;
  transform: translateX(4px);
  text-shadow: 0 0 8px rgba(199,109,90,0.3);
}

.footer-bottom {
  text-align: center;
  font-size: 14px;
  color: #888;
  border-top: 1px solid #222;
  padding-top: 15px;
}

/* Add these to your CSS file */
.dropdown-content.colors a {
  display: flex;
  align-items: center;
  gap: 8px; /* Adds space between the dot and the text */
}

.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #aaa;
}

/* New colors */
.color-dot.white { background-color: white; }
.color-dot.black { background-color: black; }
.color-dot.brown { background-color: #8B4513; }

/* ==========================
   ANIMATIONS
========================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
    padding: 15px 30px;
  }

  .filter-bar {
    flex-direction: column;
    gap: 10px;
  }

  .products {
    padding: 30px 20px;
    gap: 20px;
  }

  footer {
    padding: 40px 30px;
  }
}
