:root {
  --bg: #f7f3ee;
  --surface: #ffffff;
  --surface-soft: #fffaf5;
  --text: #231f1b;
  --muted: #74685f;
  --accent: #be123c;
  --accent-dark: #881337;
  --border: #e7ddd2;
  --shadow: 0 16px 36px -24px rgba(70, 37, 22, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Oxygen", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  display: flex;
  overflow: hidden;
}

#sidebar {
  width: min(350px, 35vw);
  min-width: 300px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  box-sizing: border-box;
  border-right: 1px solid rgba(128, 101, 84, 0.22);
  background:
    radial-gradient(circle at 6% 0%, rgba(190, 18, 60, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 252, 249, 0.98), rgba(249, 243, 236, 0.96));
  backdrop-filter: blur(6px);
  z-index: 20;
  overflow: hidden;
}

.sidebar-banner {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(166, 138, 116, 0.22);
  box-shadow: var(--shadow);
}

.search-container {
  width: 100%;
}

#restaurantSearch {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #3b2f2a;
  font-size: 0.9rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#restaurantSearch:focus {
  border-color: rgba(190, 18, 60, 0.42);
  box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.08);
}

.filter-section {
  padding: 12px;
  border: 1px solid rgba(187, 155, 132, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.filter-title {
  display: block;
  margin-bottom: 8px;
  color: #8f1239;
  font-size: 0.82rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 700;
}

.filter-options {
  display: grid;
  gap: 6px;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3f322c;
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-options input[type="radio"] {
  accent-color: var(--accent);
}

.filter-options .icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

#restaurantSection {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(187, 155, 132, 0.28);
  border-radius: 16px;
  padding: 12px;
}

.restaurant-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #7a1428;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(187, 155, 132, 0.28);
}

.restaurant-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

#restaurantList {
  min-height: 0;
  flex: 1;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

#restaurantList::-webkit-scrollbar {
  width: 6px;
}

#restaurantList::-webkit-scrollbar-thumb {
  background: rgba(138, 111, 92, 0.45);
  border-radius: 999px;
}

.restaurant-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid rgba(183, 153, 130, 0.38);
  background: #fff;
  color: #3b322d;
  padding: 9px 12px;
  line-height: 1.2;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.restaurant-pill:hover {
  border-color: rgba(190, 18, 60, 0.42);
  box-shadow: 0 7px 18px -15px rgba(65, 33, 25, 0.9);
  transform: translateY(-1px);
}

.restaurant-pill:active {
  transform: scale(0.985);
}

.restaurant-pill.active,
.restaurant-pill.active-pill {
  background: rgba(190, 18, 60, 0.1);
  border-color: rgba(190, 18, 60, 0.48);
  color: #8b1236;
}

.restaurant-pill.hide {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.pill-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.heart-toggle {
  margin-left: auto;
  font-size: 1rem;
  color: #bab1aa;
  transition: color 0.2s ease;
}

.heart-toggle.active {
  color: var(--accent);
}

#map {
  flex: 1;
  width: 100%;
  height: 100dvh;
  position: relative;
}

.michelin-info-bar {
  position: absolute;
  top: 14px;
  left: calc(min(350px, 35vw) + 18px);
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(195, 167, 145, 0.34);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.michelin-info-bar .info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: fit-content;
}

.michelin-info-bar .info-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.michelin-info-bar .info-text {
  line-height: 1.05;
}

.michelin-info-bar .info-text b {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
}

.michelin-info-bar .info-text span {
  font-size: 0.68rem;
  color: #70655c;
}

#restaurantCard {
  position: fixed;
  top: 86px;
  left: calc(min(350px, 35vw) + 20px);
  width: min(400px, calc(100vw - 42px - min(350px, 35vw)));
  border: 1px solid rgba(195, 167, 145, 0.36);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 26px 42px -30px rgba(43, 23, 16, 0.8);
  overflow: hidden;
  opacity: 0;
  transform: translateX(-28px);
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: 31;
  display: none;
}

#restaurantCard.show {
  opacity: 1;
  transform: translateX(0);
}

