@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@600;700&family=Public+Sans:wght@400;500;600&display=swap');

:root {
  --pine: #1B4332;
  --pine-dark: #10262B;
  --sand: #d2b48c;
  --sand-deep: #c2a074;
  --rust: #C1502E;
  --rust-dark: #9c3f23;
  --line: #A9875C;
  --white: #FFFDF9;
  --text: #23291f;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--pine);
  color: var(--text);
  font-family: 'Public Sans', system-ui, sans-serif;
  line-height: 1.5;
}

@media (min-width: 861px) {
  body.home-body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
}

h1, h2, h3 {
  font-family: 'Bitter', Georgia, serif;
  color: var(--pine-dark);
  margin: 0 0 0.4em;
}

a { color: var(--rust-dark); }
a:hover { color: var(--rust); }

.site-header {
  background: var(--sand);
  color: var(--pine-dark);
  padding: 0.9rem 1.25rem;
  border-bottom: 4px solid var(--rust);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
}

.site-header .brand > a {
  display: flex;
  line-height: 0;
}

.site-header .logo {
  height: 84px;
  width: 84px;
  border-radius: 50%;
  flex-shrink: 0;
}

.site-header h1 {
  color: var(--pine-dark);
  font-size: 2rem;
  letter-spacing: 0.02em;
  text-align: left;
}

.site-header .tagline {
  font-size: 0.95rem;
  color: #4a5f4e;
  text-align: left;
}

.site-header nav {
  font-size: 0.85rem;
  text-align: left;
}

.site-header nav a {
  color: var(--pine-dark);
  text-decoration: none;
  font-weight: 600;
}

.site-header nav a:hover {
  color: var(--rust);
}

@media (max-width: 860px) {
  .site-header {
    padding: 0.5rem 0.75rem;
  }
  .site-header .brand {
    gap: 0.55rem;
  }
  .site-header .logo {
    height: 44px;
    width: 44px;
  }
  .site-header h1 {
    font-size: 1rem;
    line-height: 1.15;
    margin: 0;
  }
  .site-header .tagline {
    font-size: 0.65rem;
    line-height: 1.2;
  }
  .site-header nav {
    font-size: 0.7rem;
  }
}

main.map-main {
  text-align: left;
  display: grid;
  grid-template-columns: 400px 1fr;
  grid-template-rows: auto 1fr;
  gap: 1rem;
  padding: 1rem;
  align-items: stretch;
}

