/* ════════════════════════════════════════
   HUB-PANTRY-V4.CSS — Phase 3 Store Mode & Live Sharing Styles
   Aurora Family Hub · loaded after hub-pantry-v3.css
════════════════════════════════════════ */

/* ════════════════════════════════════════
   STORE MODE — body-level class
════════════════════════════════════════ */
.store-mode #shop-body {
  padding-bottom: 80px; /* room for Done Shopping fixed btn */
}

/* ── Entry banner ─────────────────────────────────────────── */
.store-banner {
  background: linear-gradient(135deg, rgba(142,203,168,0.25), rgba(142,203,168,0.12));
  border: 1px solid var(--mint);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1a6a4a;
  text-align: center;
  margin-bottom: 12px;
  animation: banner-fade-in 0.3s ease;
  transition: opacity 0.6s ease;
}
.store-banner.fade-out {
  opacity: 0;
}
@keyframes banner-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Store section wrap ───────────────────────────────────── */
.store-section-wrap {
  margin-bottom: 4px;
}

/* ── Store Mode section headers ───────────────────────────── */
.store-mode .shop-cat-header {
  min-height: 48px;
  font-size: 15px;
  font-weight: 700;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--card-border);
  margin-bottom: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.store-mode .shop-cat-header .section-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--lav-soft, rgba(184,160,216,0.2));
  color: var(--lav);
  border-radius: 99px;
  padding: 2px 8px;
  font-weight: 700;
}
/* Section completed state */
.store-mode .shop-cat-header.store-done {
  background: rgba(142, 203, 168, 0.18);
  border-color: var(--mint);
  color: #1a6a4a;
  min-height: 32px;
  font-size: 13px;
}
.store-mode .shop-cat-header.store-done::before {
  content: '✓ ';
  color: var(--mint);
}

/* ── Store Mode chips — larger tap targets ────────────────── */
.store-mode .shop-chip {
  min-height: 52px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  transition: background 0.15s, opacity 0.2s;
}
.store-mode .shop-chip .shop-chip-label {
  font-size: 15px;
}
/* Checkbox bigger in store mode */
.store-mode .shop-chip-cb {
  min-width: 44px;
  min-height: 44px;
  font-size: 20px;
  border-radius: 50%;
}
/* Hide delete btn in store mode */
.store-mode .shop-chip-del {
  display: none !important;
}
/* Hide qty adjust btns by default, show on tap */
.store-mode .shop-chip-addqty {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.store-mode .shop-chip:focus-within .shop-chip-addqty,
.store-mode .shop-chip.qty-active .shop-chip-addqty {
  opacity: 1;
  pointer-events: auto;
}

/* High contrast got state in store mode */
.store-mode .shop-chip.got {
  background: rgba(142, 203, 168, 0.35) !important;
  border-color: var(--mint);
}
.store-mode .shop-chip.got .shop-chip-label,
.store-mode .shop-chip.got .shop-chip-info {
  color: #1a6a4a;
  text-decoration: line-through;
}
.store-mode .shop-chip.got .shop-chip-cb {
  background: var(--mint);
  color: white;
  border-color: var(--mint);
}

/* ── Done Shopping button — fixed at screen bottom ───────── */
#shop-done-btn {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 500px;
  height: 56px;
  background: var(--mint);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(60,140,90,0.30);
  z-index: 200;
  transition: opacity 0.2s, transform 0.2s;
}
#shop-done-btn:hover  { background: #6db890; }
#shop-done-btn.hidden { display: none; }

/* ── Wake lock indicator ──────────────────────────────────── */
#store-wake-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  font-size: 18px;
  cursor: pointer;
  z-index: 300;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
  opacity: 0.8;
}
#store-wake-indicator.hidden { display: none; }

/* ── Voice add button ─────────────────────────────────────── */
#shop-voice-btn {
  padding: 7px 10px;
  border: 1.5px solid rgba(125, 211, 252, 0.6);
  border-radius: var(--radius-sm);
  background: rgba(125, 211, 252, 0.12);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
#shop-voice-btn:hover,
#shop-voice-btn.listening {
  background: rgba(125, 211, 252, 0.3);
  border-color: #7dd3fc;
}
#shop-voice-btn.listening {
  animation: voice-pulse 1s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(125,211,252,0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(125,211,252,0); }
}

