/* =====================================================
   Store Locator — Stylesheet
   Mobile-first: base styles target phones, then
   media queries enhance the layout for larger screens.
   ===================================================== */

/* ---- 1. Design tokens (edit these to re-theme the whole site) ---- */
:root {
  --color-brand:        #c0392b;   /* primary accent — change to your brand color */
  --color-brand-dark:   #962d22;
  --color-text:         #1f2933;
  --color-text-muted:   #6b7280;
  --color-bg:           #f4f5f7;
  --color-surface:      #ffffff;
  --color-border:       #e5e7eb;

  --radius:   14px;
  --shadow:   0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.18);

  --space:    16px;
  --font:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- 2. Reset & base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---- 3. Header ---- */
.site-header {
  background: var(--color-brand);
  color: #fff;
  padding: calc(var(--space) * 1.5) var(--space);
  text-align: center;
}
.site-header__title    { font-size: 1.5rem; font-weight: 700; }
.site-header__subtitle { font-size: 0.9rem; opacity: 0.9; margin-top: 4px; }

/* ---- 4. Map ---- */
.map-section { padding: var(--space); }

#map {
  width: 100%;
  height: 55vh;            /* fills over half the screen on mobile */
  min-height: 320px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1;              /* keeps map below the modal */
}

/* ---- 5. Store list ---- */
.store-list { padding: 0 var(--space) var(--space); }

.store-list__heading {
  font-size: 1.1rem;
  margin: var(--space) 0;
}

.store-list__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Each store card */
.store-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-card:active { transform: scale(0.98); }
.store-card:hover  { box-shadow: var(--shadow); }

.store-card__branch  { font-size: 1.05rem; font-weight: 600; }
.store-card__address { font-size: 0.9rem; color: var(--color-text-muted); margin-top: 2px; }
.store-card__cta     { font-size: 0.85rem; color: var(--color-brand); font-weight: 600; margin-top: 8px; }

.loading { color: var(--color-text-muted); font-size: 0.9rem; }

/* ---- 6. Modal (store details popup) ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;            /* above everything, including the map */
  display: flex;
  align-items: flex-end;    /* slides up from the bottom on mobile */
  justify-content: center;
}
.modal[hidden] { display: none; }

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal__panel {
  position: relative;
  background: var(--color-surface);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal__close {
  position: absolute;
  top: 10px; right: 12px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

/* Photo gallery — horizontal scroll */
.modal__photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: #000;
}
.modal__photos img {
  height: 220px;
  width: auto;
  flex-shrink: 0;
  scroll-snap-align: center;
  object-fit: cover;
}
.modal__photos:empty { display: none; }

.modal__body { padding: var(--space); }

.modal__name   { font-size: 1.3rem; font-weight: 700; }
.modal__branch { color: var(--color-brand); font-weight: 600; margin-bottom: var(--space); }

/* Detail rows */
.detail-list { list-style: none; }
.detail-list__item {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.detail-list__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.detail-list__value { font-size: 0.95rem; margin-top: 2px; }
.detail-list__link  { color: var(--color-brand); text-decoration: none; }

/* A single contact entry (one phone or one email) */
.contact-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 3px 0;
}
.contact-line__label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.contact-line__link {
  color: var(--color-brand);
  text-decoration: none;
  font-weight: 500;
}

/* Small pill, e.g. the Viber tag next to a number */
.chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
}
.chip--viber { background: #7360f2; }   /* Viber brand purple */

/* Social action buttons (Facebook / Messenger) */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space);
}
.social-links:empty { display: none; }

.btn--social { color: #fff; }
.btn--fb        { background: #1877f2; }   /* Facebook blue */
.btn--messenger { background: #0084ff; }   /* Messenger blue */

/* ---- 7. Buttons ---- */
.btn {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  margin-top: var(--space);
}
.btn--primary {
  background: var(--color-brand);
  color: #fff;
}
.btn--primary:active { background: var(--color-brand-dark); }

/* Navigation buttons — Google Maps + Waze, side by side */
.nav-buttons {
  display: flex;
  gap: 8px;
  margin-top: var(--space);
}
.btn--nav {
  flex: 1;
  color: #fff;
  margin-top: 0;
}
.btn--gmaps { background: #1a73e8; }   /* Google Maps blue */
.btn--waze  { background: #33ccff; }   /* Waze cyan */

/* ---- 8. Footer ---- */
.site-footer {
  text-align: center;
  padding: var(--space);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* =====================================================
   9. RESPONSIVE — tablet & desktop enhancements
   On wider screens, place the map and list side by side.
   ===================================================== */
@media (min-width: 768px) {
  main {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: var(--space);
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
  }
  .map-section { padding-right: 0; }
  #map { height: 70vh; }
  .store-list { padding-left: 0; }
  .store-list__items {
    max-height: 70vh;
    overflow-y: auto;
  }

  /* Modal becomes a centered card instead of a bottom sheet */
  .modal { align-items: center; }
  .modal__panel {
    max-width: 480px;
    border-radius: var(--radius);
  }
}
