﻿/* ===== SHOPFRONT v0.62 ===== */
.shop-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .5rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.shop-home-hero h1,
.shop-page-head h1 {
  margin: 0 0 .3rem;
  letter-spacing: 0;
}

.shop-home-hero p,
.shop-page-head__lead,
.shop-section__head p {
  color: #555;
  margin: 0;
}

.shop-home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  margin: 0;
  max-width: none;
}

.shop-home-search input {
  min-width: 0;
  margin: 0;
}

.shop-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1.25rem;
}

.shop-quick-links a,
.category-chip-row a,
.active-filters span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #333;
  padding: .35rem .75rem;
  font-weight: 600;
  text-decoration: none;
}

.shop-quick-links a:hover,
.category-chip-row a:hover {
  border-color: var(--primary);
  background: #fff7ed;
  text-decoration: none;
}

.shop-section {
  margin: 1.5rem 0;
}

.shop-section__head,
.shop-page-head,
.catalog-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.shop-section__head a {
  font-weight: 700;
  white-space: nowrap;
}

.category-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.catalog-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(180px, .8fr) minmax(180px, .8fr) auto;
  gap: .75rem;
  max-width: none;
  margin: 1rem 0;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .5rem;
  box-shadow: var(--shadow);
}

.catalog-filter--narrow {
  grid-template-columns: minmax(260px, 420px) auto;
}

.catalog-filter label {
  gap: .25rem;
  font-weight: 700;
}

.catalog-filter label span {
  font-size: .85rem;
  color: #555;
}

.catalog-filter input,
.catalog-filter select {
  width: 100%;
  margin: 0;
}

.catalog-filter__actions {
  display: flex;
  align-items: end;
  gap: .5rem;
  flex-wrap: wrap;
}

.btn-light {
  background: #fff;
  color: #333;
  border: 1px solid #d1d5db;
}

.btn-light:hover {
  background: #f9fafb;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}

.active-filters span {
  min-height: 30px;
  padding: .25rem .65rem;
  color: #7a4a00;
  border-color: #ffd8a3;
  background: #fff7ed;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.product-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  scroll-margin-top: 96px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.product-card:hover {
  border-color: #ffd8a3;
  box-shadow: 0 8px 22px rgba(0,0,0,.09);
}

.product-card__image {
  display: block;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border-bottom: 1px solid #f0f0f0;
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: .7rem;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1;
  padding: .9rem;
}

.product-card__badges,
.category-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  min-height: 24px;
}

.product-badge,
.category-card__badges span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}

.product-badge--seasonal,
.category-card__badges span:first-child {
  color: #1e7e34;
  background: #e9fbef;
}

.product-badge--discount,
.category-card__badges span:last-child {
  color: #991b1b;
  background: #fee2e2;
}

.product-card__title {
  font-size: 1rem;
  line-height: 1.25;
  margin: 0;
  min-height: 2.5em;
}

.product-card__title a {
  color: #222;
  text-decoration: none;
}

.product-card__title a:hover {
  color: var(--primary-dark);
}

.product-card__meta {
  color: #666;
  font-size: .88rem;
  min-height: 1.2em;
}

.product-card__price {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  color: var(--primary-dark);
}

.product-card__price strong {
  font-size: 1.12rem;
}

.product-card__old-price {
  color: #777;
  text-decoration: line-through;
  font-size: .9rem;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  border-radius: 999px;
  padding: .22rem .6rem;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.25;
}

.stock-pill--local {
  color: #1e7e34;
  background: #e9fbef;
}

.stock-pill--external,
.stock-pill--mixed {
  color: #7a4a00;
  background: #fff7e6;
}

.stock-pill--empty {
  color: #666;
  background: #f3f4f6;
}

.product-card__footer {
  margin-top: auto;
  padding-top: .35rem;
}

.product-card__cart-form {
  display: grid;
  grid-template-columns: 86px minmax(96px, 1fr);
  gap: .5rem;
  align-items: end;
  max-width: none;
  margin: 0;
}

.qty-control {
  display: grid;
  gap: .18rem;
  font-size: .78rem;
  color: #555;
  font-weight: 700;
}

.qty-control input {
  width: 100%;
  height: 38px;
  margin: 0;
  text-align: center;
}

.product-card__cart-form .btn-cart {
  width: 100%;
  min-height: 38px;
  padding: .45rem .7rem;
}

.product-card__unavailable,
.shop-empty {
  display: block;
  color: #666;
  background: #f3f4f6;
  border-radius: .5rem;
  padding: .75rem;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  padding: 1rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.category-card:hover {
  border-color: #ffd8a3;
  box-shadow: 0 8px 22px rgba(0,0,0,.09);
}

.category-card h2 {
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0 0 .35rem;
}

.category-card p {
  margin: 0 0 .75rem;
  color: #555;
}

.category-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 1rem;
  border-radius: .5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-weight: 800;
  text-decoration: none;
}

.category-card__link:hover {
  text-decoration: none;
  background: var(--primary-dark);
}

.catalog-pagination {
  margin: 1.25rem 0;
}

@media (max-width: 900px) {
  .shop-home-hero,
  .catalog-filter,
  .catalog-filter--narrow {
    grid-template-columns: 1fr;
  }

  .shop-section__head,
  .shop-page-head,
  .catalog-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .active-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .shop-home-search,
  .product-card__cart-form {
    grid-template-columns: 1fr;
  }

  .product-grid,
  .product-grid--compact {
    grid-template-columns: 1fr;
  }
}
