:root {
  --primary: #154212;
  --primary-light: #2d5a27;
  --secondary: #2c6956;
  --secondary-soft: #aeedd5;
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --error: #ba1a1a;
  --error-bg: #ffdad6;
  --shadow: 0 10px 6px rgba(0, 0, 0, 0.05);
  --text: #ffffff;
  --text-secondary: #42493e;
  --text-muted: #72796e;
  --transistion: all 0.25s ease;
  --btn-transition: all 0.2s ease-in-out;
  --btn-hover: translateY(-4px);
  --btn-active: scale(0.95);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  scroll-behavior: smooth;
  transition: var(--transistion);
}
.main-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, auto);
  grid-template-areas:
    "header header header header"
    "main main main main"
    "footer footer footer footer";
  justify-content: center;
  align-items: center;
  gap: 50px;
}
header {
  grid-area: header;
  display: grid;
  gap: 30px;
}
.head {
  display: flex;
  flex: 1 1 0;
  justify-content: space-between;
  align-items: center;
  background: var(--success-bg);
  padding: 10px 20px;
  color: var(--primary);
  box-shadow: var(--shadow);
}
.cart-logout {
  display: flex;
  padding: 10px;
  gap: 20px;
  justify-content: center;
  align-items: center;
}
.cart-btn {
  font-size: 24px;
  cursor: pointer;
}
.pts {
  background: var(--success-bg);
  font-weight: 500;
  padding: 10px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: var(--primary);
  text-align: center;
}
.head > button,
.cart-logout > button,
#checkoutBtn {
  padding: 10px 20px;
  cursor: pointer;
  outline: none;
  border: 2px solid var(--primary);
  border-radius: 5px;
  background: var(--success);
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}
.head > button:hover,
.cart-logout > button:hover,
#checkoutBtn:hover {
  background: none;
  border: 2px solid var(--primary-light);
}
#checkoutBtn:hover {
  color: var(--primary);
}
.hero {
  width: 40%;
  justify-self: center;
  text-align: center;
  padding: 20px;
  background: linear-gradient(45deg, #154212, #2e7d32);
  color: var(--text);
  box-shadow: var(--shadow);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
}
.hero > p {
  width: 70%;
}
main {
  grid-area: main;
  display: grid;
  margin-bottom: 20px;
}
.products {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 20px;
  gap: 20px;
  background: var(--success-bg);
  cursor: pointer;
}
.products > h1 {
  color: var(--primary);
}
.product-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.products-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 10px;
  box-shadow: 0 10px 6px rgba(0, 0, 0, 0.3);
  margin: 10px;
  text-align: center;
  border-radius: 20px;
  border: 2px solid var(--primary);
}
.products-card:hover {
  transform: translateY(-10px);
  background: var(--secondary-soft);
}
.products-card > button {
  padding: 10px 20px;
  cursor: pointer;
  outline: none;
  border: none;
  border-radius: 5px;
  background: var(--success);
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}
.products-card > button:hover {
  background: var(--success-bg);
  border: 2px solid var(--primary-light);
  color: var(--primary);
  transition: var(--btn-transition);
}
.products-card > img {
  width: 100%;
  border-radius: 20px;
  background: var(--text);
  height: 200px;
}
.products-card > span {
  display: flex;
  justify-content: center;
  align-self: center;
}
.products-card > span > button {
  padding: 10px;
  cursor: pointer;
}
.products-card > span {
  display: flex;
  align-self: center;
  gap: 10px;
}
footer {
  grid-area: footer;
  text-align: center;
  background-color: var(--success-bg);
  color: var(--primary);
  padding: 20px;
  font-weight: 600;
}
.box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  padding: 20px;
  box-shadow: var(--shadow);
  width: 50%;
  background: var(--primary-light);
  color: var(--text);
  border-radius: 20px;
}
.box > form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 10px;
}
.box > form > input {
  width: 80%;
  padding: 20px 30px;
  outline: none;
  border: none;
  border-radius: 20px;
}
.box > form > button {
  width: 80%;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  outline: none;
  border: none;
  background: var(--success);
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}
.box > form > button:hover {
  background: var(--success-bg);
  border: 2px solid var(--primary-light);
  color: var(--primary);
  transition: var(--btn-transition);
}
.prod-count {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.prod-count > button {
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  border: none;
  border-radius: 5px;
  background: var(--success);
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}
.cart-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "head-span head-span head-span head-span"
    "auto auto auto auto";
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 20px;
  background: var(--success-bg);
  color: var(--primary);
}
.head-span {
  grid-area: head-span;
}
.cart-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex: 1 1 0;
}
.cart-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--text);
  color: var(--primary);
  border-radius: 20px;
  box-shadow: var(--shadow);
  flex: 1 1 0;
}
.cart-item > img {
  width: 100px;
  height: 100px;
  border-radius: 20px;
}
.pts-name {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
}
.total {
  display: flex;
  flex: 1 1 0;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 600;
}
.products-card > img,
.cart-item > img {
  object-fit: cover;
}
.checkout-box {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.checkout-box > button {
  padding: 15px 25px;
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 10px;
  background: var(--success);
  color: white;
  font-weight: 600;
}

.checkout-box > button:hover {
  background: var(--primary);
}

.empty-cart {
  text-align: center;
  font-size: 20px;
  padding: 30px;
  color: var(--primary);
}
.cart-icon-box {
  position: relative;
}

#cartCount {
  position: absolute;
  top: -10px;
  right: -10px;
  background: red;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}
@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .hero {
    width: 90%;
  }
  .head {
    text-align: center;
  }
  .product-container {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .box {
    width: 100%;
  }
  .box > form > input {
    width: 100%;
  }
  .box > form > button {
    width: 80%;
  }
  .cart-box {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .main-container {
    grid-template-columns: 1fr;
  }
  .head {
    flex-direction: column;
  }
  .hero {
    width: 80%;
  }
  .product-container {
    grid-template-columns: 1fr;
  }
  .cart-box {
    grid-template-columns: 1fr;
  }
}
