/*
 * Header menu panels (journal2/menu revamp, Menu Type = Panel / Shops panel): the box that opens
 * under a tab, Amazon-style — a title, a grid of rounded tiles (image over text), and an optional
 * link at the bottom. Placed by mega_menu_panel.js (position: fixed from the tab's own box).
 * Journal serves this file through its aggregated cache keyed on ?v= (journal2/menu.php): bump it
 * on every edit.
 */
.mm-has-panel {
    position: relative;
}

.mm-has-panel > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-start: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
    opacity: .6;
}

.mm-panel {
    display: none;
    position: fixed;
    z-index: 1000;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
    font-weight: 400;
    white-space: normal;
    text-align: start;
    cursor: default;
}

.mm-has-panel.mm-open > .mm-panel {
    display: block;
}

.mm-panel__title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

/* --mm-cols: the Tiles per Row setting, or fewer when the panel has fewer tiles (mega_menu_panel.js),
   so a panel is never wider than what it shows. */
.mm-panel__grid {
    display: grid;
    grid-template-columns: repeat(var(--mm-cols, 2), minmax(0, var(--mm-tile, 200px)));
    gap: 12px;
}

.mm-panel-shops {
    --mm-tile: 170px;
}

/* The title can be wider than the tiles (one shop): the tiles sit under it centred, not at its start. */
.mm-panel-shops .mm-panel__grid {
    justify-content: center;
}

/* One shop: one column, centred — the phone panel is full width and kept the Tiles per Row
   columns, so the lone tile sat at the start (owner ask 2026-11-04). only-of-type: the panel's
   config <script> is the tile's sibling. */
.mm-panel-shops .mm-panel__grid:has(> a.mm-tile:only-of-type) {
    grid-template-columns: minmax(0, var(--mm-tile, 170px));
}

.mm-panel .mm-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 12px 10px 14px;
    border: 0;
    border-radius: 12px;
    background: #f3f2ef;
    color: #111827;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow .15s ease;
}

.mm-panel .mm-tile:hover,
.mm-panel .mm-tile:focus-visible {
    box-shadow: 0 4px 14px rgba(16, 24, 40, .14);
    text-decoration: none;
}

.mm-tile__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 2;
}

.mm-tile__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* A shop or Mart tile: the logo in a white circle, as the Nearby Shops row draws it. */
.mm-tile__media--logo {
    width: 84px;
    height: 84px;
    aspect-ratio: auto;
    border-radius: 50%;
    border: 3px solid var(--brand-mart_primary, #018a99);
    background: #fff;
    overflow: hidden;
}

.mm-tile__media--logo img {
    width: 78%;
    height: 78%;
}

.mm-tile__initial {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-mart_primary, #018a99);
}

.mm-tile__media--icon {
    aspect-ratio: auto;
    height: 84px;
    color: var(--brand-primary, #ff3f98);
}

.mm-tile__name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.mm-tile__note {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-mart_primary, #018a99);
}

.mm-tile--location .mm-tile__note {
    font-weight: 400;
    color: #545f73;
}

/* A shop closed for now: when it opens, muted, in place of "Enter the shop". */
.mm-tile--closed .mm-tile__note {
    font-weight: 600;
    color: #8a94a6;
}

.mm-tile--closed .mm-tile__media--logo {
    filter: grayscale(1);
    opacity: .7;
}

.mm-panel__footer {
    display: block;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    font-size: 15px;
    font-weight: 600;
    color: #2563eb;
}

.mm-panel__footer:hover {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .mm-panel {
        width: calc(100vw - 32px);
    }

    .mm-panel .mm-panel__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
