/* Shared colours: light mode uses these values by default. */
:root {
  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #536176;
  --heading: #17233b;
  --border: #e2e8f0;
  --muted: #657187;
  --primary: #2563eb;
  --primary-soft: #eaf0ff;
  --shop-bg: #f0f3f9;
  --whatsapp-bg: #e6f7eb;
  --whatsapp-text: #167c3a;
  --shadow: 0 8px 24px rgba(23, 35, 59, 0.06);
}

/* Dark mode changes the shared colours, so all main sections use the same theme. */
body.dark-mode {
  --page-bg: #101827;
  --surface: #182235;
  --surface-soft: #202d42;
  --text: #c6d0df;
  --heading: #f2f5fb;
  --border: #344158;
  --muted: #a4b0c2;
  --primary: #8ab4ff;
  --primary-soft: #243754;
  --shop-bg: #26354b;
  --whatsapp-bg: #173c2a;
  --whatsapp-text: #8be0a7;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Set the page colours and basic text styles. */
* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 1200px;
  min-height: 100vh;
  padding-top: 68px;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  transition: background 0.2s, color 0.2s;
}

h1, h2, h3 {
  color: var(--heading);
  font-family: Georgia, "Times New Roman", serif;
}

p {
  line-height: 1.5;
}

/* Keep the top bar visible while scrolling. */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.left,
.svg,
.menuBar {
  display: flex;
  align-items: center;
}

.left {
  gap: 10px;
}

.left img,
.menuBar img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 12px;
}

nav h1 {
  margin: 0;
  font-size: 21px;
}

.svg {
  gap: 18px;
}

/* The sun appears in dark mode; the moon appears in light mode. */
.light,
.night,
.hamburger,
.cancel {
  width: 26px;
  height: 26px;
  cursor: pointer;
  color: var(--heading);
}

.light {
  display: none;
}

body.dark-mode .light {
  display: block;
}

body.dark-mode .night {
  display: none;
}

.main {
  padding: 12px;
}

main {
  padding: 0 10px 24px;
}

header {
  padding: 14px 4px;
}

header h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 5vw, 38px);
}

header > p {
  margin-top: 0;
  color: var(--muted);
}

/* Search field uses the same theme colours as the rest of the page. */
header input {
  display: block;
  width: 100%;
  margin: 20px 0;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--heading);
  font-size: 16px;
  outline: none;
}

header input:focus,
select:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
}

.recents-title {
  margin: 22px 0 12px;
}

/* Side navigation slides in from the right on small screens. */
.sideNav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  width: min(82%, 340px);
  padding: 10px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 0.25s ease;
}

.sideNav.showSide {
  transform: translateX(0);
}

.menuHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 16px;
  border-bottom: 1px solid var(--border);
}

.menuBar {
  gap: 10px;
}

.trendingCards{
  font-weight: bold;
  font-size: 15px;
  border-bottom: 2px solid var(--border);
  font-style: italic;
  display:flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  cursor:pointer;
}

.menuBar h2 {
  margin: 0;
}

