/* extras.css — additive accessibility + onboarding/install polish. Append-only;
   does not duplicate rules from base/layout/components/skins. */

/* ── Hidden attribute wins over component display rules ───────────────────── */
/* .btn{display:inline-flex} / .fab{display:flex} otherwise override the UA
   [hidden]{display:none}, leaving toggled-off chrome visible. */
[hidden] { display: none !important; }

/* ── Focus visibility ─────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Drop the default outline only where :focus-visible is honored, keeping it for
   keyboard users via the rule above. */
@supports selector(:focus-visible) {
  :focus:not(:focus-visible) {
    outline: none;
  }
}
.toggle-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Card main button (replaces former role=button card; no nested interactive) ── */
.card-main {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  border-radius: inherit;
}
.card-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── Scroll lock under modal/sheet ────────────────────────────────────────── */
body.overlay-open .main {
  overflow: hidden;
}

/* ── Screen-reader-only ───────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Onboarding ───────────────────────────────────────────────────────────── */
.onboarding {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 60vh;
}
.onboarding-top {
  display: flex;
  justify-content: flex-end;
}
.onboarding-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.onboarding-choices {
  display: grid;
  gap: 10px;
}
.onboarding-footer {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 4px;
}
.onboarding-footer .btn {
  min-width: 96px;
}

/* ── Install hint ─────────────────────────────────────────────────────────── */
.install-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Reminder-day chips ───────────────────────────────────────────────────── */
.reminder-days {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.chip[aria-pressed="true"] {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
}

/* ── Geofence nearby sheet ────────────────────────────────────────────────── */
.nearby-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nearby-sheet .nearby-card {
  width: 100%;
  text-align: left;
}

/* ── Coupon code panel (detail) ───────────────────────────────────────────── */
.coupon-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.coupon-code-media {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  /* white backing so QR/barcode stay scannable on tinted surfaces */
  padding: 10px;
  background: #fff;
  border-radius: var(--radius-md);
}
.coupon-code svg {
  max-width: 100%;
}
.coupon-code-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--text-primary);
  word-break: break-all;
  text-align: center;
}

/* ── Coupon photo (edit preview + detail view) ────────────────────────────── */
.photo-preview {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 10px;
  background: var(--bg-hover);
}
.coupon-photo {
  margin: 12px 0;
}
.coupon-photo-img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: zoom-in;
}
.coupon-photo-full {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.card-icon .card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* ── Detail timeline empty hint ───────────────────────────────────────────── */
.detail-timeline-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Storage retention status line ────────────────────────────────────────── */
.storage-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.storage-status.ok {
  color: var(--success);
}

/* ── Distinct "my location" map marker ────────────────────────────────────── */
/* Shop pins keep their shared chrome from components.css; the 'me' marker is
   restyled as a classic pulsing blue location dot so it's unmistakable. */
.coupon-map-pin.me {
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
}
.coupon-map-pin.me span {
  width: 16px;
  height: 16px;
  background: #2563eb;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, .55), 0 2px 6px rgba(0, 0, 0, .35);
}
.coupon-map-pin.me::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .25);
  z-index: -1;
  animation: me-pulse 2s ease-out infinite;
}
@keyframes me-pulse {
  0% { transform: scale(.5); opacity: .75; }
  100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .coupon-map-pin.me::after { animation: none; }
}
