/* Menu cart only. Do not apply these rules to the checkout page. */
#cart {
    box-sizing: border-box;
    height: auto !important;
    max-height: calc(100vh - 120px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #c9b8a8 #f7f3ef;
    background: #fff;
}

#cart::-webkit-scrollbar {
    width: 8px;
}

#cart::-webkit-scrollbar-track {
    background: #f7f3ef;
}

#cart::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #c9b8a8;
}

#cart #meals4u {
    min-height: 0;
    box-sizing: border-box;
    padding-right: 8px;
}

#cart #meals4u thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

#cart #meals4u tfoot th,
#cart #meals4u tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #fff;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

#cart #meals4u tfoot th {
    text-align: center;
    box-sizing: border-box;
    padding: 6px 8px !important;
    overflow: hidden;
}

#cart #meals4u table {
    table-layout: fixed;
}

#cart #meals4u td,
#cart #meals4u th {
    box-sizing: border-box;
}

#cart #meals4u tbody td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

#cart #meals4u .meals4u-item-main {
    padding: 4px 8px 2px 4px !important;
}

#cart #meals4u .meals4u-item-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

#cart #meals4u .meals4u-item-qty {
    display: block;
    flex: 0 0 24px;
    width: 24px !important;
    max-width: 24px !important;
    min-width: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#cart #meals4u .meals4u-item-qty input {
    display: block;
    width: 22px;
    margin: 0;
    padding: 1px 0;
    text-align: center;
}

#cart #meals4u .meals4u-item-name {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    margin: 0 !important;
    padding: 1px 0 0 !important;
    word-break: break-word;
}

/* Shared cart name/qty layout (menu + checkout). */
#meals4u .meals4u-item-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

#meals4u .meals4u-item-line .meals4u-item-qty {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    padding: 0;
}

#meals4u .meals4u-item-line .meals4u-item-qty input {
    display: block;
    width: 22px;
    text-align: center;
}

#meals4u .meals4u-item-line .meals4u-item-name {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 1px 0 0;
    word-break: break-word;
}

#cart #meals4u .meals4u-item-price,
#cart #meals4u td:last-child {
    padding-right: 12px !important;
}

#cart #meals4u .meals4u-remove {
    display: inline-block;
    margin-right: 2px;
    position: relative;
    z-index: 1;
}

#cart #meals4u #payment-fee-notice td,
#cart #meals4u #minimal-charge-notice td {
    padding: 9px 10px;
    color: #2f2f2f;
    background: #fafafa;
    font-size: 13px;
    line-height: 1.25;
}

#cart #meals4u #payment-fee-notice td:last-child,
#cart #meals4u #minimal-charge-notice td:last-child {
    width: 30%;
    text-align: right;
    white-space: nowrap;
}

#cart #meals4u .discount_code {
    display: flex !important;
    align-items: stretch;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    margin: 0;
    border: 0 !important;
    gap: 0;
    overflow: hidden;
}

#cart #meals4u input.tip_code,
#cart #meals4u input.coupon_code {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 38px;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 7px 10px !important;
    border: 1px solid #c9c9c9 !important;
    border-right: 0 !important;
    border-radius: 6px 0 0 6px !important;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 13px;
    line-height: 22px;
}

#cart #meals4u input.tip_code:focus,
#cart #meals4u input.coupon_code:focus {
    position: relative;
    z-index: 1;
    border-color: #e87428 !important;
    outline: 2px solid rgba(232, 116, 40, 0.16);
    outline-offset: -1px;
}

#cart #meals4u .tip_button,
#cart #meals4u .coupon_button {
    flex: 0 0 64px !important;
    width: 64px !important;
    max-width: 64px !important;
    height: 38px !important;
    box-sizing: border-box;
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 8px !important;
    border: 1px solid #d96a20 !important;
    border-radius: 0 6px 6px 0 !important;
    background: #e87428 !important;
    color: #fff !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 36px !important;
    text-align: center;
    cursor: pointer;
    position: static !important;
    top: auto !important;
    -webkit-appearance: none !important;
}

#cart #meals4u .coupon_button {
    border-color: #176fd1 !important;
    background: #1677e8 !important;
}

#cart #meals4u .tip_button:hover {
    background: #d96a20 !important;
}

#cart #meals4u .coupon_button:hover {
    background: #0f68cc !important;
}

#cart #meals4u #checkout_cart tbody tr:has(.discount_code) > td {
    box-sizing: border-box;
    padding: 6px 8px !important;
    overflow: hidden;
}

#meals4u #discount_list tr.extra-discount td {
    padding: 7px 9px;
    border-bottom: 1px solid #e4cccc;
    background: #fffafa;
    vertical-align: middle;
}

#meals4u #discount_list tr.extra-discount td:first-child {
    box-shadow: inset 3px 0 0 #d78a8a;
}

