.store-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.store-filter input[type="search"] {
  flex: 1 1 12rem;
  max-width: 20rem;
}

.store-filter select {
  flex: 0 1 auto;
  width: auto;
  max-width: 16rem;
}

.store-filter button {
  flex: 0 0 auto;
  padding: 0.5rem 0.9rem;
}

.store-filter__reset {
  flex: 0 0 auto;
  font-weight: 600;
}

.store-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

/* Each store is a calm surface card, so the retro sundul bubble is the thing
   that pops. The grid keeps the row aligned: bump | name | city. */
.store-list__store {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.store-list__store .last-bubbled {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.store-list__store .last-bubbled__icon {
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  color: var(--green);
}

.store-list__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.store-list__name a {
  color: var(--ink);
}

.store-list__name a:hover {
  color: var(--accent-dark);
}

/* Location on the right. It is allowed to wrap to a second line instead of
   being truncated, so the full "Kota/Kab., Provinsi" stays readable. */
.store-list__city {
  justify-self: end;
  text-align: right;
  color: var(--muted);
  font-size: 0.85rem;
}

/* The owner's optional "sundul" message. This is the retro accent in its
   purest form: chunky ink border, hard offset shadow, monospace and a tail
   pointing up towards the store name. */
.store-list__message {
  grid-column: 2 / -1;
  justify-self: start;
  position: relative;
  margin-top: 0.7rem;
  max-width: 100%;
  padding: 0.3rem 0.6rem;
  background: var(--surface);
  border: var(--border-retro);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.store-list__message::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 12px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-top: var(--border-retro);
  border-left: var(--border-retro);
  transform: rotate(45deg);
}

/* On phones the location drops to a second line, aligned under the name, so a
   long "Kota/Kab., Provinsi" no longer squeezes the store name. */
@media (max-width: 34rem) {
  .store-list__store {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .store-list__city {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    text-align: left;
  }
}

/* Public store detail */
.store-hero {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* Phones: put the store photo on top and the store details underneath it,
   instead of squeezing both side by side. */
@media (max-width: 47.9375rem) {
  .store-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

.store-hero__logo {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.store-hero__body {
  flex: 1 1 auto;
  min-width: 0;
}

/* Name and the small report action share the first line. */
.store-hero__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.store-hero__body h1 {
  font-size: 1.25rem;
  line-height: 1.2;
}

/* Small outlined secondary action, pinned to the top-right of the box. */
.store-hero__report {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.store-hero__report:hover {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red);
  text-decoration: none;
}

/* Reserve room on the name's first line so it never runs under the button.
   Needed when the body sits at the top: desktop, or no logo on mobile. */
@media (min-width: 48rem) {
  .store-hero__heading {
    padding-right: 7.5rem;
  }
}

.store-hero:not(:has(.store-hero__logo)) .store-hero__heading {
  padding-right: 7.5rem;
}

/* City and opening hours collapsed into a single muted line. */
.store-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.store-hero__facts span:not(:last-child)::after {
  content: "\00b7";
  margin-left: 0.4rem;
}

/* Long descriptions are clamped so the card stays compact. */
.store-hero__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin-top: 0.45rem;
  font-size: 0.9rem;
}

.store-hero__address {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* The maps link is a key action (people want to visit the warung), so it is
   accent-coloured with a pin icon instead of plain text. */
.store-hero__map {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.store-hero__map svg {
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
}

.store-hero__map:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* The owner's "sundul" message, as a chat bubble above the store info box and
   aligned right. The tail sits on the right and points down at the box. */
.store-bump {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.85rem;
}

.store-bump__bubble {
  position: relative;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
  background: var(--surface);
  border: var(--border-retro);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.store-bump__bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  right: 14px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-bottom: var(--border-retro);
  border-right: var(--border-retro);
  transform: rotate(45deg);
}

/* Menu, laid out like a food menu: [icon] Name ....... Price */
/* The category name sticks below the site nav while its items scroll by, so
   you always know which section you are looking at. */
.menu-section__title {
  position: sticky;
  top: var(--nav-h, 3.15rem);
  z-index: 5;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem 0 0.35rem;
  background: var(--bg);
  /* Cover the margin gap below with the page colour, so items do not peek out
     while the title is stuck. */
  box-shadow: 0 0.5rem 0 var(--bg);
  border-bottom: 1px solid var(--line);
}

/* The whole category name is a toggle, so the tappable area matches the row
   instead of just the text. Reset the button back to plain heading text. */
.menu-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-section__toggle:hover {
  color: var(--accent-dark);
  background: none;
  border-color: transparent;
  box-shadow: none;
}

.menu-section__toggle:active {
  transform: none;
  box-shadow: none;
}

.menu-section__chevron {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.menu-section__toggle.is-open .menu-section__chevron {
  transform: rotate(180deg);
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.menu__item:first-child {
  border-top: none;
}

/* A selected menu gets an accent border around the whole row so it is obvious
   which items are picked. outline (not box-shadow) keeps the flat look and
   does not shift the layout. */
.menu__item:has(.menu__check:checked) {
  background: var(--accent-soft);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Icon button + popover */
.menu__media {
  position: relative;
  flex: 0 0 auto;
}

.menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  overflow: hidden;
}

.menu__icon:hover {
  border-color: var(--ink);
}

.menu__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu__icon svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

/* Phones: shrink the menu photo button so rows stay compact. */
@media (max-width: 47.9375rem) {
  .menu__icon {
    width: 2rem;
    height: 2rem;
  }

  .menu__icon svg {
    width: 0.8rem;
    height: 0.8rem;
  }
}

.menu__popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  z-index: 10;
  width: 15rem;
  max-width: 80vw;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  text-align: left;
}

.menu__popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 1rem;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--line);
}

/* Show on hover, or on click/keyboard focus. */
.menu__media:hover .menu__popover,
.menu__media:focus-within .menu__popover {
  display: block;
}

.menu__popover-image {
  width: 100%;
  height: 8rem;
  object-fit: cover;
  margin-bottom: 0.5rem;
}

/* Text column: name on top (never truncated), then a meta line with the price
   and the quantity. The <label for=...> makes clicking the name or price
   toggle the checkbox. */
.menu__label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}

/* Only rows with an enabled checkbox react to clicks. */
.menu__item:has(.menu__check:not(:disabled)) .menu__label {
  cursor: pointer;
}

.menu__item:has(.menu__check:not(:disabled)) .menu__label:hover .menu__name {
  color: var(--accent-dark);
}

/* Sold-out rows are not selectable, so mute the text. */
.menu__item:has(.menu__check:disabled) .menu__name,
.menu__item:has(.menu__check:disabled) .menu__price {
  color: var(--muted);
}

.menu__name {
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Price in monospace and accent - it is a key decision factor, so it should
   read as important, not as an afterthought. */
.menu__price {
  white-space: nowrap;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

/* Custom square checkbox, sitting before the photo. */
.menu__item > .menu__check {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--ink);
  cursor: pointer;
}

.menu__item > .menu__check:checked {
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.85rem;
  border-color: var(--accent);
}

.menu__item > .menu__check:disabled {
  background: var(--surface-2);
  border-color: var(--line-strong);
  cursor: not-allowed;
}

/* Quantity: mirrored to the checkbox - flush to the right edge, vertically
   centred, so the two ends of the row are balanced. */
.menu__item input.menu__qty {
  flex: 0 0 auto;
  width: 3.5rem;
  max-width: 3.5rem;
  min-height: 2.4rem;
  margin-left: auto;
  padding: 0.1rem 0.3rem;
  text-align: center;
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Hide the tiny desktop spinner arrows so the number stays centred. */
.menu__item input.menu__qty::-webkit-outer-spin-button,
.menu__item input.menu__qty::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.menu__habis {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Order summary: running total + confirm button. On phones it sticks to the
   bottom of the viewport so the total and the CTA are always in reach. */
.order-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

.order-bar__total {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.order-bar__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.order-bar__value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 47.9375rem) {
  .order-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 0.75rem 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
}
