/* ============================================================
   O2PRO STOCKIST LOCATOR — BRAND DESIGN SYSTEM
   Colors: Orange #F0A500 | Black #111111 | White #FFFFFF | Gray #F4F4F4
   Font: Inter
   ============================================================ */

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

:root {
  --orange: #F0A500;
  --orange-dark: #D99200;
  --orange-light: #FFF4D6;
  --black: #111111;
  --black-deep: #0A0A0A;
  --white: #FFFFFF;
  --gray-50: #F7F7F7;
  --gray-100: #F0F0F0;
  --gray-200: #E0E0E0;
  --gray-400: #9A9A9A;
  --gray-600: #555555;
  --gray-800: #2A2A2A;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 100px;
  --transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --panel-w: 420px;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TOP NAV BAR
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 100;
  gap: 0;
}

.nav-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--black);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.nav-logo .o2 {
  color: var(--orange);
}

.nav-logo .pro {
  color: var(--black);
}

.nav-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
  margin-right: auto;
}

.nav-back {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  transition: color var(--transition);
}

.nav-back:hover { color: var(--black); }

/* ============================================================
   APP SHELL — SPLIT SCREEN
   ============================================================ */
.app {
  display: flex;
  height: 100vh;
  padding-top: 60px;
}

/* ============================================================
   LEFT PANEL — LIST
   ============================================================ */
.panel-wrap {
  position: relative;
  width: var(--panel-w);
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--gray-200);
}

/* List panel */
.panel-list {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--white);
}

.panel-list.slide-out {
  transform: translateX(-100%);
}

/* Search section */
.search-section {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.search-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.search-input-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  transition: color var(--transition);
}

.search-input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-pill);
  padding: 0 16px 0 42px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--black);
  background: var(--gray-50);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--gray-400); }

.search-input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.12);
}

.search-input:focus + .search-input-wrap svg,
.search-input-wrap:focus-within svg {
  color: var(--orange);
}

.location-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  padding: 4px 0;
  transition: color var(--transition);
}

.location-btn:hover { color: var(--orange); }

.location-btn svg { flex-shrink: 0; }

.location-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-block;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* Results meta */
.results-meta {
  padding: 14px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.results-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.results-count span { color: var(--black); }

.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition);
}
.show-more-btn:hover { color: var(--orange-dark); }

/* Stockist list */
.stockist-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px 24px;
  scrollbar-width: none;
}
.stockist-list::-webkit-scrollbar { display: none; }

/* Stockist card */
.stockist-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-bottom: 6px;
  position: relative;
}

.stockist-card:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.stockist-card.active {
  background: var(--orange-light);
  border-color: var(--orange);
}

.card-pin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.stockist-card.active .card-pin,
.stockist-card:hover .card-pin {
  background: var(--orange);
}

.stockist-card.active .card-pin svg,
.stockist-card:hover .card-pin svg {
  color: var(--white);
}

.card-pin svg { color: var(--gray-600); transition: color var(--transition); }

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

.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-location {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-600);
  margin-bottom: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.card-distance {
  font-size: 11px;
  font-weight: 600;
  color: var(--orange);
  background: var(--orange-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.card-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
}

.card-chevron {
  color: var(--gray-400);
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
}

.stockist-card:hover .card-chevron,
.stockist-card.active .card-chevron {
  color: var(--orange);
  transform: translateX(2px);
}

/* ============================================================
   DETAIL PANEL — slide in from left
   ============================================================ */
.panel-detail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--white);
  z-index: 10;
}

.panel-detail.slide-in {
  transform: translateX(0);
}

.detail-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  padding: 0;
  transition: color var(--transition);
  margin-bottom: 20px;
}

.back-btn:hover { color: var(--orange); }

.detail-store-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.detail-store-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0 24px 24px;
}

.detail-body::-webkit-scrollbar { display: none; }

.detail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-100);
}

