/* style.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: #f6f8f7;
  color: #1c2a23;
  min-height: 100vh;
  padding: 1.5rem 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.8rem;
}

/* header */
.header {
  background: #ffffffd9;
  backdrop-filter: blur(6px);
  border-radius: 2rem;
  box-shadow: 0 8px 24px rgba(0,20,10,0.04);
  padding: 0.8rem 1.2rem;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(60, 100, 70, 0.08);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1f3b2c;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  font-weight: 500;
}

.nav-links a {
  text-decoration: none;
  color: #2d4a39;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
  font-size: 0.98rem;
}

.nav-links a.active {
  border-bottom-color: #2b7a4b;
  color: #1b4d2e;
}

.nav-links a:hover {
  border-bottom-color: #2b7a4b;
  color: #0d2e1b;
}

.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
  font-size: 1.6rem;
  color: #1f3b2c;
  transition: 0.2s;
}

.cart-icon-wrapper:hover {
  color: #2b7a4b;
  transform: scale(1.04);
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #1a4b2a;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 30px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(27, 67, 40, 0.2);
}

/* main grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.8rem;
}

.product-card {
  background: white;
  border-radius: 1.8rem;
  padding: 1.5rem 1.2rem 1.4rem;
  box-shadow: 0 6px 16px rgba(0,0,0,0.02);
  border: 1px solid #eaf0ec;
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: #bcd9cb;
  box-shadow: 0 18px 30px -12px rgba(30, 60, 40, 0.12);
}

.product-image {
  width: 100%;
  aspect-ratio: 1/1;
  background: #f0f5f2;
  border-radius: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  color: #1f4d31;
  margin-bottom: 0.9rem;
}

.product-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
  color: #142619;
}

.product-price {
  font-weight: 600;
  color: #1f4d31;
  font-size: 1.15rem;
  margin: 0.4rem 0 0.8rem;
}

.product-price small {
  font-weight: 400;
  color: #4d6f5b;
  font-size: 0.75rem;
  margin-left: 4px;
}

.add-to-cart {
  background: #1f3b2c;
  color: white;
  border: none;
  padding: 0.7rem 0.2rem;
  border-radius: 60px;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.18s;
  margin-top: auto;
  border: 1px solid transparent;
}

.add-to-cart:hover {
  background: #2b7a4b;
  transform: scale(1.02);
  box-shadow: 0 6px 14px rgba(27, 94, 54, 0.25);
}

.add-to-cart:active {
  transform: scale(0.96);
}

/* cart sidebar */
.cart-sidebar {
  background: white;
  border-radius: 2rem;
  padding: 1.5rem 1.2rem 1.2rem;
  box-shadow: 0 8px 24px rgba(0, 20, 10, 0.04);
  border: 1px solid #e6eee9;
  position: sticky;
  top: 2rem;
  transition: 0.2s;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}

.cart-header h3 {
  font-weight: 600;
  color: #142619;
  font-size: 1.2rem;
}

.close-cart {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #5b7a68;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 40px;
  transition: 0.15s;
}

.close-cart:hover {
  background: #f0f5f2;
  color: #1f3b2c;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 4px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #ecf3ef;
  gap: 0.6rem;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: #1a2d22;
}

.cart-item-price {
  font-weight: 500;
  color: #1f4d31;
  font-size: 0.85rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-item-actions button {
  background: #f0f5f2;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: #1f3b2c;
  transition: 0.12s;
}

.cart-item-actions button:hover {
  background: #d9e8e0;
}

.cart-item-qty {
  min-width: 24px;
  text-align: center;
  font-weight: 500;
}

.empty-cart-msg {
  text-align: center;
  color: #5b7a68;
  padding: 2.2rem 0;
  font-size: 0.95rem;
}

.empty-cart-msg i {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  opacity: 0.5;
}

.cart-footer {
  border-top: 1px solid #e0ebe5;
  padding-top: 1rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.15rem;
  color: #142619;
  margin-bottom: 0.9rem;
}

.checkout-btn {
  width: 100%;
  background: #1a4b2a;
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 60px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.18s;
  border: 1px solid #2b7a4b;
}

.checkout-btn:hover {
  background: #2b7a4b;
  box-shadow: 0 8px 16px rgba(27, 94, 54, 0.2);
  transform: scale(1.01);
}

/* overlay */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 5, 0.2);
  backdrop-filter: blur(2px);
  z-index: 9;
}

/* mobile responsiveness */
@media (max-width: 600px) {
  .header-container {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links {
    gap: 1rem;
  }
  .cart-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-height: 70vh;
    border-radius: 2rem 2rem 0 0;
    z-index: 20;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
    padding: 1.5rem 1.2rem;
    border: none;
    border-top: 1px solid #dce8e1;
  }
  .cart-sidebar.open {
    transform: translateY(0);
  }
  .overlay.active {
    display: block;
  }
  .close-cart {
    display: block !important;
  }
}

.close-cart {
  display: none;
}

@media (max-width: 600px) {
  .close-cart {
    display: block;
  }
}

/* toast */
.toast-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f3b2c;
  color: white;
  padding: 0.6rem 1.8rem;
  border-radius: 60px;
  font-weight: 500;
  box-shadow: 0 10px 24px rgba(0,20,10,0.2);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast-message.show {
  opacity: 1;
}