#restaurantCard.closing {
  opacity: 0;
  transform: translateX(-18px) scale(0.97);
}

#cardImage {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-bottom: 1px solid rgba(195, 167, 145, 0.26);
}

.card-content {
  padding: 18px;
  font-size: 0.9rem;
  color: #40352f;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title-row h3,
#cardTitle {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.3px;
  color: #261e1a;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.directions-icon,
.card-heart {
  font-size: 1.18rem;
  color: var(--accent);
  cursor: pointer;
}

#cardCategory {
  margin: 9px 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8d1238;
  font-size: 0.86rem;
  font-weight: 700;
}

#cardCategory img,
#cardCategory img.icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

#cardDescription {
  margin-bottom: 12px;
  color: #5f544c;
  line-height: 1.55;
}

.card-content p {
  margin: 7px 0;
}

.close-btn,
#closeCard {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.website-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(190, 18, 60, 0.35);
  background: rgba(190, 18, 60, 0.08);
  color: #95133a;
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.website-pill:hover {
  background: rgba(190, 18, 60, 0.13);
  transform: translateY(-1px);
}

.website-pill a {
  color: inherit;
  text-decoration: none;
}

#visitedWrapper {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(158, 130, 109, 0.55);
  background: rgba(255, 255, 255, 0.94);
  color: #6b5a4d;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#visitedWrapper.show {
  opacity: 1;
  transform: scale(1);
}

#visitedWrapper.visited {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

#cardVisited {
  font-size: 1rem;
}

#visitedLabel {
  font-size: 0.76rem;
  font-weight: 700;
}

.route-label {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(171, 145, 124, 0.38);
  color: #322722;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 18px -14px rgba(20, 13, 10, 0.9);
  white-space: nowrap;
}

.michelin-marker {
  width: 42px;
  height: 42px;
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px -12px rgba(34, 18, 11, 0.85);
  position: relative;
}

.michelin-marker::after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--accent);
}

.michelin-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.gm-style .gm-style-iw,
.gm-style img,
.gm-style svg {
  position: relative;
  z-index: 9999 !important;
}

.oxygen-light {
  font-family: "Oxygen", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.oxygen-regular {
  font-family: "Oxygen", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.oxygen-bold {
  font-family: "Oxygen", sans-serif;
  font-weight: 700;
  font-style: normal;
}

@keyframes pulseAnim {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.8;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.7);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }
}

@media (max-width: 1200px) {
  #sidebar {
    width: 320px;
    min-width: 280px;
  }

  .michelin-info-bar {
    left: calc(320px + 14px);
  }

  #restaurantCard {
    left: calc(320px + 14px);
    width: min(380px, calc(100vw - 348px));
  }
}

@media (max-width: 960px) {
  body {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    min-width: 0;
    height: min(52dvh, 470px);
    border-right: none;
    border-bottom: 1px solid rgba(128, 101, 84, 0.2);
  }

  #map {
    height: calc(100dvh - min(52dvh, 470px));
  }

  .michelin-info-bar {
    left: 12px;
    right: 12px;
    top: calc(min(52dvh, 470px) + 8px);
    position: fixed;
  }

  #restaurantCard {
    left: 12px;
    right: 12px;
    width: auto;
    top: calc(min(52dvh, 470px) + 64px);
    max-height: calc(100dvh - min(52dvh, 470px) - 76px);
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  #sidebar {
    height: min(56dvh, 520px);
    padding: 10px;
  }

  #restaurantSection,
  .filter-section {
    padding: 10px;
  }

  .restaurant-pill {
    font-size: 0.8rem;
    padding: 8px 11px;
  }

  #cardImage {
    height: 172px;
  }

  .card-content {
    padding: 14px;
  }

  .card-title-row h3,
  #cardTitle {
    font-size: 1.28rem;
  }

  .michelin-info-bar {
    top: calc(min(56dvh, 520px) + 6px);
    padding: 8px 10px;
    gap: 10px;
  }

  #restaurantCard {
    top: calc(min(56dvh, 520px) + 56px);
  }
}
