/*
 * Store Locations Popover
 * Replacement for the Zebra_Tooltip plugin tooltip.
 */

/* ── Trigger button in header ── */
.mh-stores-trigger-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 1rem;
}

.mh-stores-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #444;
  background: transparent;
  border: none;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 0;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.mh-stores-trigger:hover,
.mh-stores-trigger:focus,
.mh-stores-trigger[aria-expanded="true"] {
  color: #000 !important;
  background: transparent !important;
  outline: none;
  box-shadow: none !important;
}

.mh-stores-trigger__icon {
  flex-shrink: 0;
  color: currentColor;
}

/* ── Popover container ── */
.mh-stores-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  width: min(380px, calc(100vw - 2rem));
  margin-top: 8px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mh-stores-popover[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mh-stores-popover[hidden] {
  display: none;
}

.mh-stores-popover__inner {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  font-family: inherit;
  color: #1a1a1a;
  text-align: left;
}

/* Force left alignment on all popover text (parent .widget sets center). */
.mh-stores-popover,
.mh-stores-popover * {
  text-align: left;
}
/* Hours values (right column of dl grid) stay right-aligned. */
.mh-store__hours dd {
  text-align: right !important;
}

/* ── Header ── */
.mh-stores-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.mh-stores-popover__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1a1a1a;
}

.mh-stores-popover__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
  margin: -4px;
  transition: color 0.15s ease;
}

.mh-stores-popover__close:hover {
  color: #1a1a1a;
}

/* ── Store list ── */
.mh-stores-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mh-store {
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f0;
}

.mh-store:last-child {
  border-bottom: none;
}

.mh-store__name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1a1a1a;
}

.mh-store__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.15s ease;
}

.mh-store__phone:hover {
  color: #cc0000;
}

.mh-store__hours {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  font-size: 0.8125rem;
  color: #555;
}

.mh-store__hours-row {
  display: contents;
}

.mh-store__hours dt {
  font-weight: 500;
  color: #888;
  letter-spacing: 0.01em;
}

.mh-store__hours dd {
  margin: 0;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.mh-store__maps {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.mh-store__maps:hover {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

/* ── Footer ── */
.mh-stores-popover__footer {
  padding: 12px 18px;
  background: #faf7f2;
  border-top: 1px solid #f0f0f0;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mh-stores-popover__footer-link {
  display: block;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.mh-stores-popover__footer-link--exceptions {
  color: #1a1a1a;
  border-bottom: 1px dotted transparent;
  align-self: flex-start;
}
.mh-stores-popover__footer-link--exceptions:hover {
  color: #cc0000;
}

.mh-stores-popover__footer-link--all {
  color: #1a1a1a;
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid #ececec;
}
.mh-stores-popover__footer-link--all:hover {
  color: #cc0000;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .mh-stores-popover {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0;
    transform: translateY(100%);
  }
  .mh-stores-popover[data-open="true"] {
    transform: translateY(0);
  }
  .mh-stores-popover__inner {
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    max-height: 80vh;
    overflow-y: auto;
  }
}
