/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f0f2f5;
  color: #333;
}

header {
  text-align: center;
  padding: 20px 10px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0 0 5px;
  font-size: 28px;
  color: #222;
}

header p {
  margin: 0 0 15px;
  font-size: 16px;
  color: #555;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.filters input[type="text"],
.filters select {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  min-width: 150px;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

/* Business Grid */
.business-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 10px;
}

/* Business Card */
.business-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 250px;
  display: flex;
  flex-direction: column;
}

.business-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.business-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-content {
  padding: 12px 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-content h2 {
  margin: 5px 0 8px;
  font-size: 18px;
  line-height: 1.2;
  color: #222;
}

.card-content .description {
  font-size: 14px;
  color: #555;
  flex-grow: 1;
}

/* Stars */
.stars {
  margin: 5px 0;
}

.stars .star-filled {
  color: #ffd700;
  margin-right: 2px;
}

.stars .star-empty {
  color: #ccc;
  margin-right: 2px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  position: relative;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal .close {
  color: #333;
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  transition: 0.3s;
  z-index: 1001;
}

.modal .close:hover {
  color: #ff4d4d;
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.modal img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 15px;
}

/* Buttons inside modal */
.modal .buttons {
  margin: 10px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal .buttons .btn {
  padding: 8px 12px;
  background: #007bff;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal .buttons .btn.whatsapp {
  background: #25d366;
}

.modal .social-links {
  margin: 10px 0;
  display: flex;
  gap: 10px;
}

.modal .social-links a {
  font-size: 20px;
  color: #333;
  transition: color 0.2s;
}

.modal .social-links a:hover {
  color: #007bff;
}

.modal .directions {
  display: inline-block;
  margin-top: 10px;
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

.modal .directions i {
  margin-right: 5px;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: #007bff;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .brand {
  font-size: 22px;
  font-weight: bold;
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.navbar .nav-links li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar .nav-links li a:hover {
  color: #ffdd57;
}

/* Adjust header and filters spacing */
header {
  text-align: center;
  padding: 15px 10px 25px;
}

.filters {
  justify-content: center;
  margin: 10px auto 20px;
  gap: 10px;
  flex-wrap: wrap;
}

#goTopBtn {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s, transform 0.3s;
}

#goTopBtn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

/* Business Grid */
.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 40px; /* Increased horizontal padding */
  justify-items: center; /* Center cards in grid */
}

/* Business Card */
.business-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%; /* Fill the grid column */
  max-width: 350px; /* Limit max width for better appearance */
  display: flex;
  flex-direction: column;
}

.business-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.business-card img {
  width: 100%;
  height: 200px; /* Slightly taller for bigger card */
  object-fit: cover;
}

.card-content {
  padding: 15px;
}

/* ===== Controls Container ===== */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1000px;
  margin: 20px auto;
  padding: 15px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Row 1: Search Bar + Logo */
.search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-box {
  flex: 1;
  position: relative;
  /* margin-right: 5px; */
}

.search-box input {
  width: 100%;
  padding: 10px 35px 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: gray;
}

/* Row 2: Dropdown Filters */
.filter-row {
  display: flex;
  gap: 15px;
}

.filter-row select {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Row 3: Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

select,
select option {
  font-family: inherit; /* Use same font as body */
  font-size: 14px; /* Match size */
  color: #333; /* Text color */
}

/* Enhanced dropdowns */
select {
  font-family: inherit;
  font-size: 14px;
  color: #333;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  appearance: none; /* Remove default arrow */
  -webkit-appearance: none; /* Safari */
  -moz-appearance: none; /* Firefox */
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
  border-color: #0077cc;
  box-shadow: 0 0 0 3px rgba(0, 119, 204, 0.2);
  outline: none;
}

select:hover {
  border-color: #888;
}

select option {
  font-family: inherit;
  font-size: 14px;
  padding: 8px;
}

/* Header styling */
header {
  text-align: center;
  margin-bottom: 20px;
}

header .tagline {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin: 12px 0 18px 0;
}

/* Filters box */
.filters {
  max-width: 1000px;
  margin: 0 auto;
  padding: 15px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Search row */
.search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 35px 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: gray;
}

.logo img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

/* Dropdown filters */
.filter-row {
  display: flex;
  gap: 15px;
}

.filter-row select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  appearance: none;
}

/* Checkbox centered */
.checkbox-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Navbar Styling */
.navbar {
  background-color: #ffffff; /* White background */
  padding: 12px 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Soft shadow */
  display: flex;
  justify-content: left;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .brand {
  font-size: 20px;
  font-weight: 700;
  color: #2ecc71; /* Light green */
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Business Grid */
.business-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(300px, 1fr)
  ); /* Larger cards */
  gap: 20px;
  padding: 20px;
  justify-content: center;
}

/* Business Card */
.business-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.business-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.business-card img {
  width: 100%;
  height: 220px; /* Bigger images like Instagram posts */
  object-fit: cover;
}

.business-card .card-content {
  padding: 15px;
  font-size: 15px;
  color: #333;
}

.business-card .card-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #2ecc71; /* Green accent for headings */
}

/* ------------------ */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto; /* allow scrolling if content is big */
  background-color: rgba(0, 0, 0, 0.6);
  padding: 20px; /* prevent content touching edges */
}

.modal-content {
  background: #fff;
  margin: auto;
  padding: 20px;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 90vh; /* ensures content fits screen */
  overflow-y: auto; /* scroll inside if too much data */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.close-btn {
  width: 100%;
  padding: 14px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: #27ae60;
}

/* ------------------*/

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

/* prevent page horizontal scrolling caused by modal/content */
body {
  overflow-x: hidden;
}

/* ---------- Modal overlay & centering ---------- */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  padding: 20px; /* space so modal doesn't touch screen edges */
  overflow-y: auto; /* allow vertical scrolling if needed */
  overflow-x: hidden; /* important: prevent horizontal scroll */
}

/* when open, use flex centering for vertical & horizontal centering */
.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Modal content (the card) ---------- */
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 620px; /* controls max width on desktop */
  max-height: 90vh; /* don't exceed viewport height */
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow-y: auto; /* scroll inside modal when content is long */
  overflow-x: hidden; /* prevent horizontal overflow */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ensure images and long text don't cause overflow */
#modalBody img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

#modalBody h2,
#modalBody p,
#modalBody .buttons,
#modalBody .social-links {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* nice visual divider between content and footer */
.modal-footer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #efefef;
  display: flex;
  justify-content: center;
}

/* thumb-friendly Cancel button */
.close-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
.close-btn:active {
  transform: scale(0.99);
}
.close-btn:hover {
  background: #27ae60;
}

/* responsive tweak: on small screens make modal full width with small radius */
@media (max-width: 420px) {
  .modal-content {
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 8px;
    padding: 14px;
    justify-content: flex-start;
  }
  .modal {
    padding: 8px;
  }
}
