/* General Section Styling */
#study-materials, #cart {
  background: #f4f6f9;        /* light background */
  padding: 2rem;
  text-align: center;         /* center align everything */
  font-family: 'Poppins', sans-serif;
}

/* Results info text */
#results-info {
  font-size: 1rem;
  color: #333;
  margin-bottom: 1rem;
}

/* Product Container */
#materials-container {
  display: flex;              /* flexbox for cards */
  flex-wrap: wrap;            /* wrap to next line if needed */
  justify-content: center;    /* center horizontally */
  align-items: stretch;       /* make all cards equal height */
  gap: 1rem;                  /* space between cards */
}

/* Product Card */
.material-card {
  flex: 0 1 260px;            /* base width, can grow if needed */
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 0.8rem;
  padding: 1rem;
  box-sizing: border-box;

  /* Flexbox ensures button stays at bottom */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* Product Image */
.material-card img {
  max-width: 100%;
  height: 140px;              /* fixed image height */
  object-fit: contain;        /* keep aspect ratio */
  margin-bottom: 0.5rem;
}

/* Sale Badge */
.sale {
  display: inline-block;
  color: #fff;
  background: #e63946;
  font-weight: bold;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Product Title */
.material-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0.5rem 0;
  text-align: center;
  /* full text shows, card grows if needed */
  word-wrap: break-word;
}

/* Category & Price */
.material-card p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  word-wrap: break-word;
}

.material-card p del {
  color: #999;
  margin-right: 0.5rem;
}

/* Buttons */
button {
  background: #1a1a2e;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

button:hover {
  background: #0077cc;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Pagination */
#pagination {
  margin-top: 1.5rem;
  text-align: center;
}

#pagination button {
  background: #fff;
  border: 1px solid #ddd;
  color: #1a1a2e;
  margin: 0 0.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

#pagination button:hover {
  background: #0077cc;
  color: #fff;
}

#pagination button:disabled {
  background: #1a1a2e;
  color: #fff;
  cursor: default;
}

/* Cart Items Container */
#cart-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;       /* equal height */
  gap: 1rem;
}

/* Each Cart Item */
.cart-item {
  flex: 0 1 300px;            /* base width */
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;

  /* Flexbox for button alignment */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* Cart Item Text */
.cart-item p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: #333;
  text-align: center;
  word-wrap: break-word;
}

/* Cart Total */
#cart-total {
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 1rem;
}