#meals4u #discount_list tr.extra-discount td:last-child {
    width: 30%;
    padding-left: 5px;
    color: #a83d3d;
    text-align: right;
    white-space: nowrap;
}

#meals4u #discount_list .discount_title {
    display: block;
    color: #a83d3d;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

#meals4u #discount_list .discount_title + br {
    display: none;
}

#meals4u #discount_list .discount_title + br + .discount_title {
    margin-top: 2px;
    color: #666;
    font-size: 11px;
    font-weight: 600;
}

#meals4u #discount_list .discount_value {
    display: block;
    color: #a83d3d;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: right;
}

#meals4u #toggle-discounts {
    display: inline-block;
    padding: 4px 8px;
    color: #176fd1;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

#meals4u #toggle-discounts:hover {
    text-decoration: underline;
}

#meals4u #discount_list tr:last-child td {
    padding: 8px 9px;
    border-top: 1px solid #cfe3d3;
    border-bottom: 1px solid #cfe3d3;
    background: #f3faf4 !important;
    vertical-align: middle;
}

#meals4u #discount_list tr:last-child td:last-child {
    width: 30%;
    text-align: right;
    white-space: nowrap;
}

#meals4u #discount_list .discount_total {
    color: #217a34 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

#cart .checkout_button_cart,
#cart #meals4u #meals4u-checkout.checkout_button_cart {
    display: flex !important;
    align-items: center;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-height: 42px;
    padding: 9px 12px !important;
    border: 1px solid #d96a20;
    border-radius: 6px;
    background: #e87428;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

/* Keep coupon/tip row and checkout CTA on the same left/right edges */
#cart #meals4u #checkout_cart tbody tr:has(.discount_code) > td,
#cart #meals4u #checkout_cart tfoot th {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

#cart .checkout_button_cart:hover {
    background: #d96a20;
}

#cart .checkout_button_cart #meals4u-subtotal {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

/* Fee rows — label left / price right only; keep existing cart typography */
#meals4u #checkout_cart tbody tr.checkout-fee-row > td,
#meals4u #checkout_cart tbody tr#payment-fee-notice.checkout-fee-row > td,
#meals4u #checkout_cart tbody tr#minimal-charge-notice > td {
    padding: 0 !important;
    border: 0 !important;
}

#meals4u #checkout_cart tbody .checkout-fee-line {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
    border-bottom: solid 1px #ccc;
    font-size: 14px;
}

#meals4u #checkout_cart tbody .checkout-fee-label {
    display: inline-flex !important;
    align-items: center;
    min-width: 0;
    text-align: left;
}

#meals4u #checkout_cart tbody .checkout-fee-label a {
    display: inline-flex !important;
    align-items: center;
}

#meals4u #checkout_cart tbody .checkout-fee-label img {
    display: block;
    max-height: 22px;
    width: auto;
    margin: 2px 0;
}

#meals4u #checkout_cart tbody .checkout-fee-price {
    flex: 0 0 auto;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

/* Applied tip row — amount + compact Edit on one line */
#meals4u #checkout_cart tbody tr.checkout-tip-row > td {
    padding: 8px 10px !important;
    vertical-align: middle;
    border-bottom: 1px solid #efefef !important;
    background: #f7f7f7;
}

#meals4u #checkout_cart tbody td.checkout-tip-value {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: visible;
}

#meals4u #checkout_cart tbody .checkout-tip-amount {
    display: inline;
    flex-shrink: 0;
    margin: 0;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

#meals4u #checkout_cart tbody .checkout-tip-amount {
    display: inline;
    margin: 0;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

#meals4u #checkout_cart tbody a.checkout-tip-edit {
    display: inline-block;
    box-sizing: border-box;
    margin: 0;
    padding: 1px 6px;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    background: #fff;
    color: #666 !important;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
}

#meals4u #checkout_cart tbody a.checkout-tip-edit:hover {
    border-color: #e87428;
    background: #fff7f0;
    color: #d96a20 !important;
}

/* Allergy advice (menu cart column + shared markup) */
.allergy-advice,
#allergy_advice.allergy-advice {
    box-sizing: border-box;
    margin: 10px 0 0;
    padding: 14px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
}

/* Menu cart allergy — mockup: card + circular icons, no name labels */
#allergy_advice.allergy-advice--compact,
.allergy-advice--compact {
    box-sizing: border-box;
    width: 100%;
    margin: 12px 0 0;
    padding: 14px 12px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
}

#allergy_advice.allergy-advice--compact .allergy-advice-header,
.allergy-advice--compact .allergy-advice-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
}

#allergy_advice.allergy-advice--compact .allergy-advice-heading,
.allergy-advice--compact .allergy-advice-heading {
    display: block;
    min-width: 0;
}

