/* Product shop — matches site leaf/cream language */

.shop-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.shop-main h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  color: var(--leaf-deep);
  margin-bottom: 0.35rem;
}

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 1rem 0 1.25rem;
}

.shop-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.shop-chip:hover,
.shop-chip.is-active {
  background: var(--leaf);
  color: #fff;
  border-color: var(--leaf);
}

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

.shop-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 81, 50, 0.12);
}

.shop-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.shop-card-actions {
  display: flex;
  gap: 0.45rem;
  padding: 0 0.9rem 0.9rem;
  align-items: center;
}

.shop-card-add,
.shop-card-cart,
.shop-card-view {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--leaf);
  background: rgba(31, 122, 77, 0.08);
  color: var(--leaf-deep);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  min-height: 40px;
}

.shop-card-cart {
  flex: 0 0 44px;
  font-size: 1.1rem;
  padding: 0.35rem;
}

.shop-card-view {
  background: var(--leaf, #2d6a4f);
  color: #fff;
  border-color: var(--leaf, #2d6a4f);
}

.shop-card-add:hover:not(:disabled),
.shop-card-cart:hover:not(:disabled) {
  background: rgba(31, 122, 77, 0.16);
}

.shop-card-view:hover {
  filter: brightness(1.05);
}

.shop-card-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--leaf);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.cart-badge[hidden] {
  display: none !important;
}

.site-links a[data-cart-nav][hidden] {
  display: none !important;
}

.shop-card-img {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 184, 74, 0.35), transparent 55%),
    #e8f5ec;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 240px 240px;
}

.shop-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: transparent;
}

.product-media {
  aspect-ratio: 1;
  background: #e8f5ec;
  border-radius: 16px;
  overflow: hidden;
}
.product-media img,
.product-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Soft fade only after the bitmap is ready — no invisible-stuck images */
.shop-lazy-img {
  opacity: 0.35;
  filter: blur(6px);
  transition: opacity 0.28s ease, filter 0.28s ease;
}
.shop-lazy-img.is-loaded {
  opacity: 1;
  filter: none;
}
.product-hero-img {
  opacity: 0.4;
  filter: blur(4px);
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.product-hero-img.is-loaded {
  opacity: 1;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .shop-lazy-img,
  .product-hero-img {
    opacity: 1;
    filter: none;
    transition: none;
  }
}

.shop-card-body {
  padding: 0.85rem 0.9rem 1rem;
  display: grid;
  gap: 0.25rem;
}

.shop-card-body strong {
  font-size: 1rem;
  color: var(--leaf-deep);
  line-height: 1.3;
}

.shop-price {
  font-weight: 700;
  color: var(--ink);
}

.shop-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.shop-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(232, 184, 74, 0.35);
  color: #7a4e00;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  width: fit-content;
}

.shop-section {
  margin: 2rem 0 1rem;
}

.shop-section h2 {
  font-size: 1.25rem;
  color: var(--leaf-deep);
  margin-bottom: 0.75rem;
}

.shop-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.shop-section-head h2 { margin: 0; }
.shop-section-head a {
  font-weight: 700;
  color: var(--leaf-deep);
  text-decoration: none;
  font-size: 0.92rem;
}

.shop-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.25rem 0 0.5rem;
}
.shop-pager-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.1);
  color: var(--leaf-deep, #0f5132);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.shop-pager-btn:hover {
  background: rgba(45, 106, 79, 0.18);
  border-color: rgba(45, 106, 79, 0.25);
}
.shop-pager-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.shop-pager-meta {
  font-size: 0.88rem;
  color: var(--muted, #4a6356);
  font-weight: 600;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: start;
}

.product-media {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8f5ec;
  aspect-ratio: 1;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-buy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
}

.product-buy input[type="number"] {
  width: 4.5rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
}

.checkout-summary {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.checkout-summary dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 0;
}

.checkout-summary dt { color: var(--muted); }
.checkout-summary dd { margin: 0; font-weight: 700; text-align: right; }
.checkout-summary .total dd { color: var(--leaf-deep); font-size: 1.15rem; }

.pay-hint {
  background: rgba(31, 122, 77, 0.08);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  margin: 0.5rem 0 0.75rem;
  line-height: 1.45;
}

.cat-list {
  display: grid;
  gap: 0.75rem;
}

.cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.cat-row:hover { border-color: var(--leaf); }
.cat-row strong { color: var(--leaf-deep); }

.empty-shop {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.cart-list {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}

.cart-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cart-thumb {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e8f5ec;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.75rem;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-info {
  display: grid;
  gap: 0.35rem;
}

.cart-info a {
  color: inherit;
  text-decoration: none;
}

.cart-info a:hover strong {
  color: var(--leaf);
}

.cart-qty {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.25rem;
}

.cart-qty input[type="number"] {
  width: 4.25rem;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font: inherit;
}

.cart-remove {
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
}

.cart-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 72px 1fr; }
}