.detail-section:last-of-type { border-bottom: none; }

.detail-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--black);
  line-height: 1.5;
  margin-bottom: 6px;
}

.detail-row:last-child { margin-bottom: 0; }

.detail-row svg { color: var(--orange); flex-shrink: 0; margin-top: 2px; }

.detail-link {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition);
}
.detail-link:hover { opacity: 0.75; }

/* Hours list */
.hours-list {
  width: 100%;
}

.hours-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 13px;
}

.hours-row:last-child {
  border-bottom: none;
}

.hours-day {
  color: var(--gray-600);
  font-weight: 500;
  width: 50px;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}

.hours-time {
  color: var(--black);
  font-weight: 400;
  text-align: right;
  font-family: 'Inter', sans-serif;
}

.hours-row.today .hours-day  { color: var(--orange); font-weight: 700; }
.hours-row.today .hours-time { color: var(--black);  font-weight: 700; }

.hours-closed { color: var(--gray-400) !important; }

/* CTA */
.detail-cta {
  padding: 20px 24px;
  flex-shrink: 0;
  border-top: 1px solid var(--gray-100);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  background: var(--orange);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(240, 165, 0, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ============================================================
   RIGHT PANEL — MAP
   ============================================================ */
.map-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #E8E8E3;
}

/* Map pins */
.map-pins {
  position: absolute;
  inset: 0;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}

.map-pin:hover { transform: translate(-50%, -100%) scale(1.15); }

.map-pin.active { transform: translate(-50%, -100%) scale(1.2); z-index: 10; }

.pin-svg {
  display: block;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.2));
  transition: filter var(--transition);
}

.map-pin.active .pin-svg {
  filter: drop-shadow(0 4px 12px rgba(240,165,0,0.5));
}

/* Pulse ring */
.pin-pulse {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  opacity: 0;
  pointer-events: none;
}

.map-pin.active .pin-pulse {
  animation: pin-pulse 1.4s ease-out infinite;
}

@keyframes pin-pulse {
  0% { transform: translate(-50%, -58%) scale(0.6); opacity: 0.8; }
  100% { transform: translate(-50%, -58%) scale(2.2); opacity: 0; }
}

/* Pin label */
.pin-label {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--black);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.pin-label::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--black);
  border-bottom: 0;
}

.map-pin:hover .pin-label,
.map-pin.active .pin-label {
  opacity: 1;
}

/* No results */
.no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: var(--gray-400);
}

.no-results.visible { display: flex; }

.no-results svg { color: var(--gray-200); margin-bottom: 12px; }

.no-results p {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--gray-600);
}

.no-results small {
  font-size: 12px;
  color: var(--gray-400);
}

/* ============================================================
   MOBILE LAYOUT
   ============================================================ */
@media (max-width: 768px) {
  /* Allow vertical scrolling so the list doesn't trap content off-screen */
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav { display: none; }

  /* Vertical stack — list on top, map below */
  .app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding-top: 0;
  }

  /* Map below the list */
  .map-panel {
    height: 60vh;
    flex: none;
    width: 100%;
  }

  /* Panel wrap: full width, auto height — body scroll handles overflow */
  .panel-wrap {
    width: 100%;
    flex: none;
    height: auto;
    overflow: visible;
    border-right: none;
    border-top: 1px solid var(--gray-200);
  }

  /* Panel list: in normal document flow (not absolutely positioned) */
  .panel-list {
    position: relative;
    height: auto;
    inset: auto;
    overflow: visible;
  }

  /* Stockist list: natural height, body scroll handles it */
  .stockist-list {
    overflow-y: visible;
    height: auto;
    max-height: none;
    padding: 0 12px 24px;
  }

  /* Detail panel slides up as a bottom sheet */
  .panel-detail {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 75vh;
    top: auto;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    overflow-y: auto;
  }

  .panel-detail.slide-in {
    transform: translateY(0);
  }

  /* Handle bar on detail sheet */
  .detail-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  /* Show the location FAB over the map */
  .location-fab {
    display: flex !important;
  }

  /* No slide-out on mobile — detail overlays instead */
  .panel-list.slide-out {
    transform: none;
  }

  .search-section {
    padding: 16px 16px 12px;
  }

  .results-meta {
    padding: 10px 16px 8px;
  }
}

