:root {
  --primary: #0f172a;
  --accent: #d97706;
  --whatsapp: #25d366;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --card-bg: #ffffff;
  --border: #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* Responsive Header */
header {
  background: rgba(15, 23, 42, 0.98);
  color: #fff;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-logo span {
  color: var(--accent);
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #fff;
}

.btn-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2rem 0 1.25rem 0;
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.6rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: #64748b;
  font-size: 0.92rem;
  max-width: 480px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.45;
}

/* Responsive Search Bar */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.search-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  font-size: 0.95rem;
  border-radius: 8px;
}

/* Card Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

.card-body {
  padding: 1.25rem;
}

.badge {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Your Brand Orange Color for all standard buttons & actions */
.btn-brand,
.btn-action,
button[type="submit"] {
  background-color: var(--accent) !important; /* #d97706 */
  color: #ffffff !important;
  border: none !important;
  text-align: center;
  display: block;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 1rem;
  transition: background 0.2s;
}

.btn-brand:hover,
.btn-action:hover,
button[type="submit"]:hover {
  background-color: #b45309 !important; /* Darker orange on hover */
}

/* WhatsApp Green (Strictly for WhatsApp buttons only) */
.btn-whatsapp {
  background-color: var(--whatsapp) !important; /* #25d366 */
  color: #fff !important;
  text-align: center;
  display: block;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 1rem;
}

footer {
  margin-top: auto;
  background: var(--primary);
  color: #94a3b8;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
}

/* Desktop Breakpoint Enhancements */
@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .brand-logo {
    font-size: 1.5rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.95rem;
  }

  .btn-cta {
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem !important;
  }

  .hero-section {
    padding: 3.5rem 0 2.5rem 0;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .search-form {
    flex-direction: row;
  }

  .search-btn {
    width: auto;
    padding: 0.75rem 1.5rem;
  }
}

/* Subtitle single-line formatting & accent color */
.accent-text {
  color: var(--accent);
  font-weight: 600;
}

.hero-subtitle.single-line {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 639px) {
  .hero-subtitle.single-line {
    font-size: 0.75rem !important;
  }
}

/* Subtitle orange styling */
.hero-subtitle.orange-subtitle {
  color: #d97706 !important;
  font-weight: 500;
}

.hero-subtitle.orange-subtitle b {
  font-weight: 800;
}

/* Subtitle black text with single orange bold word */
.hero-subtitle.single-line {
  color: #1e293b !important;
}

.highlight-orange {
  color: #d97706 !important;
  font-weight: 800 !important;
}

/* Offset text inside search input/select to prevent overlap with the absolute icon */
#searchInput, 
select#searchInput {
  padding-left: 2.5rem !important;
}

/* Search Hero Box & Horizontal Form Layout */
.search-hero-box {
  position: relative !important;
  width: 90% !important;
  max-width: 850px !important;
  margin: 2rem auto !important;
  padding: 1rem 1.25rem !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
}

.search-single-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
}

.input-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.search-what-wrapper { flex: 2 1 260px !important; }
.search-where-wrapper { flex: 2 1 220px !important; }
.search-radius-wrapper { flex: 1 1 120px !important; }

.search-select-field,
.search-input-field {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 48px !important;
  padding: 0 12px 0 38px !important;
  background-color: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  color: #0f172a !important;
  font-size: 0.95rem !important;
  outline: none !important;
}

select.search-select-field {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px !important;
  padding-right: 32px !important;
}

.input-wrapper .input-icon {
  position: absolute !important;
  left: 12px !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

.search-where-wrapper .locate-btn {
  position: absolute !important;
  right: 6px !important;
  padding: 4px 8px !important;
  background-color: #e2e8f0 !important;
  border: none !important;
  border-radius: 6px !important;
  color: #d97706 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  cursor: pointer !important;
}

/* Force single row horizontal alignment for all 3 search inputs */
.search-single-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

/* Ensure wrappers don't wrap internally or take 100% block width */
.search-hero-box form,
.search-hero-box .search-single-row > div {
  margin: 0 !important;
}

.search-what-wrapper {
  flex: 2 1 40% !important;
  width: auto !important;
}

.search-where-wrapper {
  flex: 2 1 35% !important;
  width: auto !important;
}

.search-radius-wrapper {
  flex: 1 1 25% !important;
  width: auto !important;
}

/* Force 3-column single row layout */
.search-hero-box {
  position: relative !important;
  width: 90% !important;
  max-width: 900px !important;
  margin: 2rem auto !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
}

form.search-single-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
}

.search-single-row > .input-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
}

.search-what-wrapper { flex: 2 1 35% !important; }
.search-where-wrapper { flex: 2 1 35% !important; }
.search-radius-wrapper { flex: 1 1 25% !important; }

