/* ==========================================
   BETTER BITE ORLANDO
   HEALTHY RESTAURANT PAGE
========================================== */

/* GENERAL */

/* Global box sizing */

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

:root {
  --green: #416b32;
  --dark-green: #365b2b;
  --light-green: #a8c59e;
  --pale-green: #edf4e9;
  --cream: #fafbf7;
  --text: #252b22;
}

/* Restaurant page layout */

body {
  font-family: var(--bbo-font);
  background-color: var(--bbo-white);
  color: var(--bbo-text-dark);

  min-height: 100vh;

  display: flex;
  flex-direction: column;

  overflow-x: hidden;
}

/* Main content occupies available space */

body > main {
  flex: 1 0 auto;
  width: 100%;
}

/* Shared footer stays below main content */

body > #footer-container {
  flex-shrink: 0;
  width: 100%;
}

/* ==========================================
   HERO SECTION
========================================== */

.hero {
  min-height: 190px;

  display: flex;
  align-items: center;

  padding: 35px max(24px, calc((100% - 1320px) / 2));

  background:
    linear-gradient(
      90deg,
      rgba(225, 241, 248, 0.92),
      rgba(196, 219, 239, 0.75)
    ),
    url("https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=1600")
      center / cover;
}

.hero-content h1 {
  font-family: var(--bbo-font);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  color: var(--bbo-primary);
  margin-bottom: 10px;
}

.hero-content p {
  font-family: var(--bbo-font);
  font-size: 14px;
  color: var(--bbo-text-dark);
  margin: 0;
}

/* ==========================================
   FILTER PANEL
========================================== */

.filter-panel {
  position: relative;
  z-index: 5;

  margin: -25px auto 25px;
  padding: 20px;

  width: calc(100% - 40px);
  max-width: 1320px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;

  background-color: #a6c8a7;
  border-radius: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;

  min-width: 0;
}

.filter-group > label {
  font-family: var(--bbo-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--bbo-primary);
}

.filter-group select,
.filter-group input[type="text"] {
  width: 100%;
  min-height: 42px;

  padding: 8px 12px;

  border: 1px solid #999;
  border-radius: 8px;

  background-color: var(--bbo-white);
  color: var(--bbo-text-dark);

  font-family: var(--bbo-font);
  font-size: 13px;
}

.distance-group {
  flex: 0 0 180px;
}

#distance {
  width: 100%;
}

.dietary-group {
  flex: 1;
}

.diet-options {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.diet-options label {
  background: white;
  border: 1px solid #8da781;
  border-radius: 8px;

  padding: 5px 6px;

  font-size: 13px;
  white-space: nowrap;
  color: #416337;

  cursor: pointer;
}

.diet-options input {
  display: none;
}

.diet-options label:has(input:checked) {
  background-color: var(--bbo-primary);
  color: var(--bbo-white);
}

.location-group {
  flex: 0 1 150px;
}

.cuisine-group {
  flex: 0 1 160px;
}
.location-input {
  position: relative;
  display: flex;
  align-items: center;
}

.location-input span {
  position: absolute;
  left: 5px;
  color: var(--green);
  font-size: 12px;
  z-index: 1;
}

.location-input input,
#cuisine {
  width: 100%;
}

.location-input input {
  padding-left: 19px !important;
}

.search-button {
  min-height: 42px;
  padding: 8px 20px;

  background-color: var(--bbo-primary);
  color: var(--bbo-white);

  border: none;
  border-radius: 8px;

  font-family: var(--bbo-font);
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

.search-button span {
  font-size: 17px;
  margin-left: 3px;
}

.search-button:hover {
  background: #253f1f;
}

/* ==========================================
   RESTAURANT LAYOUT
========================================== */

.restaurant-layout {
  display: grid;

  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);

  gap: 20px;

  width: calc(100% - 40px);
  max-width: 1320px;

  margin: 0 auto 30px;

  align-items: start;
}

.restaurant-column {
  min-width: 0;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.results-heading h2 {
  font-family: var(--bbo-font);
  font-size: 18px;
  font-weight: 700;
  color: var(--bbo-text-dark);
  margin: 0;
}

#resultCount {
  font-size: 13px;
  color: var(--bbo-primary);
}

.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;

  max-height: 600px;
  overflow-y: auto;

  padding: 4px 8px 4px 2px;

  align-content: start;
}

