.grocery-list-page {
    max-width: 100%;
}

.grocery-list-tool {
    max-width: 42rem;
    position: relative;
}

.grocery-list-search-results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
    margin-top: 0.25rem;
    max-height: 16rem;
    overflow: auto;
    background: #fff;
    border: 1px solid #d8ddd6;
    border-radius: 0.35rem;
    box-shadow: 0 0.35rem 1rem rgba(40, 50, 40, 0.12);
}

.grocery-list-search-results[hidden] {
    display: none !important;
}

.grocery-list-search-results button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eef2ec;
    background: transparent;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
}

.grocery-list-search-results button:hover,
.grocery-list-search-results button:focus {
    background: #f3f7f1;
    outline: none;
}

.grocery-list-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.5rem;
}

.grocery-list-selected__empty {
    width: 100%;
    margin: 0;
}

.grocery-list-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.35rem 0.55rem 0.35rem 0.75rem;
    border: 1px solid #c9d2c6;
    border-radius: 999px;
    background: #f7faf5;
    font-size: 0.9rem;
}

.grocery-list-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grocery-list-chip__remove {
    border: 0;
    background: transparent;
    color: #5c655c;
    line-height: 1;
    padding: 0.15rem;
    font-size: 1.1rem;
}

.grocery-list-chip__remove:hover,
.grocery-list-chip__remove:focus {
    color: #2f3a2f;
}

.grocery-list-output {
    background: #f7faf5;
    border: 1px solid #d8ddd6;
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
    max-height: min(36rem, 70vh);
    overflow: auto;
}

.grocery-list-output .guest-shopping-section {
    margin-bottom: 0.85rem;
}

.grocery-list-output .guest-shopping-section:last-child {
    margin-bottom: 0;
}

.grocery-list-output .guest-shopping-section__title {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5c655c;
}

.grocery-list-output ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.grocery-list-output li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #e4ebe0;
    font-size: 0.95rem;
}

.grocery-list-output .guest-shopping-qty {
    flex: 0 0 auto;
    color: #4a554a;
    white-space: nowrap;
}

@media print {
    .home-section--hero,
    .meal-planner-cta-band,
    .grocery-list-search,
    .grocery-list-search-results,
    .grocery-list-actions,
    .js-start-grocery,
    header,
    .footer,
    .ad-footer-band,
    nav {
        display: none !important;
    }

    .grocery-list-output {
        max-height: none;
        overflow: visible;
        border: 0;
        background: transparent;
        padding: 0;
    }

    #grocery-list-tool,
    .grocery-list-selected {
        display: block !important;
    }
}
