/* ============ BOTTOM SHEET / DETAIL PANEL ============ */
.bottom-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,14,10,0.3);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.visible { opacity: 1; pointer-events: auto; }

.bottom-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--surface-cream);
  border-radius: 20px 20px 0 0;
  z-index: 700;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-spring);
  max-height: 75vh;
  overflow-y: auto;
  /* Safe area padding for notched devices (REQ-5, AC-5) */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Deep warm shadows — leather-bound menu aesthetic */
  box-shadow:
    0 -4px 16px rgba(26,14,10,0.08),
    0 -8px 40px rgba(26,14,10,0.12),
    0 -16px 64px rgba(26,14,10,0.06);
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet.expanded { max-height: 90vh; }

.sheet-handle {
  width: 36px; height: 4px;
  background: rgba(44,24,16,0.15);
  border-radius: 2px;
  margin: var(--space-3) auto 0;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-4) var(--space-6) var(--space-4);
  border-bottom: 1px solid rgba(200,146,58,0.2);
  box-shadow:
    0 1px 2px rgba(26,14,10,0.06),
    0 2px 8px rgba(26,14,10,0.08),
    0 4px 16px rgba(26,14,10,0.05),
    0 8px 32px rgba(26,14,10,0.04);
}
.sheet-shop-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-dark);
}
.sheet-score {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  transition: transform 0.4s var(--ease-out-back), opacity 0.3s ease;
}
.sheet-score.pop { animation: scorePop 0.5s var(--ease-out-back); }

/* Best in city badge — gold foil */
.best-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #DAA520, #C8923A, #DAA520);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldFoil 3s linear infinite;
  border: 1px solid rgba(200,146,58,0.3);
  padding: 2px var(--space-2);
  border-radius: 10px;
  margin-left: var(--space-2);
  vertical-align: middle;
  box-shadow: 0 0 12px rgba(200,146,58,0.3);
}

.sheet-meta {
  padding: var(--space-1) var(--space-6) 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-dark-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.sheet-meta .confidence {
  font-size: var(--text-xs);
  background: rgba(199,137,62,0.12);
  color: var(--text-dark-secondary);
  padding: 2px var(--space-2);
  border-radius: 10px;
}

.sheet-quote {
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--text-base);
  color: var(--text-dark);
  opacity: 0.8;
  line-height: 1.5;
}

/* Trust badges with SVG icons */
.sheet-trust-icons { display: flex; gap: var(--space-2); padding: 0 var(--space-6) var(--space-3); }
.trust-badge {
  font-size: var(--text-xs);
  font-family: var(--font-ui);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: 12px;
  border: none;
  color: var(--text-dark-secondary);
  background: var(--surface-steam);
  display: flex;
  align-items: center;
  gap: 4px;
}
.trust-badge.curated { background: rgba(200,146,58,0.12); color: #8B6914; }
.trust-badge.google { background: rgba(44,24,16,0.06); color: var(--text-dark-secondary); }
.trust-badge.reddit { background: rgba(139,90,43,0.1); color: #6B4226; }

.sheet-expand-btn {
  display: block;
  width: calc(100% - 48px);
  margin: 0 var(--space-6) var(--space-4);
  padding: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-dark-secondary);
  background: var(--surface-steam);
  border: 1px solid rgba(44,24,16,0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.sheet-expand-btn:hover { background: rgba(199,137,62,0.1); border-color: var(--accent-amber); }

.sheet-details { display: none; padding: 0 var(--space-6) var(--space-6); }
.sheet-details.visible { display: block; }

/* Score breakdown */
.breakdown-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--space-3);
}
.breakdown-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.breakdown-label { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-dark-secondary); width: 80px; flex-shrink: 0; }
.breakdown-bar-track { flex: 1; height: 8px; background: rgba(44,24,16,0.06); border-radius: 4px; overflow: hidden; }
.breakdown-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-copper), var(--accent-amber));
  width: 0%;
  transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.breakdown-value { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; color: var(--text-dark); width: 30px; text-align: right; }

/* Reviews */
.reviews-section { margin-top: var(--space-5); }
.reviews-title { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; color: var(--text-dark); margin-bottom: var(--space-3); }
.review-card {
  background: var(--surface-steam);
  padding: var(--space-4);
  border-radius: 12px;
  margin-bottom: var(--space-3);
  position: relative;
  box-shadow: 0 1px 4px rgba(26,14,10,0.06), 0 2px 12px rgba(26,14,10,0.04);
}
.review-card::before {
  content: '\201C';
  position: absolute;
  top: 4px; left: 10px;
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: rgba(200,146,58,0.2);
  line-height: 1;
  pointer-events: none;
}
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-2); }
.review-author { font-family: var(--font-ui); font-size: var(--text-xs); font-weight: 500; color: var(--text-dark-secondary); display: flex; align-items: center; gap: var(--space-2); }
.review-score { font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); color: var(--accent-amber); }
.review-text { font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; color: var(--text-dark); opacity: 0.85; }

/* Maps link */
.sheet-maps-link {
  display: block;
  width: calc(100% - 48px);
  margin: var(--space-2) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  padding: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--surface-cream);
  background: var(--text-dark);
  border: none; border-radius: 12px;
  cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 2px 8px rgba(26,14,10,0.15);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.sheet-maps-link:hover { background: var(--accent-copper); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(26,14,10,0.25); }

.sheet-close {
  display: none;
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(44,24,16,0.06);
  color: var(--text-dark-secondary);
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}
.sheet-close:hover { background: rgba(44,24,16,0.12); }

/* === Desktop === */
@media (min-width: 768px) {
  #map-container { display: flex; }
  #city-map { flex: 1; }
  .bottom-sheet-overlay { display: none !important; }
  .bottom-sheet {
    position: relative;
    width: 0; min-width: 0; max-height: none;
    border-radius: 0;
    overflow: hidden;
    opacity: 0;
    transition: width 0.35s var(--ease-spring), opacity 0.35s ease, box-shadow 0.35s ease;
    transform: none !important;
  }
  .bottom-sheet.open {
    width: 380px; min-width: 380px;
    border-left: 1px solid rgba(44,24,16,0.08);
    box-shadow:
      -4px 0 24px rgba(26,14,10,0.06),
      -8px 0 48px rgba(26,14,10,0.04),
      -16px 0 64px rgba(26,14,10,0.03);
    overflow-y: auto;
    opacity: 1;
  }
  .sheet-handle { display: none; }
  .sheet-expand-btn { display: none; }
  .sheet-details { display: block; }
  .sheet-close { display: flex; align-items: center; justify-content: center; }
}

/* Score pop animation */
@keyframes scorePop {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.15); }
  75% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

/* Review card stagger-in */
@keyframes reviewSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.sheet-details.visible .review-card {
  animation: reviewSlideIn 0.4s ease both;
  opacity: 0;
}