/* ==========================================
   RESTAURANT CARDS
========================================== */

.restaurant-card {
  width: 100%;
  background: white;
  border: 1px solid #c9c9c9;
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s;
  min-width: 0;
}

.restaurant-card:hover,
.restaurant-card.selected {
  border-color: #8ba780;
  box-shadow: 0 2px 7px #00000015;
}

.restaurant-card:hover {
  transform: translateY(-1px);
}

.restaurant-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.card-content {
  padding: 14px;
}

.card-content h3 {
  font-family: var(--bbo-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--bbo-text-dark);
  margin-bottom: 8px;
}

.card-meta {
  font-family: var(--bbo-font);
  font-size: 12px;
  line-height: 1.5;
  color: #666;
}

.card-meta span {
  display: block;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;

  gap: 5px;

  margin: 5px 0;
}

.tag {
  background-color: #dcebd6;
  color: var(--bbo-primary);

  padding: 5px 9px;
  border-radius: 8px;

  font-size: 11px;
  font-weight: 600;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  font-size: 6px;
}

.view-details {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.empty-message {
  padding: 20px;

  background: white;

  text-align: center;
  font-size: 12px;
}

/* ========================================
   Updated Restaurant Cards
======================================== */

.restaurant-card {
  width: 100%;
  min-height: 130px;

  display: block;
  padding: 14px;

  background-color: var(--bbo-white);

  border: 1px solid #d5d5d5;
  border-radius: 14px;

  text-align: left;
  cursor: pointer;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.restaurant-card:hover {
  border-color: var(--bbo-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.restaurant-card.selected {
  border: 2px solid var(--bbo-primary);
  background-color: #f7fbf5;
}

.restaurant-card:focus-visible {
  outline: 3px solid var(--bbo-primary);
  outline-offset: 2px;
}

/* Inner layout */

.restaurant-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Icon */

.restaurant-card-icon {
  width: 65px;
  height: 65px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #e5f2df;
  color: var(--bbo-primary);

  border-radius: 12px;
}

.restaurant-card-icon i {
  font-size: 28px;
}

/* Information */

.restaurant-card-info {
  flex: 1;
  min-width: 0;
}

.restaurant-card-info h3 {
  font-family: var(--bbo-font);
  font-size: 15px;
  font-weight: 700;

  color: var(--bbo-text-dark);
  margin-bottom: 6px;
}

.restaurant-card-info p {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.restaurant-card-address {
  color: #666;
  overflow-wrap: anywhere;
}

.restaurant-card-distance {
  color: var(--bbo-primary);
  font-weight: 600;
}

.restaurant-card-hours {
  color: #777;
}

.restaurant-card-arrow {
  flex-shrink: 0;
  color: var(--bbo-primary);
  font-size: 17px;
}

/* ==========================================
   RESTAURANT DETAILS PANEL
========================================== */

.details-panel {
  background: white;

  border: 1px solid #c9c9c9;
  border-radius: 14px;

  overflow: hidden;

  min-height: 326px;

  position: relative;
}

.detail-image {
  display: block;

  width: 100%;
  height: 109px;

  object-fit: cover;
}

.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 4px 11px 8px;
}

.detail-heading h2 {
  font-family: var(--bbo-font);
  font-size: 22px;
  font-weight: 700;
}

.favorite-button {
  border: none;
  background: transparent;

  color: red;
  font-size: 20px;

  cursor: pointer;
}

.detail-address {
  display: flex;
  align-items: flex-start;

  padding: 0 18px 9px;

  font-family: var(--bbo-font);
  font-size: 13px;
  line-height: 1.5;

  color: #555;
}

.detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;

  padding: 0 15px 12px;
}

.detail-tags .tag {
  font-size: 11px;
}

/* ==========================================
   DETAILS TABS
========================================== */

.detail-tabs {
  display: flex;

  border-top: 1px solid #c9c9c9;
  border-bottom: 1px solid #c9c9c9;
}

.detail-tabs button {
  min-height: 42px;

  flex: 1;
  padding: 5px 2px;

  background: white;
  border: none;

  color: #333;

  font-family: var(--bbo-font);
  font-size: 13px;

  cursor: pointer;
}

.detail-tabs button.active {
  color: #333;
  border-bottom: 1px solid #aaa;
  font-weight: 400;
}

.tab-content {
  min-height: 85px;

  padding: 9px;

  font-family: var(--bbo-font);
  font-size: 13px;
  line-height: 1.6;

  color: #444;
}

.empty-details {
  padding: 30px 15px;

  text-align: center;

  color: #66715f;
  font-size: 11px;
}

/* ==========================================
   FAVORITES
========================================== */

.favorites-section {
  display: none;
}

.favorite-list {
  display: flex;
  gap: 12px;
}

.favorite-item {
  background: white;
  padding: 10px;
  border-radius: 8px;
}

/* ==========================================
   RESTAURANT INTERACTIVE MAP
========================================== */

#restaurant-map {
  display: block;

  width: 100%;
  height: 350px;
  min-height: 350px;

  position: relative;

  border-radius: 12px;
  overflow: hidden;

  z-index: 0;
}

/* Prevent website image styles from resizing Leaflet tiles */

#restaurant-map .leaflet-tile {
  max-width: none !important;
  max-height: none !important;
}

/* Restaurant details panel */

.details-panel {
  display: flex;
  flex-direction: column;

  gap: 16px;

  min-width: 0;
  padding: 12px;
}

/* Restaurant information */

#detailsContent {
  padding: 5px 8px 15px;
}

