/* ═══════════════════════════════════════════════
   Harvey Family App — Restaurants
   Accent: Burgundy #9B2335
   ═══════════════════════════════════════════════ */


/* ── Add button override ── */
.rest-add-btn { background: #9B2335; }
.rest-add-btn:active { background: #7A1C29; }

/* ── View toggle (List ↔ Map) ── */
.rest-view-toggle {
  background: none;
  border: 1.5px solid #9B2335;
  color: #9B2335;
  border-radius: var(--radius-sm);
  padding: .35rem .85rem;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rest-view-toggle:active { background: #F9E6E8; }

/* ── Filter row ── */
.rest-filter-row {
  display: flex;
  gap: 6px;
  padding: .5rem 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.rest-filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  color: var(--muted);
  font-family: inherit;
  font-weight: 500;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.rest-filter-divider {
  width: 0.5px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
  margin: 0 2px;
}
.filter-chip.active {
  background: #F9E6E8;
  border-color: #9B2335;
  color: #9B2335;
  font-weight: 600;
}

/* ── Sort bar ── */
.rest-sort-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 1.25rem .5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.rest-sort-bar::-webkit-scrollbar { display: none; }
.rest-sort-sel {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .3rem .6rem;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  flex-shrink: 0;
}
.rest-sort-divider {
  width: 0.5px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
  margin: 0 2px;
}

/* ── Restaurant cards ── */
.rest-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  margin: 0 1.25rem .65rem;
  padding: .9rem 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s;
}
.rest-card:active { border-color: #C94455; }

.rest-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: .35rem;
}
.rest-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.rest-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Status badges */
.rest-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.rest-badge.rated { background: #F9E6E8; color: #9B2335; }
.rest-badge.want  { background: var(--gray-lt); color: var(--muted); }

/* Ratings on card */
.rest-card-ratings {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: .45rem 0 .3rem;
}
.rest-card-rater {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.rest-card-detail {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
}
.rest-card-address {
  font-size: 11px;
  color: var(--muted);
  margin-top: .3rem;
}
.rest-card-address-link {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-top: .3rem;
  -webkit-tap-highlight-color: transparent;
}
.rest-card-address-link:active { color: #9B2335; }
.rest-card-notes {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: .3rem;
}
.rest-revisit-tag {
  font-size: 10px;
  color: #9B2335;
  font-weight: 600;
}
.rest-overall {
  font-size: 11px;
  font-weight: 700;
  color: #9B2335;
}

/* ── Map view ── */
#rest-map-view { display: flex; flex-direction: column; }
#rest-map {
  flex: 1;
  min-height: 0;
  z-index: 1;
}
.rest-map-legend {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding: .5rem 1rem;
  padding-bottom: max(.65rem, env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border-top: 0.5px solid var(--border);
}
.rest-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.rest-legend-dot.rated { background: #9B2335; }
.rest-legend-dot.want  { background: #fff; border: 2px solid #9B2335; }
.rest-legend-diamond {
  display: inline-block;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.rest-legend-diamond.rated { background: #9B2335; }
.rest-legend-diamond.want  { background: #fff; border: 2px solid #9B2335; }

/* ── Modal internals ── */
.rest-status-toggle {
  display: flex;
  gap: 8px;
}
.rest-status-btn {
  flex: 1;
  padding: .55rem;
  background: var(--gray-lt);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.rest-status-btn.active {
  background: #F9E6E8;
  border-color: #9B2335;
  color: #9B2335;
  font-weight: 600;
}

/* Rater blocks */
.rest-rater-block {
  padding: .85rem 0 .5rem;
}
.rest-rater-divider {
  height: 0.5px;
  background: var(--border);
  margin: .25rem 0;
}
.rest-rater-name {
  font-size: 12px;
  font-weight: 700;
  color: #9B2335;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}
.rest-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: .5rem;
}
.rest-rating-lbl {
  font-size: 13px;
  color: var(--muted);
  width: 48px;
  flex-shrink: 0;
}
.rest-date-input {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .35rem .6rem;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.rest-notes {
  width: 100%;
  background: var(--gray-lt);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  resize: none;
  box-sizing: border-box;
}
.rest-notes:focus { border-color: #9B2335; }

/* ── Next Visit collapsible ── */
.rest-collapse-hdr {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--gray-lt);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.rest-collapse-hdr:active { background: var(--border); }
.rest-next-visit-tag {
  font-size: 11px;
  color: #9B2335;
  font-weight: 600;
  margin-top: .3rem;
}

.rest-save-btn {
  flex: 1;
  background: #9B2335;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .65rem;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.rest-save-btn:active { background: #7A1C29; }

/* ── Name search dropdown ── */
/* type=search removes default webkit cancel button so it matches other inputs */
#ri-search::-webkit-search-cancel-button,
#ri-search::-webkit-search-decoration { -webkit-appearance: none; }

.rest-search-wrap {
  position: relative;
}
.rest-search-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 200;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  max-height: 200px;
  overflow-y: auto;
}
.rest-search-item {
  padding: .55rem .75rem;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border);
  -webkit-tap-highlight-color: transparent;
}
.rest-search-item:last-child { border-bottom: none; }
.rest-search-item:active { background: var(--gray-lt); }
.rest-search-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.rest-search-addr {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* ── Name filter search bar ── */
.rest-name-search-bar {
  padding: 0 1.25rem .5rem;
}
.rest-name-search-inp {
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .35rem .75rem;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.rest-name-search-inp:focus { border-color: #9B2335; }
.rest-name-search-inp::-webkit-search-cancel-button,
.rest-name-search-inp::-webkit-search-decoration { -webkit-appearance: none; }

/* ── Empty state ── */
.rest-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Visit averages ── */
.rest-avg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}
.rest-avg-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rest-avg-count {
  font-size: 11px;
  color: var(--muted);
}
.rest-avg-person {
  margin-bottom: .5rem;
}
.rest-avg-person-name {
  font-size: 11px;
  font-weight: 700;
  color: #9B2335;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .25rem;
}
.rest-avg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.rest-avg-lbl { width: 44px; flex-shrink: 0; }
.rest-avg-score { font-weight: 700; color: #9B2335; min-width: 24px; }

/* Log new visit button */
.rest-log-visit-btn {
  display: block;
  width: 100%;
  margin-top: .75rem;
  padding: .5rem;
  background: none;
  border: 1.5px dashed #9B2335;
  border-radius: var(--radius-sm);
  color: #9B2335;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rest-log-visit-btn:active { background: #F9E6E8; }

/* Visit history */
.rest-history-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  border-top: 0.5px solid var(--border);
  padding: .55rem 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  margin-top: .75rem;
  -webkit-tap-highlight-color: transparent;
}
.rest-history-list {
  display: none;
}
.rest-history-list.open {
  display: block;
}
.rest-visit-item {
  padding: .6rem 0;
  border-bottom: 0.5px solid var(--border);
}
.rest-visit-item:last-child { border-bottom: none; }
.rest-visit-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .35rem;
}
.rest-visit-person {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.rest-visit-notes {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 3px;
}

/* Visit count chip on card */
.rest-visit-count {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Label chips (modal selector + filter row) ── */
.rest-label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .35rem;
  min-height: 28px;
}
.rest-label-chip {
  font-size: 12px;
  font-weight: 500;
  padding: .28rem .65rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.rest-label-chip.active {
  border-color: #9B2335;
  color: #9B2335;
  background: #F9E6E8;
}

/* Label filter row (scrollable, below sort bar) */
.rest-label-filter-row {
  flex-wrap: nowrap;
  gap: .4rem;
  padding: .35rem 1.25rem .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 0.5px solid var(--border);
}
.rest-label-filter-row::-webkit-scrollbar { display: none; }

/* Label badges on cards */
.rest-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .35rem;
}
.rest-card-label {
  font-size: 10px;
  font-weight: 500;
  padding: .1rem .45rem;
  border-radius: 99px;
  border: 0.5px solid var(--border);
  color: var(--muted);
}

/* Meals display in visit history */
.rest-visit-meals {
  font-size: 11px;
  color: var(--text);
  margin-top: .3rem;
  margin-bottom: .25rem;
  line-height: 1.5;
  padding: .3rem .5rem;
  background: var(--gray-lt);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}

/* ── Cuisine / Label manager list ── */
.rest-mgr-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 0.5px solid var(--border);
}
.rest-mgr-item:last-child { border-bottom: none; }
.rest-mgr-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.rest-mgr-item-name:active { color: #9B2335; }
.rest-mgr-del-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.rest-mgr-del-btn:active { color: #9B2335; }
.rest-mgr-new-inp {
  flex: 1;
  background: var(--gray-lt);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.rest-mgr-new-inp:focus { border-color: #9B2335; }
.rest-mgr-edit-inp {
  width: 100%;
  box-sizing: border-box;
  background: var(--gray-lt);
  border: 0.5px solid #9B2335;
  border-radius: 4px;
  padding: .2rem .5rem;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
