/* Styles for grace-extras.js: compare, frequently bought together, photo zoom. Uses the page's colour tokens. */
.gx-compare-tray[hidden], .gx-zoom[hidden] { display: none !important; }

/* Compare checkbox on product cards */
.gx-compare-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .82rem; color: var(--text-muted); cursor: pointer; user-select: none; }
.gx-compare-toggle input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Compare tray: bottom left on desktop, above the tab bar on phones */
.gx-compare-tray { position: fixed; left: 18px; bottom: 18px; z-index: 185; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 110px); padding: 10px 12px 10px 16px; background: var(--white); color: var(--text-main);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(16, 24, 40, .18); font-size: .88rem;
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
/* Moved up by grace-extras.js when the sticky ad strip is showing, so the two never overlap. */
.gx-compare-tray.gx-lifted { bottom: var(--gx-tray-bottom) !important; }
.gx-tray-text { font-weight: 600; }
.gx-tray-clear { background: none; border: 0; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 4px 6px; }
@media (max-width: 768px) {
  .gx-compare-tray { left: 10px; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100vw - 90px); }
}

/* Compare dialog */
.gx-compare-modal { max-width: min(960px, calc(100vw - 24px)); width: 100%; }
.gx-compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gx-compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 480px; }
.gx-compare-table th, .gx-compare-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.gx-compare-table tbody th { color: var(--text-muted); font-weight: 600; white-space: nowrap; width: 1%; }
.gx-compare-table thead th { vertical-align: bottom; }
.gx-compare-table thead img { display: block; width: 100%; max-width: 140px; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: var(--bg-light); }
.gx-icon { display: block; font-size: 2.4rem; line-height: 1.2; }
.gx-name { display: block; margin: 6px 0 4px; font-weight: 700; text-align: left; color: var(--dark); }
.gx-remove { background: none; border: 0; padding: 0; color: var(--text-muted); font-size: .78rem; text-decoration: underline; cursor: pointer; }
.gx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Frequently bought together (product view) */
.gx-together { margin: 4px 0 18px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-light); }
.gx-together h4 { margin: 0 0 10px; font-size: .98rem; }
.gx-together-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gx-together-list label { display: grid; grid-template-columns: auto 44px 1fr auto; align-items: center; gap: 10px; cursor: pointer; font-size: .86rem; }
.gx-together-list input { width: 17px; height: 17px; accent-color: var(--primary); }
.gx-together-list img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.gx-together-list .gx-icon { font-size: 1.6rem; text-align: center; }
.gx-together-name { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gx-together-price { font-weight: 700; white-space: nowrap; }
.gx-together-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Photo zoom */
.gx-zoomable { cursor: zoom-in; }
.gx-zoom { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(10, 10, 14, .92); overflow: hidden; }
.gx-zoom img { max-width: 94vw; max-height: 86vh; object-fit: contain; cursor: zoom-in; transition: transform .2s ease; touch-action: pinch-zoom; }
.gx-zoom.zoomed img { transform: scale(2.5); cursor: zoom-out; touch-action: none; }
.gx-zoom-close { position: absolute; top: 14px; right: 16px; color: #fff; background: rgba(255, 255, 255, .12); border-radius: 50%; width: 40px; height: 40px; }
.gx-zoom-hint { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; color: rgba(255, 255, 255, .7); font-size: .82rem; }
@media (prefers-reduced-motion: reduce) { .gx-zoom img { transition: none; } }

/* Bulk-order form: shown on request */
.form-container .gx-form-open { display: block; margin: 28px auto; }