#allergy_advice.allergy-advice--compact .allergy-advice-title,
.allergy-advice--compact .allergy-advice-title {
    margin: 0;
    color: #111;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
}

#allergy_advice.allergy-advice--compact .allergy-advice-more,
.allergy-advice--compact .allergy-advice-more {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    color: #9a9a9a !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
}

#allergy_advice.allergy-advice--compact .allergy-advice-more:hover,
.allergy-advice--compact .allergy-advice-more:hover {
    color: #666 !important;
    text-decoration: none !important;
}

#allergy_advice.allergy-advice--compact .allergy-advice-more-icon,
.allergy-advice--compact .allergy-advice-more-icon {
    display: inline-flex;
    width: 12px;
    height: 12px;
    color: inherit;
}

#allergy_advice.allergy-advice--compact .allergy-advice-more-icon svg,
.allergy-advice--compact .allergy-advice-more-icon svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#allergy_advice.allergy-advice--compact .allergy-advice-intro,
#allergy_advice.allergy-advice--compact .allergy-advice-footer,
.allergy-advice--compact .allergy-advice-intro,
.allergy-advice--compact .allergy-advice-footer {
    margin: 0;
    color: #222;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

#allergy_advice.allergy-advice--compact .allergy-advice-intro,
.allergy-advice--compact .allergy-advice-intro {
    margin: 0 0 12px;
}

#allergy_advice.allergy-advice--compact .allergy-advice-footer,
.allergy-advice--compact .allergy-advice-footer {
    margin: 12px 0 0;
}

/* Always 4 columns — icons shrink to fit; tight gap keeps room for circles */
#allergy_advice.allergy-advice--compact .allergy-icons,
#allergy_advice.allergy-advice--compact #allergy-icons,
.allergy-advice--compact .allergy-icons,
.allergy-advice--compact #allergy-icons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    align-items: center;
    justify-items: center;
}

#allergy_advice.allergy-advice--compact .allergy-icon,
.allergy-advice--compact .allergy-icon {
    display: inline-flex !important;
    box-sizing: border-box;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: 46px;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    line-height: 0;
    text-decoration: none;
    cursor: default;
}

#allergy_advice.allergy-advice--compact .allergy-icon:hover,
.allergy-advice--compact .allergy-icon:hover {
    opacity: 1 !important;
    padding: 0 !important;
    cursor: default;
}

#allergy_advice.allergy-advice--compact .allergy-icon img,
.allergy-advice--compact .allergy-icon img {
    display: block;
    width: 52% !important;
    height: 52% !important;
    max-width: 24px;
    max-height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: contain;
}

#allergy_advice.allergy-advice--compact .allergy-icon-label,
.allergy-advice--compact .allergy-icon-label,
#allergy_advice.allergy-advice--compact .allergy-icon-item,
.allergy-advice--compact .allergy-icon-item {
    display: none !important;
}

/* Mobile menu: inset like offer banner / search */
@media (max-width: 900px) {
    #allergy_advice.allergy-advice,
    #allergy_advice.allergy-advice--compact,
    .allergy-advice--compact {
        box-sizing: border-box;
        width: calc(100% - 20px);
        max-width: 100%;
        margin-left: 10px;
        margin-right: 10px;
    }
}

.allergy-advice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
}

.allergy-advice-heading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.allergy-advice-icon {
    display: inline-flex;
    flex: 0 0 16px;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #f0a020;
}

.allergy-advice-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.allergy-advice-title {
    margin: 0;
    color: #222;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.allergy-advice-more {
    color: #2f6fed !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

.allergy-advice-more:hover {
    color: #1d57d0 !important;
    text-decoration: underline !important;
}

.allergy-advice-intro,
.allergy-advice-footer {
    margin: 0;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.allergy-advice-intro {
    margin-bottom: 10px;
}

.allergy-advice-footer {
    margin-top: 10px;
    font-weight: 500;
}

.allergy-icons,
#allergy-icons.allergy-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px 8px;
    justify-items: center;
}

.allergy-advice--labeled .allergy-icons,
#allergy_advice.allergy-advice--labeled .allergy-icons,
#allergy_advice.allergy-advice--labeled #allergy-icons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 10px;
    justify-items: center;
}

@media (max-width: 900px) {
    .allergy-advice--labeled .allergy-icons,
    #allergy_advice.allergy-advice--labeled .allergy-icons,
    #allergy_advice.allergy-advice--labeled #allergy-icons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.allergy-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-sizing: border-box;
    width: 100%;
    max-width: 88px;
    text-align: center;
}

.allergy-icon.hover_class {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border-radius: 50%;
    opacity: 1;
}

.allergy-icon.hover_class:hover {
    opacity: 1;
    padding: 0 !important;
}

.allergy-icon img {
    display: block;
    width: 20px;
    height: 20px;
}

.allergy-icon-label {
    color: #444;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
}
