/* GoCart — shop product cards & thumbnails */

/* ── Product grid ── */
.product-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  margin-top: 2.5rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* ── Product card ── */
.product-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.product-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.product-card__media:hover {
  border-color: #94a3b8;
}

.product-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0fdfa 0%, #f1f5f9 100%);
  color: #94a3b8;
}

.product-card__img--empty svg {
  width: 2.5rem;
  height: 2.5rem;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.product-card__type {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f766e;
}

.product-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}

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

.product-card__title a:hover {
  color: #0f766e;
}

.product-card__excerpt {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
  flex: 1;
}

.product-card__price {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-top: 0.25rem;
}

.product-card__cta {
  margin-top: 0.5rem;
}

/* ── Product detail ── */
.product-detail {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .product-detail {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

.product-detail__media {
  padding: 1.25rem;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.product-detail__media img,
.product-detail__media .product-detail__img--empty {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.product-detail__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0fdfa 0%, #f1f5f9 100%);
  color: #94a3b8;
}

.product-detail__img--empty svg {
  width: 3.5rem;
  height: 3.5rem;
}

/* ── Cart item thumbnail ── */
.cart-item__thumb {
  flex-shrink: 0;
  padding: 0.375rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.cart-item__thumb img,
.cart-item__thumb .cart-item__img--empty {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
}

.cart-item__img--empty svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* ── Cart page ── */
.cart-page {
  --cart-accent: #0f766e;
  --cart-accent-hover: #0d9488;
}

.dhp-shop .cart-page {
  --cart-accent: #c2410c;
  --cart-accent-hover: #ea580c;
}

.cart-toast {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
}

.cart-toast--error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-line {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: opacity 0.2s, transform 0.25s;
}

@media (min-width: 640px) {
  .cart-line {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cart-line--busy {
  opacity: 0.65;
  pointer-events: none;
}

.cart-line--removing {
  opacity: 0;
  transform: translateX(0.5rem);
}

.cart-line__info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.cart-line__meta a {
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
}

.cart-line__meta a:hover {
  color: var(--cart-accent);
}

.cart-line__variant {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: #64748b;
}

.cart-line__unit-price {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.cart-line__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #f8fafc;
  overflow: hidden;
}

.qty-stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.qty-stepper__btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: var(--cart-accent);
}

.qty-stepper__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-stepper__value {
  min-width: 2rem;
  padding: 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.cart-line__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cart-line__remove:hover:not(:disabled) {
  background: #fef2f2;
  color: #dc2626;
}

.cart-line__remove svg {
  width: 1.125rem;
  height: 1.125rem;
}

.cart-line__total {
  min-width: 5.5rem;
  margin: 0;
  font-weight: 700;
  text-align: right;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.cart-summary-block {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 1rem;
  background: #f8fafc;
}

.cart-summary-block__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.cart-summary-block__note {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.cart-summary-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cart-empty {
  margin-top: 3rem;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  background: #fff;
}

.cart-empty__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.cart-empty__text {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: #64748b;
}

/* ── Admin media picker ── */
.admin-media-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 1rem;
}

.admin-media-picker label {
  cursor: pointer;
  text-align: center;
}

.admin-media-picker input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-media-picker__tile {
  display: block;
  padding: 0.375rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-media-picker__tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.admin-media-picker input:checked + .admin-media-picker__tile {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.admin-media-picker__none {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  font-size: 0.75rem;
  color: #64748b;
}