.cancel {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.menu {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 13px 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.menu svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.menu:hover,
.menu.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* A single class hides page sections and other elements when needed. */
.hidden {
  display: none !important;
}

.sec1,
.sec2 {
  padding: 12px 4px;
}

.first1,
.second1,
.three1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.first1 h2,
.second1 h2,
.three1 h2 {
  margin: 0;
}

.first1 svg,
.second1 svg,
.three1 svg {
  flex-shrink: 0;
  color: var(--primary);
}

/* Keep Explore filters easy to use on narrow screens. */
.filtering {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 10px;
}

select {
  min-width: 145px;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

/* Search, Explore, and Saved results stay in a vertical list. */
.searchResults_con,
.explore_con,
.saveCon {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Recent businesses scroll from left to right on small screens. */
.recents {
  display: flex;
  gap: 15px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

/* Every business card is a link to its full details page. */
.business-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

/* Keep recent cards at a fixed width so they can scroll horizontally. */
.recents .business-card {
  flex: 0 0 260px;
  max-width: 82vw;
  scroll-snap-align: start;
}

.business-icon{
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--shop-bg);
  color: var(--primary);
}

.business-card:hover {
  border-color: var(--primary);
}

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

.business-info h3,
.business-info p {
  overflow-wrap: anywhere;
}

.business-name {
  margin: 0 0 5px;
  font-size: 17px;
}

.business-category {
  margin: 0;
  color: var(--primary);
  font-weight: 700;
}

.business-description,
.business-address,
.business-city,
.business-score {
  margin: 0 0 8px;
  line-height: 1.5;
}

.business-address {
  font-size: 13px;
  font-style: italic;
}

.business-city {
  font-weight: 700;
}

.business-score {
  color: var(--muted);
  font-size: 13px;
}

/* Contact and save actions wrap to another line on small screens. */
.business-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.whatsapp-button {
  background: var(--whatsapp-bg);
  color: var(--whatsapp-text);
}

.call-button {
  background: var(--primary-soft);
  color: var(--primary);
}

.save-business {
  background: var(--surface-soft);
  color: var(--primary);
  border: 1px solid var(--border);
}

.save-business[aria-pressed="true"] {
  background: var(--primary-soft);
}

.contact-button[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* Saved page empty state and Clear All button. */
.saved-empty,
.empty-message {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.clear-saved {
  margin: 18px 0 8px;
  padding: 11px 14px;
  border: 1px solid #dc6262;
  border-radius: 10px;
  background: transparent;
  color: #dc6262;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
.menu:focus-visible,
svg:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Adjust card size and spacing for very narrow phones. */
@media (max-width: 420px) {
  .business-card {
    gap: 10px;
    padding: 12px;
  }

  .business-icon {
    width: 48px;
    height: 48px;
  }

  .business-icon svg {
    width: 30px;
    height: 30px;
  }

  .contact-button {
    padding: 8px 9px;
    font-size: 12px;
  }
}

/* Keep Saved and Explore hidden until their navigation item is selected. */
.sec1,
.sec2 {
  display: none;
}

.sec1:not(.hidden),
.sec2:not(.hidden) {
  display: block;
}


/* Business details page. */
.detail-main {
  padding: 20px 14px 32px;
}

.back-home {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.business-detail {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.business-detail h1 {
  margin: 0 0 8px;
}

.detail-category,.detailTitle {
  margin: 0 0 22px;
  color: var(--primary);
  font-weight: 700;
}

.detail-field {
  margin: 0 0 16px;
}

.detail-field strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
}

.detail-field p {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.utility-card{
  display:flex;
  gap:10px;
  margin-top: 10px;
}

.aboutCon{
  border-top:1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  padding:8px;
  margin-bottom: 8px;
}

.locationCon{
  display:flex;
  align-items: center;
  gap:10px;
}

.detail-actions a,
.detail-actions button, .utility-card a, .utility-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width:100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.detail-actions .whatsapp-link {
  background: var(--whatsapp-bg);
  color: var(--whatsapp-text);
}

.detail-message {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}


/* Public business listing button. */
.list-business-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 4px 0 10px;
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.detail-list-button {
  margin: 0 0 18px 10px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

/* Business listing form. */
.submit-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 14px 36px;
}

.submit-panel {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.submit-panel h1 {
  margin: 0 0 8px;
}

.submit-intro {
  margin: 0 0 22px;
  color: var(--muted);
}

.listing-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.listing-form label {
  margin-top: 8px;
  color: var(--heading);
  font-weight: 700;
}

.listing-form input,
.listing-form select,
.listing-form textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--heading);
  font: inherit;
}

.listing-form textarea {
  resize: vertical;
}

.listing-form input:focus,
.listing-form select:focus,
.listing-form textarea:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
}

.submit-business-button {
  min-height: 46px;
  margin-top: 12px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.submit-business-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-message {
  min-height: 20px;
  margin: 4px 0 0;
  color: #c43d3d;
}

.submission-success {
  padding: 24px 8px;
  text-align: center;
}

.submission-success h2 {
  margin-bottom: 8px;
}

.submission-success p {
  margin: 0 auto 18px;
  max-width: 440px;
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--whatsapp-bg);
  color: var(--whatsapp-text);
  font-size: 32px;
  font-weight: 700;
}


/* Loading feedback used by Home, Explore, Saved and Business Details. */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 76px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.loading-spinner,
.button-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: hafiz-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.button-spinner {
  width: 15px;
  height: 15px;
  border-width: 2px;
  border-color: rgba(255,255,255,0.45);
  border-top-color: #ffffff;
  vertical-align: middle;
}

@keyframes hafiz-spin {
  to { transform: rotate(360deg); }
}

.error-message {
  color: #c43d3d;
}

/* Shared footer for all public HAFIZ pages. */
.site-footer {
  margin-top: 36px;
  padding: 28px 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.footer-logo {
  color: var(--heading);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  text-decoration: none;
}

.footer-brand p,
.footer-copy {
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 18px 0;
}

.footer-links a {
  color: var(--primary);
  font-size: 14px;
  text-decoration: none;
}

.footer-links a:hover { text-decoration: underline; }
.footer-copy { margin-bottom: 0; }

/* Simple layout for About, Contact and legal information pages. */
.policy-main {
  max-width: 850px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.policy-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.policy-panel h1 { margin-top: 0; }
.policy-panel h2 { margin-top: 26px; font-size: 20px; }
.policy-panel li { margin-bottom: 9px; line-height: 1.5; }
.policy-note { color: var(--muted); font-size: 13px; }


@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .button-spinner {
    animation-duration: 1.8s;
  }
}


/* Production responsive refinements. */
html {
  width: 100%;
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 1200px;
  overflow-x: hidden;
}

nav {
  width: 100%;
  min-height: 60px;
}

nav .left,
nav .svg {
  min-width: 0;
}

nav .left {
  flex-shrink: 1;
}

nav .svg {
  flex-shrink: 0;
}

main,
.main,
.detail-main,
.submit-main,
.policy-main,
.policy-panel,
.submit-panel,
.business-detail {
  min-width: 0;
}

img,
svg {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.policy-panel,
.submit-panel,
.business-detail {
  overflow-wrap: anywhere;
}

.listing-form input,
.listing-form select,
.listing-form textarea {
  min-height: 44px;
}

.listing-form textarea {
  min-height: 110px;
}

.listing-form button,
.list-business-button,
.detail-actions a,
.detail-actions button,
.clear-saved {
  min-height: 44px;
}

.footer-links a {
  line-height: 1.6;
}

@media (min-width: 700px) {
  .main {
    padding: 20px 24px;
  }

  main {
    padding-right: 20px;
    padding-left: 20px;
  }

  .searchResults_con,
  .explore_con,
  .saveCon {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .business-card {
    min-width: 0;
  }

  .detail-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 24px 40px;
  }

  .submit-main {
    padding-top: 28px;
  }

  .policy-main {
    padding-top: 32px;
  }

  .footer-inner {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 699px) {
  body {
    padding-top: 62px;
  }

  nav {
    padding: 9px 12px;
  }

  nav h1 {
    font-size: 19px;
  }

  .svg {
    gap: 12px;
  }

  .main {
    padding: 10px;
  }

  main {
    padding-right: 8px;
    padding-left: 8px;
  }

  header {
    padding: 12px 2px;
  }

  .detail-main,
  .submit-main,
  .policy-main {
    padding: 18px 12px 30px;
  }

  .business-detail,
  .submit-panel,
  .policy-panel {
    padding: 16px;
  }

  .detail-list-button {
    margin-left: 0;
  }

  .site-footer {
    padding: 22px 14px 16px;
  }

  .footer-links {
    gap: 10px 14px;
  }

  .filtering {
    width: 100%;
  }

  .filtering select {
    flex: 1 1 150px;
  }
}

@media (max-width: 380px) {
  body {
    padding-top: 58px;
  }

  nav {
    padding-right: 9px;
    padding-left: 9px;
  }

  nav h1 {
    font-size: 17px;
  }

  .left {
    gap: 7px;
  }

  .left img {
    width: 34px;
    height: 34px;
  }

  .svg {
    gap: 9px;
  }

  .light,
  .night,
  .hamburger {
    width: 23px;
    height: 23px;
  }

  .business-detail,
  .submit-panel,
  .policy-panel {
    padding: 13px;
  }

  .detail-actions a,
  .detail-actions button {
    flex: 1 1 100%;
  }

  .contact-button {
    flex: 1 1 auto;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Footer WhatsApp contact link. */
.footer-links a[href*="wa.me"] {
  color: var(--whatsapp-text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-links a[href*="wa.me"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 3px;
}