.restaurant-details-info h2 {
  color: var(--bbo-primary);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.restaurant-details-info p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ==========================================
   RESTAURANT TRANSPORTATION OPTIONS
========================================== */

.restaurant-map-directions,
.restaurant-detail-directions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;

  align-items: center;

  gap: 7px;
  margin-top: 12px;
}

.restaurant-direction-link {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 6px;

  padding: 8px 10px;

  background-color: var(--bbo-primary);
  color: white !important;

  border-radius: 7px;

  font-size: 12px;
  font-weight: 600;

  text-decoration: none !important;
  white-space: nowrap;

  flex-shrink: 0;
}

.restaurant-direction-link:hover {
  background-color: #294d28;
  color: white !important;
}

/* Leaflet popup sizing */

#restaurant-map .leaflet-popup-content-wrapper {
  min-width: 285px;
}

#restaurant-map .leaflet-popup-content {
  min-width: 255px;
}

/* Improve map popup address */

.restaurant-map-address {
  margin: 5px 0 0;
  line-height: 1.5;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */

@media (max-width: 700px) {
  .hero {
    height: 115px;
    padding: 18px;
  }

  .hero-content h1 {
    font-size: 19px;
  }

  .filter-group {
    flex: 1 1 42%;
  }

  .distance-group {
    flex: 1 1 42%;
  }

  .dietary-group {
    flex: 1 1 100%;
  }

  .location-group,
  .cuisine-group {
    flex: 1 1 35%;
  }

  .location-input input {
    width: 100%;
  }

  #cuisine {
    width: 100%;
  }

  .diet-options {
    flex-wrap: wrap;
  }

  .restaurant-layout {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    gap: 20px;
    margin: 0 auto 20px;
    padding: 0;
  }

  .restaurant-grid {
    gap: 12px;
  }

  .restaurant-card img {
    height: 100px;
  }

  .details-panel {
    min-height: auto;
  }

  .detail-image {
    height: 170px;
  }

  #restaurant-map {
    height: 300px;
  }

  .restaurant-direction-link {
    padding: 7px 8px;
    font-size: 11px;
  }

  .restaurant-detail-directions {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .restaurant-grid {
    grid-template-columns: 1fr;
  }

  .diet-options {
    gap: 4px;
  }

  .diet-options label {
    background-color: var(--bbo-white);
    border: 1px solid #8da781;
    border-radius: 8px;

    padding: 9px 12px;

    font-family: var(--bbo-font);
    font-size: 12px;
    font-weight: 500;

    color: var(--bbo-primary);
    white-space: nowrap;
    cursor: pointer;
  }
}

/* ACCESSIBILITY AND HOURS DETAILS */

.accessibility-info,
.hours-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accessibility-info strong,
.hours-info strong {
  font-size: 9px;
}

.accessibility-info p,
.hours-info p {
  font-size: 8px;
  color: #777;
}

/* Restaurant card responsiveness */

@media (max-width: 1100px) {
  .restaurant-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .restaurant-grid {
    max-height: 500px;
  }

  .restaurant-card-icon {
    width: 55px;
    height: 55px;
  }

  .restaurant-card-icon i {
    font-size: 24px;
  }
}
