/* css/style.css - forbedret layout og styling */
:root {
  --max-width: 1100px;
  --accent: #ff3366;
  --muted: #666;
  --card-bg: #ffffff;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin: 0;
  color: #222;
  background: linear-gradient(180deg, #fbfbfb, #f2f2f2);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 1.2rem auto;
  padding: 0 1rem;
}

.site-header,
.site-footer {
  background: white;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.categories-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.categories-list li a {
  padding: .45rem .7rem;
  background: #fff;
  border-radius: .6rem;
  text-decoration: none;
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  margin-bottom: 1rem;
}

/* Filters */
.filters {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters input[type="search"],
.filters select {
  padding: .45rem .6rem;
  border-radius: .45rem;
  border: 1px solid #ddd;
  min-width: 120px;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: .8rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-size: .95rem;
  margin: 0 0 .4rem 0;
  color: var(--muted);
}

.imageContainer {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Sold out */
.soldOut .imageContainer p {
  display: block;
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  padding: .2rem .5rem;
  border-radius: 4px;
  font-weight: 700;
}

/* Price and discount */
.price {
  font-weight: 700;
  margin: .5rem 0;
}

.discount .price {
  text-decoration: line-through;
  color: #888;
}

.discounted_container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .5rem;
}

.discounted_container p:nth-child(2) {
  color: #fff;
  background: var(--accent);
  padding: .2rem .45rem;
  border-radius: .25rem;
  font-weight: 700;
}

/* Product page */
.product-page {
  display: flex;
  gap: 1.2rem;
}

.detail-image {
  flex: 1;
}

.detail-info {
  flex: 1;
  padding: .2rem 0;
}

.detail-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Responsive */
@media (max-width: 800px) {
  .product-page {
    flex-direction: column;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }
}

.loading {
  color: var(--muted);
}