.search-select-field,
.search-input-field {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 48px !important;
  padding: 0 12px 0 38px !important;
  background-color: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  color: #0f172a !important;
  font-size: 0.95rem !important;
  outline: none !important;
}

select.search-select-field {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px !important;
  padding-right: 32px !important;
}

.input-wrapper .input-icon {
  position: absolute !important;
  left: 12px !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

.search-where-wrapper .locate-btn {
  position: absolute !important;
  right: 6px !important;
  padding: 4px 8px !important;
  background-color: #e2e8f0 !important;
  border: none !important;
  border-radius: 6px !important;
  color: #d97706 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  cursor: pointer !important;
}

/* Mobile responsive layout for search bar */
@media screen and (max-width: 768px) {
  .search-hero-box {
    width: 92% !important;
    padding: 12px !important;
    margin: 1rem auto !important;
  }

  form.search-single-row {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* Category dropdown takes full width on top */
  .search-what-wrapper {
    flex: 1 0 100% !important;
    width: 100% !important;
  }

  /* City and distance sit side-by-side underneath */
  .search-where-wrapper {
    flex: 1 1 calc(60% - 5px) !important;
    width: auto !important;
  }

  .search-radius-wrapper {
    flex: 1 1 calc(40% - 5px) !important;
    width: auto !important;
  }

  .search-select-field,
  .search-input-field {
    height: 44px !important;
    font-size: 0.88rem !important;
  }
}

.city-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.city-autocomplete-dropdown.hidden {
  display: none !important;
}

.city-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.city-item:last-child {
  border-bottom: none;
}

.city-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Fix mobile search bar layout & text clipping */
.search-radius-wrapper select,
.search-select-field {
  padding-right: 28px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .search-single-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .input-wrapper {
    width: 100% !important;
    min-width: 100% !important;
  }

  .search-radius-wrapper select {
    font-size: 0.95rem !important;
    padding-left: 14px !important;
  }
}

/* Keep Location & Radius side-by-side on mobile without clipping */
@media (max-width: 640px) {
  .search-secondary-row,
  .search-location-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
  }

  /* Give input 58% and radius dropdown 42% of available width */
  .search-location-group > *:first-child {
    flex: 1.3 1 0% !important;
    min-width: 0 !important;
  }

  .search-radius-wrapper {
    flex: 1 1 0% !important;
    min-width: 0 !important;
  }

  /* Compact padding so text & arrow fit easily */
  .search-radius-wrapper select,
  .search-location-group input {
    font-size: 0.85rem !important;
    padding-left: 10px !important;
    padding-right: 22px !important;
  }
}

/* Left-align radius dropdown text and fix padding clipping */
#radiusSelect,
.search-radius-wrapper select {
  text-align: left !important;
  text-align-last: left !important; /* Forces iOS Safari to left-align select options */
  padding-left: 12px !important;
  padding-right: 24px !important;
}

@media (max-width: 640px) {
  #radiusSelect,
  .search-radius-wrapper select {
    font-size: 0.85rem !important;
    padding-left: 8px !important;
    padding-right: 20px !important;
  }
}

/* Force location and radius side-by-side on a single row without wrapping */
.search-location-group,
.search-row-split,
div:has(> #locationInput) {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  width: 100% !important;
  gap: 8px !important;
}

/* Ensure child elements take appropriate widths without wrapping */
.search-location-group > input,
#locationInput,
.location-field {
  flex: 1 1 55% !important;
  min-width: 0 !important;
  width: 55% !important;
}

.search-location-group > select,
#radiusSelect,
.radius-field {
  flex: 1 1 45% !important;
  min-width: 0 !important;
  width: 45% !important;
  white-space: nowrap !important;
  text-align: left !important;
  text-align-last: left !important;
}

@media (max-width: 640px) {
  #locationInput,
  #radiusSelect {
    font-size: 0.82rem !important;
    padding-left: 8px !important;
    padding-right: 18px !important;
    height: 42px !important;
  }
}

/* Grouping container */
.search-form-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
}

/* Force Row 2 to stay horizontal on ALL screens */
.search-row-inline {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.search-row-inline .search-where-wrapper {
  flex: 1.3 1 0% !important;
  min-width: 0 !important;
  position: relative !important;
}

.search-row-inline .search-radius-wrapper {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

/* Fix icon overlapping Sunderland text */
.search-where-wrapper .input-icon {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

.search-where-wrapper input#locationInput {
  padding-left: 38px !important; /* Move text past the pin icon */
  padding-right: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Format radius select text */
.search-radius-wrapper select#radiusSelect {
  padding-left: 10px !important;
  padding-right: 20px !important;
  text-align: left !important;
  text-align-last: left !important;
  white-space: nowrap !important;
}