/* Location FAB (mobile only) */
.location-fab {
  display: none;
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--white);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background var(--transition), transform var(--transition);
}

.location-fab:hover { background: var(--orange); }
.location-fab:hover svg { color: var(--white); }
.location-fab svg { color: var(--gray-600); transition: color var(--transition); }

/* ============================================================
   OVERLAY (mobile map tap dismiss)
   ============================================================ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 150;
}

.overlay.visible { display: block; }

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* ============================================================
   NO NAV — remove the 60px top padding that was reserved for it
   ============================================================ */
.app {
  padding-top: 0 !important;
}

/* ============================================================
   WORDPRESS ADMIN BAR OFFSET
   Nav is removed; only the app itself needs to clear the bar.
   ============================================================ */
body.admin-bar .app {
  padding-top: 32px !important;
}

@media screen and (max-width: 782px) {
  /* WP admin bar is 46px on mobile */
  body.admin-bar .app {
    padding-top: 46px !important;
  }
}

/* ============================================================
   WORDPRESS THEME OVERRIDES
   Prevent the active theme from bleeding into the locator UI.
   ============================================================ */

/* Typography reset inside the app */
.nav, .app {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--black);
}

.app p, .app span, .app small,
.nav p, .nav span {
  margin: 0;
  padding: 0;
  line-height: inherit;
  color: inherit;
}

.app h1, .app h2, .app h3, .app h4 {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  border: none;
  background: none;
}

/* Links */
.app a,
.app a:visited,
.app a:hover,
.app a:focus,
.nav a,
.nav a:visited {
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  box-shadow: none;
}

.detail-link,
.detail-link:visited { color: var(--orange) !important; }
.nav-logo,
.nav-logo:visited    { color: var(--black) !important; }
.nav-logo .o2        { color: var(--orange) !important; }

/* Inputs — full override so themes cannot break the pill shape or indent */
.search-input {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  line-height: 1 !important;
  padding: 0 16px 0 42px !important;
  border-radius: 100px !important;
  border: 1.5px solid var(--gray-200) !important;
  background: var(--gray-50) !important;
  color: var(--black) !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
}
.search-input:focus {
  border-color: var(--orange) !important;
  background: var(--white) !important;
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.12) !important;
  outline: none !important;
}

/* show-more-btn is a <div> — override so themes can't style it as a button */
.show-more-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--orange) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  outline: none !important;
  white-space: nowrap !important;
}
.show-more-btn:hover { color: var(--orange-dark) !important; }

/* Buttons & location div */
.location-btn {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--gray-600) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  outline: none !important;
  width: auto !important;
}
.location-btn:hover { color: var(--orange) !important; }

/* back-btn is a <div> — full override so themes never apply button resets to it */
.back-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 20px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--gray-600) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  outline: none !important;
  width: auto !important;
  text-transform: none !important;
  letter-spacing: inherit !important;
  transition: color var(--transition) !important;
}
.back-btn:hover { color: var(--orange) !important; }

.btn-primary,
.location-fab {
  font-family: 'Inter', sans-serif !important;
  text-transform: none !important;
  letter-spacing: inherit !important;
}

.btn-primary,
.btn-primary:visited,
.btn-primary:hover {
  color: var(--white) !important;
  text-decoration: none !important;
}

/* Cards */
.stockist-card {
  list-style: none;
}

/* SVG inside buttons/cards — themes sometimes colour these */
.card-pin svg,
.back-btn svg,
.location-btn svg,
.nav-back svg {
  fill: unset;
  stroke: unset;
}
