/* ========== GLOBAL STYLING ========== */
* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background-color: #f4f6f8;
  color: #333;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
 background-image: url("background.jpg");
background-size: cover;}

/* ========== HEADER ========== */
header {
  background-color: #2c3e50;
  color: #fff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  flex-wrap: wrap;
}

h1 {
  font-family: cursive;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

h2 {
  text-align: center;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-weight: 700;
  color: #ffffff;
  margin: 40px 0 25px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

h3 {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}

button {
  background: #d0233ddb;
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  background: #e4ef13f1;
  transform: scale(1.05);
  color: #121212;
}

/* ========== MAIN CONTENT ========== */
main {
  padding: 20px;
  text-align: center;
}

/* PRODUCTS GRID */
#productContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 10px;
  justify-items: center;
}

/* PRODUCT CARD */
.product-card {
  background: #d9e58aa5;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  text-align: center;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-card img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  margin-bottom: 8px;
}

.product-card h4 {
  font-size: 25px;
  font-family: cursive;
  margin: 10px 0;
}

.product-card p {
  font-weight: bold;
  color: #077936;
  font-size: xx-large;
  margin-bottom: 10px;
}

.product-card button {
  background: #2980b9;
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.product-card button:hover {
  background: #3498db;
}

/* ========== CART MODAL ========== */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.cart-content {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}

#cartItems {
  list-style: none;
  margin: 50px 20px;
  text-align: left;
}

#cartItems li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

#checkoutBtn,
#closeCart {
  background: #27ae60;
  color: white;
  border: none;
  margin: 10px 5px;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#checkoutBtn:hover,
#closeCart:hover {
  background: #2ecc71;
}

/* ========== FOOTER ========== */
footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 15px 10px;
    margin-bottom: 3px;
  font-size: 0.9rem;
  display: block;
}

footer a {
  color: #1abc9c;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

footer p {
  margin-top: 3px;
  color: #bbb;
}

/* ========== DARK MODE ========== */
body.dark-mode {
  background-color: #121212;
  color: #f0f0f0;
}

body.dark-mode header {
  background-color: #1e1e1e;
}

body.dark-mode .product-card {
  background-color: #2a2a2a;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #f0f0f0;
}

body.dark-mode button {
  background-color: #444;
  color: #fff;
  border: 1px solid #777;
}

#darkModeToggle {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#darkModeToggle:hover {
  background-color: #555;
}

/* CART DARK MODE FIX */
body.dark-mode .cart-content {
  background-color: #1f1f1f;
  color: #f0f0f0;
  border: 1px solid #333;
  box-shadow: 0 2px 15px rgba(255, 255, 255, 0.1);
}

body.dark-mode .cart-content button {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
}

body.dark-mode .cart-content button:hover {
  background-color: #555;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  header h3 {
    font-size: 1rem;
  }

  header button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  #productContainer {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    justify-items: center;
  }

  .product-card {
    width: 90%;
    max-width: 300px;
  }

  .product-card img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  #productContainer {
    grid-template-columns: 1fr;
    gap: 15px;
    justify-items: center;
  }

  .product-card {
    width: 90%;
    margin: auto;
  }

  button {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}