/* ── Done Shopping confirmation sheet ───────────────────────── */
#done-shopping-sheet {
  position: fixed;
  inset: 0;
  background: rgba(30,20,40,0.42);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  padding: 0;
}
#done-shopping-sheet.hidden { display: none; }
.dss-inner {
  background: var(--card-bg, #fff);
  border-radius: 18px 18px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(60,20,80,0.18);
  animation: slide-up 0.25s ease;
}
@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.dss-handle {
  width: 40px; height: 4px;
  background: var(--card-border);
  border-radius: 99px;
  margin: 0 auto 18px;
}
.dss-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.dss-count {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 14px;
}
.dss-unchecked-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.dss-skip-item {
  font-size: 13px;
  color: var(--text-2);
  padding: 4px 0;
  border-bottom: 1px solid var(--card-border);
}
.dss-skip-item:last-child { border-bottom: none; }
#dss-unchecked-section {
  background: rgba(244,200,144,0.12);
  border: 1px solid rgba(244,200,144,0.4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
#dss-recurring-notice {
  font-size: 12px;
  color: #1a6a4a;
  background: rgba(142,203,168,0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
}
#dss-recurring-notice.hidden { display: none; }
#dss-unchecked-section.hidden { display: none; }
.dss-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
#dss-confirm-btn {
  background: var(--mint);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
#dss-cancel-btn {
  background: transparent;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}

/* ── Success particles ────────────────────────────────────── */
.store-done-particle {
  position: fixed;
  top: 20%;
  font-size: 24px;
  animation: float-up 1.6s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}
@keyframes float-up {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  100% { transform: translateY(-200px) rotate(30deg); opacity: 0; }
}

/* ════════════════════════════════════════
   SHARE BOTTOM SHEET
════════════════════════════════════════ */
#share-sheet {
  position: fixed;
  inset: 0;
  background: rgba(30,20,40,0.42);
  z-index: 900;
  display: flex;
  align-items: flex-end;
}
#share-sheet.hidden { display: none; }
.share-sheet-inner {
  background: var(--card-bg, #fff);
  border-radius: 18px 18px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  box-shadow: 0 -4px 24px rgba(60,20,80,0.18);
  animation: slide-up 0.25s ease;
}
.share-sheet-handle {
  width: 40px; height: 4px;
  background: var(--card-border);
  border-radius: 99px;
  margin: 0 auto 16px;
}
.share-sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.share-sheet-link-row {
  font-size: 11px;
  color: var(--text-3);
  font-family: monospace;
  word-break: break-all;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 8px 0 16px;
  min-height: 24px;
}
.share-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-sheet-actions .add-btn-labeled {
  text-align: center;
}
.share-sheet-actions .shop-tpl-btn {
  display: block;
  text-align: center;
  padding: 11px;
  font-size: 14px;
}

/* Live badge on Share button */
#share-live-badge {
  display: inline-block;
  background: rgba(142,203,168,0.25);
  border: 1px solid var(--mint);
  color: #1a6a4a;
  font-size: 9px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 5px;
  margin-left: 3px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}
#share-live-badge.hidden { display: none; }

/* Revoke link */
#share-revoke-btn {
  font-size: 12px;
  color: #c0392b;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 0 0;
  text-align: center;
  display: block;
  width: 100%;
}
#share-revoke-btn.hidden { display: none; }

/* ── Dark mode ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-hub-theme="minecraft"]):not([data-hub-theme="lego"]) {
    .store-banner { color: #6ecba4; }
    .store-mode .shop-cat-header {
      background: rgba(40,30,55,0.7);
      border-color: rgba(255,255,255,0.08);
    }
    .store-mode .shop-cat-header.store-done {
      background: rgba(50,120,80,0.2);
      border-color: var(--mint);
      color: #6ecba4;
    }
    .store-mode .shop-chip.got {
      background: rgba(50,120,80,0.18) !important;
    }
    .store-mode .shop-chip.got .shop-chip-label { color: #6ecba4; }
    .dss-inner,
    .share-sheet-inner { background: var(--card-bg, #2a1f3d); }
    .share-sheet-link-row { background: rgba(255,255,255,0.05); }
    #store-wake-indicator { background: rgba(40,30,55,0.8); }
  }
}
