/* Charity shop pages (/Shop, item, cart, checkout, order result/tracking). Uses the tokens from shared.css. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.shop-section { padding-top: 48px; }

/* ── Toolbar ── */
.shop-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.shop-heading { margin: 0; font-size: 1.35rem; color: var(--dark); display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; }
.shop-count { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.shop-search { display: flex; align-items: center; background: #fff; border: 1px solid #E4E4EA; border-radius: 12px; overflow: hidden; flex: 0 1 320px; }
.shop-search input { border: none; padding: 11px 14px; font: inherit; font-size: 14px; flex: 1; min-width: 0; background: transparent; }
.shop-search input:focus { outline: none; }
.shop-search:focus-within { border-color: var(--primary); }
.shop-search button { border: none; background: none; padding: 0 14px; color: var(--muted); cursor: pointer; height: 44px; }
.shop-search .ico { width: 20px; height: 20px; }
.shop-cart-link { display: inline-flex; align-items: center; gap: 4px; padding: 11px 16px; border-radius: 12px; background: #FFF1EA; color: var(--primary-d); font-weight: 600; font-size: 14px; }

/* ── Grid ── */
.shop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.shop-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: transform var(--trans), box-shadow var(--trans); }
.shop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.shop-card-link { color: inherit; display: flex; flex-direction: column; flex: 1; }
.shop-card-img { aspect-ratio: 1 / 1; background: #F1F1F4; }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-card-body { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.shop-card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--dark); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: start; }
.shop-card-condition { align-self: flex-start; font-size: 12px; color: var(--secondary); background: #EEF6F1; padding: 2px 10px; border-radius: 20px; }
.shop-card-price { margin-top: auto; font-size: 17px; font-weight: 800; color: var(--primary-d); }
.shop-card-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.shop-card-add { margin: 0 16px 16px; padding: 10px; border: 1.5px solid var(--primary); border-radius: 10px; background: #fff; color: var(--primary-d); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background var(--trans), color var(--trans); }
.shop-card-add:hover { background: var(--primary); color: #fff; }

.shop-empty { text-align: center; padding: 56px 16px; color: var(--muted); background: #fff; border-radius: var(--radius); }
.shop-empty a { color: var(--primary-d); font-weight: 600; }

.shop-pager { margin-top: 32px; display: flex; justify-content: center; }
.shop-pager ul { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; flex-wrap: wrap; justify-content: center; }
.shop-pager li a, .shop-pager li span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.shop-pager li.active a, .shop-pager li.active span { background: var(--primary); color: #fff; }
.shop-pager li.disabled { opacity: .45; }

.shop-donate-cta { margin-top: 48px; padding: 24px 28px; border-radius: var(--radius); background: linear-gradient(135deg, #FFF5EF, #FFE9DC); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.shop-donate-cta strong { font-size: 17px; color: var(--dark); }
.shop-donate-cta p { margin: 4px 0 0; color: var(--muted); font-size: 14px; text-align: start; }

/* ── Toast ── */
.shop-toast { position: fixed; bottom: 24px; inset-inline: 16px; margin: 0 auto; max-width: 420px; padding: 14px 18px; border-radius: 12px; background: var(--dark); color: #fff; font-size: 14px; text-align: center; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .25s, transform .25s; z-index: 1000; }
.shop-toast.show { opacity: 1; transform: none; pointer-events: auto; }
.shop-toast a { color: var(--accent); font-weight: 700; margin-inline-start: 6px; }

/* ── Product page ── */
.product-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.product-gallery-main { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: #F1F1F4; }
.product-gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.product-thumbs button { width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #F1F1F4; }
.product-thumbs button[aria-pressed="true"] { border-color: var(--primary); }
.product-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-info h1 { font-size: 1.6rem; color: var(--dark); margin: 0 0 10px; line-height: 1.6; }
.product-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.product-chip { font-size: 13px; padding: 4px 12px; border-radius: 20px; background: #EEF6F1; color: var(--secondary); }
.product-chip.muted { background: #F1F1F4; color: var(--muted); }
.product-price { font-size: 1.7rem; font-weight: 800; color: var(--primary-d); margin-bottom: 18px; }
.product-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.product-desc { color: var(--text); line-height: 2; white-space: pre-line; margin-bottom: 24px; text-align: start; }
.product-buy { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid #E4E4EA; border-radius: 12px; overflow: hidden; background: #fff; }
.qty-stepper button { width: 42px; height: 46px; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--dark); }
.qty-stepper button:disabled { opacity: .35; cursor: default; }
.qty-stepper output { min-width: 36px; text-align: center; font-weight: 700; }
.product-sold { padding: 14px 18px; border-radius: 12px; background: #F1F1F4; color: var(--muted); }
.product-impact { margin-top: 28px; padding: 16px 18px; border-radius: 12px; background: #FFF5EF; color: var(--text); font-size: 14px; line-height: 1.9; text-align: start; }

/* ── Cart & checkout ── */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
.cart-line img, .cart-line .noimg { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: #F1F1F4; display: block; }
.cart-line-title { font-weight: 700; color: var(--dark); font-size: 15px; }
.cart-line-price { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cart-line-warning { color: #C0392B; font-size: 13px; margin-top: 4px; }
.cart-line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line-total { font-weight: 800; color: var(--primary-d); }
.cart-remove { border: none; background: none; color: #C0392B; font: inherit; font-size: 13px; cursor: pointer; padding: 4px 6px; }
.cart-summary { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; position: sticky; top: 100px; }
.cart-summary h2 { font-size: 1.1rem; margin: 0 0 14px; color: var(--dark); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--text); }
.summary-row.total { border-top: 1px solid #eee; margin-top: 6px; padding-top: 14px; font-weight: 800; font-size: 16px; color: var(--dark); }
.cart-summary .btn-primary { width: 100%; justify-content: center; margin-top: 16px; }
.cart-summary .btn-primary[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.checkout-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 20px; }
.checkout-card h2 { font-size: 1.1rem; margin: 0 0 16px; color: var(--dark); }
.delivery-options { display: flex; flex-direction: column; gap: 10px; }
.delivery-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid #E4E4EA; border-radius: 12px; cursor: pointer; }
.delivery-option:has(input:checked) { border-color: var(--primary); background: #FFF8F4; }
.delivery-option input { margin-top: 5px; accent-color: var(--primary); }
.delivery-option strong { display: block; color: var(--dark); font-size: 15px; }
.delivery-option span { font-size: 13px; color: var(--muted); }
.checkout-error { color: #C0392B; background: #FBEAEA; border: 1px solid #F3C9C9; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.summary-mini-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); padding: 4px 0; }

/* ── Order result / tracking ── */
.order-card { max-width: 640px; margin: 0 auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 32px 28px; }
.order-status-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 30px; color: #fff; background: var(--secondary); }
.order-status-icon.failed { background: #C0392B; }
.order-card h1 { text-align: center; font-size: 1.35rem; margin: 0 0 8px; color: var(--dark); }
.order-card .lead { text-align: center; color: var(--muted); margin-bottom: 22px; }
.order-number { margin: 0 auto 22px; padding: 14px; border-radius: 12px; background: #FFF5EF; border: 1.5px dashed var(--primary); text-align: center; }
.order-number .label { font-size: 12px; color: var(--muted); }
.order-number .value { font-size: 22px; font-weight: 800; color: var(--primary-d); direction: ltr; letter-spacing: 1px; }
.order-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.order-actions .btn-outline, .order-actions .btn-primary { padding: 11px 22px; }
.track-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 24px; }

@media (max-width: 900px) {
  .product-layout, .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

@media (max-width: 600px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shop-card-body { padding: 10px 12px 8px; }
  .shop-card-title { font-size: 14px; }
  .shop-card-add { margin: 0 12px 12px; padding: 8px; font-size: 13px; }
  .shop-search { flex-basis: 100%; }
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-line img, .cart-line .noimg { width: 64px; height: 64px; }
  .cart-line-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .track-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .shop-card, .shop-toast { transition: none; }
  .shop-card:hover { transform: none; }
}
