/* =========================================================
   Branch Locator CSS
   Romm Coffee — "Şubeler" panel opened from the navbar.

   The trigger lives in the navbar (next to Franchise). On desktop
   the panel drops down from the top-right, under the header; on
   phones it becomes a bottom sheet with a backdrop. Also styles
   the bottom-right floating "Bize Ulaş" CTA.

   Works with:
   - Pages/Shared/_BranchLocator.cshtml
   - Pages/Shared/_PublicNavbar.cshtml  ([data-branch-toggle])
   - wwwroot/js/branch-locator.js
========================================================= */

.branch-locator {
  position: relative;
  z-index: 1000;
}

/* Navbar "Şubeler" trigger is a <button> styled as a nav item.
   Reset only the button chrome + font-family/size; let
   .navbar-link-custom / .mobile-nav-link supply weight & colour
   (a `font: inherit` shorthand would wipe the 600 weight → thin). */
button.navbar-link-custom,
button.mobile-nav-link {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

button.mobile-nav-link {
  width: 100%;
  text-align: left;
}

/* ---------- Panel ---------- */

.branch-locator-panel {
  position: fixed;
  top: clamp(4.75rem, 9vh, 5.75rem);
  right: clamp(0.9rem, 3vw, 1.5rem);
  z-index: 1001;

  width: min(23rem, calc(100vw - 1.8rem));
  max-height: min(72vh, 34rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e4e7ec);
  border-radius: var(--radius-lg, 1rem);
  box-shadow: 0 24px 60px rgba(5, 26, 30, 0.28);

  transform-origin: top right;
  animation: branch-pop 0.2s ease;
}

.branch-locator-panel[hidden] {
  display: none;
}

@keyframes branch-pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.branch-locator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
  border-bottom: 1px solid var(--color-border, #e4e7ec);
  background: var(--color-surface-soft, #eaf1f1);
}

.branch-locator-eyebrow {
  display: block;
  font-size: var(--text-xs, 0.72rem);
  font-weight: var(--weight-bold, 700);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary-dark, #3f7b7e);
}

.branch-locator-count {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-heading);
  font-size: var(--text-md, 1.05rem);
  color: var(--color-text, #12292d);
}

.branch-locator-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-text-muted, #5f7a7d);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.branch-locator-close:hover,
.branch-locator-close:focus-visible {
  background: rgb(5 26 30 / 8%);
  color: var(--color-text, #12292d);
}

/* ---------- List ---------- */

.branch-locator-list {
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.branch-locator-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "city city"
    "name link"
    "address link";
  gap: 0.1rem 0.75rem;
  padding: var(--space-3, 0.85rem) var(--space-5, 1.25rem);
}

.branch-locator-item + .branch-locator-item {
  border-top: 1px solid
    color-mix(in srgb, var(--color-border, #e4e7ec) 60%, transparent);
}

.branch-locator-city {
  grid-area: city;
  font-size: var(--text-xs, 0.72rem);
  font-weight: var(--weight-bold, 700);
  letter-spacing: 0.08em;
  color: var(--color-secondary-dark, #3f7b7e);
}

.branch-locator-name {
  grid-area: name;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text, #12292d);
}

.branch-locator-address {
  grid-area: address;
  font-size: var(--text-sm, 0.85rem);
  line-height: var(--line-normal, 1.5);
  color: var(--color-text-muted, #5f7a7d);
}

.branch-locator-link {
  grid-area: link;
  align-self: center;
  white-space: nowrap;
  font-size: var(--text-sm, 0.85rem);
  font-weight: var(--weight-semibold, 600);
  color: var(--color-primary, #06515d);
  text-decoration: none;
}

.branch-locator-link:hover {
  text-decoration: underline;
}

/* ---------- Footer link ---------- */

.branch-locator-all {
  display: block;
  padding: var(--space-3, 0.85rem) var(--space-5, 1.25rem);
  border-top: 1px solid var(--color-border, #e4e7ec);
  background: var(--color-surface-soft, #eaf1f1);
  text-align: center;
  font-size: var(--text-sm, 0.85rem);
  font-weight: var(--weight-semibold, 600);
  color: var(--color-primary, #06515d);
  text-decoration: none;
}

.branch-locator-all:hover {
  text-decoration: underline;
}

/* ---------- Backdrop (mobile only) ---------- */

.branch-locator-backdrop {
  display: none;
}

/* ---------- Mobile: bottom sheet ---------- */

@media (max-width: 560px) {
  .branch-locator-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgb(5 26 30 / 45%);
  }

  .branch-locator-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg, 1rem) var(--radius-lg, 1rem) 0 0;
    transform-origin: bottom center;
    animation: branch-sheet 0.25s ease;
  }

  @keyframes branch-sheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
}

/* =========================================================
   Floating "Bize Ulaş" CTA (bottom-right, every page)
========================================================= */

.floating-cta {
  position: fixed;
  right: clamp(0.9rem, 3vw, 1.5rem);
  bottom: clamp(0.9rem, 3vw, 1.5rem);
  z-index: 840;

  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;

  font-family: var(--font-body);
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--weight-semibold, 600);
  color: #fff;
  background: var(--color-primary, #06515d);
  box-shadow: 0 8px 24px rgba(5, 26, 30, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-cta:hover,
.floating-cta:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  background: var(--color-primary-dark, #05323a);
  box-shadow: 0 12px 30px rgba(5, 26, 30, 0.34);
}

.floating-cta-icon {
  font-size: 1.05em;
  line-height: 1;
}

/* WhatsApp — .floating-cta'nın hemen üstünde istiflenir.
   Numara /Admin/Settings'te boşsa markup hiç basılmaz. */
.floating-whatsapp {
  position: fixed;
  right: clamp(0.9rem, 3vw, 1.5rem);
  /* CTA yüksekliği (~2.9rem) + boşluk kadar yukarıda dursun. */
  bottom: calc(clamp(0.9rem, 3vw, 1.5rem) + 3.6rem);
  z-index: 840;

  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;

  color: #fff;
  background: #25d366; /* WhatsApp marka yeşili */
  box-shadow: 0 8px 24px rgba(5, 26, 30, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-whatsapp:hover,
.floating-whatsapp:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  background: #1da851;
  box-shadow: 0 12px 30px rgba(5, 26, 30, 0.34);
}

.floating-whatsapp svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .branch-locator-panel { animation: none; }
  .floating-cta,
  .floating-whatsapp { transition: none; }
}
