@tailwind base;
@tailwind components;
@tailwind utilities;

/* Reset some basics */
body,
h1,
h2,
h3,
p,
ul,
li {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  background-color: #f9f9f9;
  color: #222;
  line-height: 1.5;
  padding: 1rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

header input[type="text"] {
  padding: 0.5rem;
  font-size: 1rem;
  width: 250px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Grid container for products */
.grid-container {
  display: grid;
  gap: 1rem;
}

/* Responsive grid: 2 columns mobile, 3 tablet, 4 desktop */
@media (min-width: 320px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Product card styling */
.product-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  /* keeps square images */
  object-fit: cover;
}

.product-card h3 {
  font-size: 1rem;
  margin: 0.5rem 0;
  padding: 0 0.5rem;
}

.product-card .price {
  color: #b12704;
  /* Amazon-style price color */
  font-weight: bold;
  margin-bottom: 0.5rem;
}

#pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#pagination button {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
  border-radius: 4px;
}

#pagination button:disabled {
  background-color: #eee;
  cursor: default;
}