/* products.css
   Styles for products listing and product cards
   Theme: Purple + Gold
*/

/* Utility containers */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem;
}

/* Page title */
.page-title {
  font-size: 1.75rem;
  margin: 1rem 2rem;
  font-weight: 600;
  color: #6a1b9a; /* purple */
}

/* Category block */
.category-block {
  margin: 2.25rem 0;
  padding: 3rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.category-title {
  font-size: 1.25rem;
  margin: 0.5rem 0 1rem;
  color: #4a148c; /* darker purple */
}



/* Product grid */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Card */
.card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(10,10,10,0.03);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(106,27,154,0.18); /* purple glow */
}

/* Clickable image wrapper */
.card-link {
  display: block;
  width: 100%;
  overflow: hidden;
  flex: 0 0 auto;
}
.card-link img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform .2s ease;
}
.card-link:hover img {
  transform: scale(1.03);
}

/* Card body */
.card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
}
.product-title { margin: 0; font-size: 1rem; font-weight: 600; }
.product-title a { color: #4a148c; text-decoration: none; } /* purple */
.product-title a:hover { text-decoration: underline; color: #f1c40f; } /* gold */

.muted { color: #777; font-size: 0.9rem; margin: 0; }
.price { font-weight: 700; font-size: 1rem; color: #6a1b9a; } /* purple */

/* Qty + add to cart */
.add-to-cart-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: auto;
}
.qty-input {
  width: 68px;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 0.95rem;
}
.btn-add {
  background: #f1c40f; /* gold */
  color: #4a148c; /* dark purple text */
  border: 0;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background .12s ease, transform .08s ease;
}
.btn-add:hover { background: #d4ac0d; transform: translateY(-1px); }
.btn-add:active { transform: translateY(0); }

/* No results text */
.no-results {
  color: #777;
  font-style: italic;
  padding: 0.5rem 0;
}

/* Product detail page helpers (also used by product.php) */
.product-detail {
  padding: 1.25rem 0;
}
.product-detail-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}
.product-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.06);
}
.product-info h1 { margin-top: 0; font-size: 1.6rem; color: #4a148c; } /* purple */
.price-large { font-size: 1.4rem; font-weight: 700; color: #6a1b9a; margin: 0.5rem 0; } /* purple */
.product-description { color: #333; line-height: 1.6; margin: 0.75rem 0; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .product-detail-grid { grid-template-columns: 1fr; }
  .card-link img { height: 200px; }
}
@media (max-width: 720px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
  .card-link img { height: 180px; }
  .qty-input { width: 56px; }
}
@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-title { font-size: 0.98rem; }
  .card-link img { height: 220px; }
  .btn-add { padding: 0.45rem 0.6rem; }
}

/* Small accessibility touches */
.card a { outline-offset: 3px; }
.card a:focus { box-shadow: 0 0 0 3px rgba(241,196,15,0.35); border-radius: 8px; } /* gold focus */



/* =========================
   Product Detail Page
   ========================= */
.product-detail {
  padding: 2rem 0;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}

.product-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.product-info h1 {
  margin-top: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #4a148c; /* purple */
}

.price-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6a1b9a; /* purple */
  margin: 0.75rem 0;
}

.product-description {
  color: #333;
  line-height: 1.6;
  margin: 1rem 0;
  font-size: 1rem;
}

/* Add to cart form on detail page */
.product-detail .add-to-cart-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.product-detail .qty-input {
  width: 70px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 1rem;
}

/* Big add to cart button */
.product-detail .btn-add {
  background: #f1c40f;   /* gold */
  color: #4a148c;        /* purple text */
  border: 0;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background .15s ease, transform .1s ease;
}
.product-detail .btn-add:hover {
  background: #d4ac0d;   /* darker gold */
  transform: translateY(-2px);
}
.product-detail .btn-add:active {
  transform: translateY(0);
}