@media (min-width: 861px) {
  main.map-main {
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* Search pane and shop list share the left column (so they're the same
   width); the map sits to the right and spans both rows full-height,
   so its top edge lines up with the search pane. */
.search-pane { grid-column: 1; grid-row: 1; }
.sidebar { grid-column: 1; grid-row: 2; }
#map { grid-column: 2; grid-row: 1 / 3; }

@media (max-width: 860px) {
  main.map-main {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    align-items: start;
  }
  /* Search first, then the map, then the filter/shop list, so both the
     search tools and the map are visible without much scrolling. */
  .search-pane { grid-column: 1; grid-row: auto; order: 1; }
  #map { grid-column: 1; grid-row: auto; order: 2; }
  .sidebar { grid-column: 1; grid-row: auto; order: 3; }
}

#map {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
}

@media (min-width: 861px) {
  #map { height: 100%; }
}

@media (max-width: 860px) {
  #map { height: 60vh; }
}

@media (max-width: 600px) {
  #map { height: 380px; }
}

.search-pane {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.search-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 0.85rem;
}

.search-tab {
  flex: 1;
  margin-bottom: -2px;
  padding: 0.55rem 0.5rem;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  background: none;
  color: #8a8a82;
  font-family: 'Bitter', Georgia, serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.search-tab:hover { color: var(--rust); }
.search-tab.active {
  background: var(--rust);
  color: #fff;
  border-bottom-color: var(--rust);
}
.search-tab.active:hover { color: #fff; }

.search-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
/* Author CSS setting display on .search-panel would otherwise silently
   override the [hidden] attribute - see the note in the docs about this. */
.search-panel[hidden] { display: none; }

.sidebar {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (max-width: 860px) {
  .sidebar { height: auto; max-height: 480px; }
}

.hours-filter-pane {
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.finder-summary {
  display: none;
  width: 100%;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  font-family: 'Bitter', Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--pine-dark);
  background: none;
  border: none;
  padding: 0.25rem 0.1rem 0.75rem;
  flex-shrink: 0;
}
.finder-summary .finder-arrow {
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}
.finder-summary.is-open .finder-arrow { transform: rotate(180deg); }

@media (max-width: 860px) {
  .finder-summary { display: flex; }
}

.finder-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

@media (max-width: 860px) {
  .finder-body.collapsed { display: none; }
}

.search-input-row {
  display: flex;
  gap: 0.4rem;
}

.search-input-row input {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-inline {
  flex-shrink: 0;
  padding: 0 0.9rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--rust);
  background: var(--rust);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-inline:hover { background: var(--rust-dark); border-color: var(--rust-dark); }

.radius-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text);
}

.clear-pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--rust-dark);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.clear-pill:hover { border-color: var(--rust); background: #f3e6d8; }

.radius-row select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.8rem;
  background: var(--white);
  color: var(--text);
}

.hours-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.hours-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: #8a8a82;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hours-pill:hover { border-color: var(--rust); }

.hours-pill:not(.active) .pin-dot { opacity: 0.4; }

.hours-pill.active[data-hours="regular"] {
  background: #e3edf6;
  border-color: #2f6fa8;
  color: #1c4a72;
}

.hours-pill.active[data-hours="24_hours"] {
  background: #e2f3e8;
  border-color: #2f8f5b;
  color: #205f3d;
}

.hours-pill.active[data-hours="unconfirmed"] {
  background: #ebebe9;
  border-color: #8a8a82;
  color: #55554f;
}

.payment-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.6rem;
}

.payment-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem 0.3rem 0.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: #8a8a82;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.payment-filter-pill:hover { border-color: var(--rust); }
.payment-filter-pill .payment-badge {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.payment-filter-pill:not(.active) .payment-badge { opacity: 0.4; }
.payment-filter-pill.active {
  background: #f3e6d8;
  border-color: var(--rust);
  color: var(--rust-dark);
}

.pin-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pin-dot.regular { background: #2f6fa8; }
.pin-dot.h24 { background: #2f8f5b; }
.pin-dot.unconfirmed { background: #8a8a82; }

/* Status pills - shown next to a shop's name for 24/7 and unconfirmed hours */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  vertical-align: middle;
  margin-left: 0.4rem;
  white-space: nowrap;
}
.status-pill.h24 { background: #2f8f5b; }
.status-pill.unconfirmed { background: #8a8a82; }

/* Small legend box overlaid on the Leaflet maps, explaining pin colors */
.map-legend {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-family: 'Public Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  line-height: 1.5;
}
.map-legend .legend-title {
  font-family: 'Bitter', Georgia, serif;
  font-weight: 700;
  color: var(--pine-dark);
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}
.map-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.map-legend .legend-row + .legend-row {
  margin-top: 0.15rem;
}

@media (max-width: 600px) {
  .map-legend {
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
  }
  .map-legend .legend-title {
    font-size: 0.68rem;
    margin-bottom: 0.15rem;
  }
  .map-legend .pin-dot {
    width: 8px;
    height: 8px;
  }
}

/* Badge shown in place of two or more pins that overlap on screen -
   click it to zoom in until they split back into individual pins. */
.mbs-cluster-wrap {
  background: transparent;
  border: none;
}
.mbs-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--rust);
  color: #fff;
  font-family: 'Public Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.shop-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
  text-align: left;
}

.suggest-shop-link {
  flex-shrink: 0;
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  text-align: center;
}

.shop-card {
  border-top: 1px dashed var(--line);
  padding: 0.75rem 0.1rem;
  cursor: pointer;
}

.shop-card:first-child { border-top: none; }

.shop-card:hover .shop-name { color: var(--rust); }

.shop-name {
  font-family: 'Bitter', Georgia, serif;
  font-weight: 700;
  color: var(--pine-dark);
  font-size: 1.02rem;
}

.shop-meta {
  font-size: 0.85rem;
  color: #566153;
  margin: 0.15rem 0;
}

.shop-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.shop-actions a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.shop-actions a:not(:first-child) {
  padding-left: 0.6rem;
  border-left: 1px solid var(--line);
}

.website-link {
  color: var(--pine-dark);
}
.website-link svg { display: block; }

.empty-note {
  font-size: 0.9rem;
  color: #566153;
  font-style: italic;
}

.owner-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--white);
  background: var(--pine);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.detour-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--white);
  background: var(--rust);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  vertical-align: middle;
}

#route-form {
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.route-actions-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.route-actions-row .btn {
  flex: 1;
  justify-content: center;
  text-align: center;
}

.route-actions-row .btn.btn-small {
  flex: 0 0 auto;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.popup-header {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.popup-detour-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.3rem;
}

.popup-photo {
  display: block;
  width: 52px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--radius);
}

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

.popup-name-row {
  white-space: nowrap;
}

.popup-actions {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.popup-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--pine-dark);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.popup-actions a:hover { background: var(--sand-deep); }

.leaflet-popup-content b { color: var(--pine-dark); }
.leaflet-popup-content .popup-directions {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.site-footer {
  text-align: left;
  font-size: 0.8rem;
  color: var(--sand-deep);
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}

.site-footer a { color: var(--sand-deep); }
.site-footer a:hover { color: var(--rust); }

.fine-print-link {
  opacity: 0.6;
  font-size: 0.75rem;
}

.detail-wrap {
  max-width: 640px;
  margin: 1.5rem auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
}

.detail-wrap .back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.detail-wrap h2 { margin-bottom: 0.2rem; }

.detail-section {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
}

.detail-section.detail-section-first {
  margin-top: 0.6rem;
  padding-top: 0;
  border-top: none;
}

.detail-section .shop-meta:first-child { margin-top: 0; }

.section-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--pine-dark);
  margin: 0 0 0.5rem;
}

.payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.payment-badge {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.payment-badge .payment-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.payment-badge .payment-icon svg { width: 100%; height: 100%; display: block; }

/* "Accepted Payments" row shown below the action links in the map
   popup - smaller badges than the full-size ones on shop.php. */
.payment-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.payment-badges-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a8a82;
  margin-right: 0.1rem;
}
.payment-badges-row .payment-badge {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Icon-only version used in the shop-list card: sits on the same row
   as Directions/Details/Website, pushed to the right edge of that row. */
.shop-actions .payment-badges-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}
.shop-actions .payment-badges-inline .payment-badge {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.detail-wrap .owner-note {
  padding: 0.7rem 0.85rem;
  background: var(--sand);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.detail-wrap .directions-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.directions-row-left {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.about-text p {
  margin: 0 0 1.1rem;
  line-height: 1.65;
}
.about-text p:last-child { margin-bottom: 0; }

.edit-shop-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.last-updated {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #8a8a82;
}

.about-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.links-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.links-grid .link-tile {
  flex: 0 1 calc(33.333% - 0.834rem);
}

@media (max-width: 900px) {
  .links-grid .link-tile { flex-basis: calc(50% - 0.625rem); }
}

@media (max-width: 600px) {
  .links-grid .link-tile { flex-basis: 100%; }
}

.link-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.link-tile:hover {
  border-color: var(--rust);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.link-tile-thumb {
  width: 100%;
  aspect-ratio: 5 / 3;
  display: block;
  object-fit: cover;
  background: var(--sand);
}

.link-tile-body {
  padding: 0.85rem 1rem 1rem;
}

.link-tile-title {
  margin: 0 0 0.3rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--rust-dark);
  line-height: 1.35;
}

.link-tile:hover .link-tile-title { color: var(--rust); }

.link-tile-desc {
  margin: 0;
  font-size: 0.85rem;
  color: #566153;
  line-height: 1.45;
}

/* --- How To Use page --- */
.howto-wrap {
  max-width: 820px;
}

.howto-intro {
  color: #566153;
  margin: 0 0 1.25rem;
}

.howto-toc {
  background: var(--sand);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.howto-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 1.5rem;
}

.howto-toc li {
  margin-bottom: 0.4rem;
  line-height: 1.4;
  break-inside: avoid;
}

.howto-toc a {
  font-weight: 600;
}

@media (max-width: 600px) {
  .howto-toc ol { columns: 1; }
}

.howto-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: 1rem;
}

.howto-section p {
  line-height: 1.6;
  margin: 0 0 0.85rem;
}

.howto-screenshot {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0.5rem 0 1rem;
}

/* --- Admin --- */
.admin-body {
  background: var(--pine);
  font-family: 'Public Sans', system-ui, sans-serif;
  color: var(--text);
}

.admin-wrap {
  max-width: 780px;
  margin: 2rem auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.admin-wrap.wide { max-width: 980px; }

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
}
.field textarea { min-height: 90px; }
.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; }

.coords-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}
.coords-row .btn { flex: 0 0 auto; }
.coords-input {
  flex: 1;
  min-width: 100px;
}
.coords-input label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.coords-input input[type="text"] {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.payment-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.payment-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.payment-pill:hover { opacity: 0.75; border-color: var(--rust); }
.payment-pill input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.payment-pill .payment-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.payment-pill .payment-icon svg { width: 100%; height: 100%; display: block; }
.payment-pill:has(input:checked) {
  opacity: 1;
  border-color: var(--rust);
  box-shadow: 0 0 0 2px rgba(193, 80, 46, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  background: var(--rust);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--rust-dark); color: var(--white); }
.btn.secondary {
  background: transparent;
  color: var(--pine-dark);
  border: 1px solid var(--line);
}
.btn.secondary:hover { background: var(--sand-deep); }
.btn.danger { background: #7a2b1a; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--sand-deep);
}
.admin-table th { color: var(--pine-dark); }

.flash {
  background: var(--sand-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash.error { background: #f4d9d0; border-color: var(--rust); }

/* --- Pending-action indicator on admin dashboard buttons --- */
.btn.pending-action {
  background: var(--rust);
  color: #fff;
  border-color: var(--rust);
  animation: pending-glow 1.8s ease-in-out infinite;
}
.btn.pending-action:hover { background: var(--rust-dark); border-color: var(--rust-dark); }
.btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: #fff;
  color: var(--rust-dark);
  font-size: 0.75rem;
  font-weight: 800;
}
@keyframes pending-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193, 80, 46, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(193, 80, 46, 0); }
}

/* --- Visibility toggle switch (green = visible, red = hidden) --- */
.visibility-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
/* When this is used as the <label> for a form field (admin/owner edit
   forms), .field label's `display: block` would otherwise win on
   specificity and break the alignment - this beats it. */
.field .visibility-toggle-row {
  display: flex;
  align-items: center;
}
.visibility-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 23px;
  flex-shrink: 0;
}
.visibility-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.visibility-toggle .toggle-track {
  position: absolute;
  inset: 0;
  background: #b3261e;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.visibility-toggle input:checked + .toggle-track {
  background: #2f8f5b;
}
.visibility-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}
.visibility-toggle .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.visibility-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(19px);
}
.visibility-toggle-text {
  font-size: 0.85rem;
  font-weight: 700;
}
.visibility-toggle-text.is-visible { color: #2f8f5b; }
.visibility-toggle-text.is-hidden { color: #b3261e; }

/* --- Prominent "this shop is hidden" banner on shop.php --- */
.hidden-shop-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  background: #f4d9d0;
  border: 2px solid var(--rust);
  color: #6b1d0a;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  margin-bottom: 1rem;
}
.hidden-shop-banner .hidden-shop-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.hidden-shop-banner .hidden-shop-text { flex: 1 1 240px; }
.hidden-shop-banner form { flex-shrink: 0; margin-left: auto; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* --- Shop photos --- */
.current-photo-preview {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 0.5rem;
}

.photo-field input[type="file"] {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem;
  width: 100%;
  background: var(--white);
  font-size: 0.85rem;
}

.photo-crop-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 38, 43, 0.72);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.photo-crop-modal.open { display: flex; }

.photo-crop-box {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  max-width: 520px;
  width: 100%;
}

.photo-crop-image-wrap {
  max-height: 55vh;
  overflow: hidden;
  margin: 0.75rem 0;
  background: #222;
}

.photo-crop-image-wrap img {
  max-width: 100%;
  display: block;
}

.photo-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.shop-photo-cover {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  margin: 0.75rem 0 0.25rem;
}
