/* #menu section (app/views/home/_menu.html.erb), design D. */
@layer sections {
  .menu {
    scroll-margin-top: var(--pl-scroll-margin);
    padding: clamp(56px, 7vw, 96px) 0 clamp(52px, 6.4vw, 88px);
  }

  .menu__inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .menu__head {
    margin-bottom: clamp(8px, 1.6vw, 16px);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .menu__lead {
    margin: 0;
    font-size: 16px;
    color: var(--pl-muted);
  }

  /* One card per product: two columns while each can be 420px wide.
     auto-fill, not the design's auto-fit: a single product keeps its column
     instead of stretching over the whole row. */
  .menu__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
    gap: 16px;
  }

  .menu__card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px;
    border-radius: var(--pl-r-card);
    background: var(--pl-sand-50);
  }

  /* The picture: the product's drawing on dark green (a link to its page). */
  .menu__art {
    position: relative;
    display: block;
    aspect-ratio: 1 / 0.5;
    border-radius: var(--pl-r-chip);
    background: var(--pl-green-950);
    overflow: hidden;
  }

  .menu__drawing {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 35%;
    height: auto;
    transform: translate(-50%, -50%);
    fill: var(--pl-paper);
  }

  .menu__new {
    position: absolute;
    left: 12px;
    top: 12px;
  }

  /* Name and pack on the left, price on the right. The row never wraps: a
     long name breaks inside its column, so the price is in the same place on
     every card. */
  .menu__info {
    padding: 0 8px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 16px;
  }

  /* The last row of a card without "What's inside" and without a stepper
     (ordering closed, no page): the same 20px to the edge as at the sides. */
  .menu__info:last-child {
    padding-bottom: 8px;
  }

  .menu__info-text {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
    overflow-wrap: break-word;
  }

  .menu__name {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  .menu__sub {
    font-size: 14.5px;
    color: var(--pl-muted);
  }

  .menu__price {
    flex: none;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  /* "What's inside" on the left, the stepper on the right; at the bottom of
     the card, so the steppers of a two-card row line up whatever the names. */
  .menu__actions {
    margin-top: auto;
    padding: 0 8px 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
  }

  .menu__inside {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--pl-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
  }

  /* Stays on the right also without a "What's inside" link. */
  .menu__actions .pl-stepper {
    margin-left: auto;
  }

  /* "More dishes are coming": a dashed row under the cards */
  .menu__more {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 10px 18px;
    border: 1.5px dashed var(--pl-border);
    border-radius: var(--pl-r-tile-sm);
    font-size: 15px;
    color: var(--pl-muted);
  }

  .menu__more-icon {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: var(--pl-r-pill);
    background: var(--pl-sand-50);
    color: var(--pl-ink);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Phones: name, pack and price in a column on every card (beside the name
     the price fits for some products and not for others). */
  @media (max-width: 480px) {
    .menu__info {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
    }

    .menu__info-text {
      flex: none;
      max-width: 100%;
    }
  }
}
