/**
 * Frontend Styles for Maca Menu List
 */

/* Category Buttons */
.maca-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

/* Horizontal layout (default) */
.maca-category-buttons.layout-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

/* Vertical layout */
.maca-category-buttons.layout-vertical {
    flex-direction: column;
    flex-wrap: nowrap;
}

.maca-category-buttons.layout-vertical .maca-category-button {
    width: 100%;
}

/* Fit Width layout */
.maca-category-buttons.layout-fit-width {
    flex-direction: row;
    flex-wrap: wrap;
}

.maca-category-buttons.layout-fit-width .maca-category-button {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 150px;
}

/* Fit Height layout */
.maca-category-buttons.layout-fit-height {
    flex-direction: column;
    flex-wrap: nowrap;
    height: 100%;
}

.maca-category-buttons.layout-fit-height .maca-category-button {
    flex: 1;
    min-height: 80px;
}

.maca-category-button {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.maca-category-button:has(.maca-category-thumbnail) {
    padding: 0 25px 0 0;
    min-height: 50px;
    justify-content: flex-start;
}

.maca-category-button:not(:has(.maca-category-thumbnail)) {
    justify-content: center;
    text-align: center;
}

.maca-category-button:hover {
    background: #0073aa;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.maca-category-button:active {
    transform: translateY(-1px);
}

.maca-category-button.active {
    background: #0073aa;
    border-color: #005177;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.maca-category-button:hover .maca-category-name,
.maca-category-button.active .maca-category-name {
    color: #fff;
}

.maca-category-button-content {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
}

.maca-category-thumbnail {
    width: 100px;
    height: 50px;
    object-fit: cover;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 6px 0 0 6px;
    flex-shrink: 0;
}

.maca-category-button:has(.maca-category-thumbnail) .maca-category-name {
    margin-left: 110px;
}

.maca-category-thumbnail-placeholder {
    width: 100px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 6px 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: absolute;
    left: 0;
    top: 0;
}

.maca-category-thumbnail-placeholder .dashicons {
    font-size: 24px;
    color: #666;
}

.maca-category-name {
    color: #0073aa;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Menu Display */
.maca-menu-display {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.maca-menu-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.maca-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Menu Container */
.maca-menu-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.maca-menu-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.maca-menu-schedule-note {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: #fff8e5;
    border-left: 3px solid #dba617;
    color: #5c4a00;
    font-size: 14px;
    line-height: 1.4;
}

/* Menu Image */
.maca-menu-image {
    text-align: center;
    margin: 15px 0;
}

.maca-menu-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* PDF Display */
.maca-pdf-embed {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.maca-pdf-embed iframe {
    display: block;
    border: none;
    width: 100%;
    min-height: 500px;
}

.maca-pdf-fallback {
    margin: 10px 0 0;
    text-align: center;
    font-size: 13px;
}

.maca-pdf-fallback a {
    color: #0073aa;
}

.maca-pdf-js-view .maca-menu-title {
    margin: 0 0 12px;
}

.maca-pdf-js-pages {
    overflow-x: hidden;
}

.maca-pdf-js-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Categories List */
.maca-categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.maca-category-item {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.maca-category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.maca-category-title {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.maca-no-menu {
    color: #666;
    font-style: italic;
    padding: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .maca-category-buttons:not(.maca-filter-bar) {
        flex-direction: column;
    }

    .maca-category-buttons:not(.maca-filter-bar) .maca-category-button {
        width: 100%;
        min-width: auto;
    }
    
    .maca-categories-list {
        grid-template-columns: 1fr;
    }
    
    .maca-pdf-embed iframe {
        height: 70vh;
        min-height: 400px;
    }

    .maca-menu-popup {
        width: 95%;
        max-height: 95%;
    }

    .maca-popup-content {
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .maca-pdf-js-pages canvas {
        max-width: 100%;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .maca-category-button:not(:has(.maca-category-thumbnail)) {
        padding: 12px 20px;
    }

    .maca-category-button:has(.maca-category-thumbnail) {
        padding: 0 20px 0 0;
    }
    
    .maca-category-name {
        font-size: 14px;
    }
    
    .maca-menu-title {
        font-size: 20px;
    }
}

/* Only inline mode uses the area below buttons */
.maca-menulist-wrap[data-display-mode='popup'] .maca-menu-display,
.maca-menulist-wrap[data-display-mode='new_page'] .maca-menu-display {
    display: none !important;
}

.maca-menulist-wrap[data-display-mode='new_page'] .maca-menu-popup,
.maca-menulist-wrap[data-display-mode='new_page'] .maca-popup-overlay {
    display: none !important;
}

/* Close button (website inline / popup – same style as QR menu) */
.maca-menu-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 0;
}

.maca-menu-close:hover,
.maca-menu-close:focus {
    background: #005177;
    color: #fff;
    outline: none;
}

.maca-menu-close--popup {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 20px;
    z-index: 2;
}

/* New-tab / standalone menu viewer */
.maca-menu-close--viewer {
    display: flex !important;
}

.maca-menu-popup .maca-popup-content {
    padding-top: 48px;
}

/* Popup Modal Styles */
.maca-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.maca-popup-overlay.active {
    display: block;
    opacity: 1;
}

.maca-menu-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.maca-menu-popup.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.maca-popup-content {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.maca-popup-content .maca-menu-container {
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.maca-popup-content .maca-menu-title {
    margin-top: 0;
}

@media (max-width: 768px) {
    .maca-menu-popup {
        width: 95%;
        max-height: 95%;
    }
    
    .maca-popup-content {
        padding: 15px;
    }
}

/* Dish menu */
.maca-dish-menu {
    margin: 20px 0;
}

/* Compact horizontal filter bar (dish categories + menu category buttons) */
.maca-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c3c4c7 transparent;
    justify-content: flex-start;
    align-items: center;
}

.maca-filter-bar::-webkit-scrollbar {
    height: 4px;
}

.maca-filter-bar::-webkit-scrollbar-thumb {
    background: #c3c4c7;
    border-radius: 4px;
}

.maca-dish-filters {
    justify-content: flex-start;
    position: sticky;
    top: var(--maca-dm-sticky-offset, 0px);
    z-index: 50;
    background: var(--maca-dm-sticky-bg, #fff);
    padding-top: 4px;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.maca-dish-filters--dropdown {
    display: block;
    position: relative;
    z-index: 80;
    padding: 4px 0 10px;
}

.maca-dish-filters--dropdown.is-stuck {
    padding-top: 6px;
    padding-bottom: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--maca-dm-border, #e5e5e5);
}

.maca-dish-filters--dropdown::after {
    content: '';
    position: absolute;
    right: 14px;
    top: calc(50% - 1px);
    border: 4px solid transparent;
    border-top-color: var(--maca-dm-filter-text, #0073aa);
    pointer-events: none;
}

.maca-dish-category-select {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--maca-dm-filter-border, #0073aa);
    border-radius: 999px;
    background-color: var(--maca-dm-filter-bg, #fff);
    color: var(--maca-dm-filter-text, #0073aa);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.maca-dish-category-select:focus {
    outline: 2px solid var(--maca-dm-filter-border, #0073aa);
    outline-offset: 2px;
}

.maca-dish-category-select option {
    color: #1d2327;
    background-color: #fff;
}

.maca-dish-filters.is-stuck {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.maca-dish-filters-sticky-sentinel {
    height: 1px;
    margin: 0;
    padding: 0;
    pointer-events: none;
    visibility: hidden;
}

.maca-dish-filter,
.maca-filter-bar .maca-category-button,
.maca-filter-bar .category-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #0073aa;
    border-radius: 999px;
    color: #0073aa;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    box-shadow: none;
    min-width: 0;
    width: auto;
    max-width: none;
    min-height: 0;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.maca-dish-filter:hover,
.maca-dish-filter.active,
.maca-filter-bar .maca-category-button:hover,
.maca-filter-bar .maca-category-button.active,
.maca-filter-bar .category-button:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: none;
}

.maca-filter-bar .maca-category-button:active {
    transform: none;
}

.maca-filter-bar .maca-category-button-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 0;
}

.maca-filter-bar .maca-category-button:has(.maca-category-thumbnail),
.maca-filter-bar .maca-category-button:has(.maca-category-thumbnail-placeholder) {
    padding: 3px 10px 3px 3px;
    justify-content: flex-start;
    text-align: left;
}

.maca-filter-bar .maca-category-thumbnail,
.maca-filter-bar .maca-category-thumbnail-placeholder {
    position: static;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
}

.maca-filter-bar .maca-category-thumbnail-placeholder .dashicons {
    font-size: 16px;
}

.maca-filter-bar .maca-category-button:has(.maca-category-thumbnail) .maca-category-name,
.maca-filter-bar .maca-category-button:has(.maca-category-thumbnail-placeholder) .maca-category-name {
    margin-left: 0;
    font-size: 13px;
}

.maca-filter-bar .maca-category-button:hover .maca-category-name,
.maca-filter-bar .maca-category-button.active .maca-category-name {
    color: #fff;
}

.maca-filter-bar .category-button:has(img) {
    padding: 3px 10px 3px 3px;
    text-align: left;
}

.maca-filter-bar .category-button img {
    position: static;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.maca-filter-bar .category-button:has(img) span {
    margin-left: 0;
}

.maca-filter-bar.layout-fit-width .maca-category-button {
    flex: 0 0 auto;
    min-width: 0;
}

.maca-menu-lang-switcher {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
}

.maca-menu-lang-switcher--qr {
    justify-content: center;
    margin-bottom: 16px;
}

.maca-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 4px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.maca-lang-btn:hover {
    opacity: 0.85;
    border-color: #0073aa;
}

.maca-lang-btn.is-active {
    opacity: 1;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.maca-lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    pointer-events: none;
    letter-spacing: 0;
    text-transform: none;
}

.maca-lang-flag svg {
    display: block;
    width: 22px;
    height: auto;
    max-height: 16px;
    border-radius: 1px;
}

.maca-lang-flag--emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
    font-size: 16px;
    line-height: 1;
}

.maca-dish-menu-qr,
.maca-menulist-wrap-qr .maca-dish-menu {
    margin: 0;
}

.maca-dish-category {
    margin-bottom: 32px;
    position: relative;
    z-index: 0;
}

.maca-dish-category-heading {
    position: relative;
    z-index: 2;
    scroll-margin-top: calc(var(--maca-dm-sticky-offset, 0px) + 72px);
}

.maca-dish-category-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
}

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

.maca-dish-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 0;
}

.maca-dish-item:last-child {
    border-bottom: none;
}

.maca-dish-image {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    max-width: 90px;
    min-width: 90px;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}

.maca-dish-image img {
    width: 90px;
    height: 90px;
    max-width: 90px;
    max-height: 90px;
    object-fit: cover;
    display: block;
}

.maca-dish-details {
    flex: 1 1 auto;
    min-width: 0;
}

.maca-dish-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 6px;
}

.maca-dish-title {
    margin: 0;
    flex: 1 1 8rem;
    min-width: 0;
    max-width: 100%;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.maca-dish-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.maca-dish-allergens {
    margin: 6px 0 0;
    font-size: 13px;
    font-style: normal;
    color: #777;
    line-height: 1.4;
}

.maca-dish-allergens-label {
    font-style: normal !important;
    font-weight: 700;
    color: #666;
}

.maca-dish-allergens-list {
    font-style: italic;
    font-weight: normal;
}

.maca-dish-rating {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.maca-dish-rating-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.maca-dish-rating-stars {
    display: inline-flex;
    gap: 2px;
}

.maca-dish-rating-star {
    border: 0;
    background: transparent;
    padding: 0 1px;
    font-size: 22px;
    line-height: 1;
    color: #ccc;
    cursor: pointer;
}

.maca-dish-rating-star:hover,
.maca-dish-rating-star:focus-visible {
    color: #f5a623;
    outline: none;
}

.maca-dish-rating-star.is-active,
.maca-dish-rating-star.is-hover {
    color: #f5a623;
}

.maca-dish-rating-meta {
    font-size: 13px;
    color: #777;
}

.maca-dish-rating-meta--empty {
    display: none;
}

.maca-dish-rating-average {
    font-weight: 700;
    color: #0073aa;
    margin-right: 4px;
}

.maca-dish-rating.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.maca-dish-price {
    flex: 0 0 auto;
    max-width: 100%;
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
    white-space: nowrap;
    text-align: right;
    padding-top: 2px;
    margin-left: auto;
}

.maca-dish-item:not(:has(.maca-dish-image)) .maca-dish-details {
    padding-left: 0;
}

.maca-dish-image--clickable .maca-dish-image-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    line-height: 0;
}

.maca-dish-image--clickable .maca-dish-image-button:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

body.maca-dish-lightbox-open {
    overflow: hidden;
}

.maca-dish-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.maca-dish-lightbox[hidden] {
    display: none !important;
}

.maca-dish-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.maca-dish-lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 900px);
    max-height: 92vh;
}

.maca-dish-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.maca-dish-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.maca-dish-lightbox-close:hover {
    background: #f0f0f0;
}

.maca-dishes-empty {
    text-align: center;
    color: #666;
    padding: 20px 0;
}

.maca-dish-order-actions {
    margin-top: 10px;
}

.maca-dish-add-to-order {
    padding: 6px 14px;
    border: 2px solid #0073aa;
    border-radius: 999px;
    background: #fff;
    color: #0073aa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.maca-dish-add-to-order:hover,
.maca-dish-add-to-order:focus-visible {
    background: #0073aa;
    color: #fff;
    outline: none;
}

.maca-dish-add-to-order.is-added {
    background: #0073aa;
    color: #fff;
}

body.maca-table-order-active {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.maca-table-order-root {
    position: relative;
    z-index: 99990;
}

.maca-table-order-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #ddd;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.maca-table-order-bar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: 999px;
    background: #0073aa;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.maca-table-order-bar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 14px;
}

.maca-table-order-overlay {
    position: fixed;
    inset: 0;
    z-index: 99991;
    background: rgba(0, 0, 0, 0.45);
}

.maca-table-order-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99992;
    max-height: min(92dvh, 92vh);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
}

.maca-table-order-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
}

.maca-table-order-panel-header h2 {
    margin: 0;
    font-size: 20px;
}

.maca-table-order-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f0f0f0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.maca-table-order-panel-body {
    overflow-y: auto;
    padding: 16px 18px;
}

.maca-table-order-field {
    display: block;
    margin-bottom: 16px;
}

.maca-table-order-field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.maca-table-order-table-select,
.maca-table-order-table-input,
.maca-table-order-note-input,
.maca-table-order-line-note {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.maca-table-order-table-select:disabled,
.maca-table-order-table-select.is-locked {
    opacity: 1;
    color: #1d2327;
    background: #f6f7f7;
    cursor: not-allowed;
}

.maca-table-order-table-locked-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #646970;
}

.maca-table-order-lines {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.maca-table-order-empty {
    margin: 0 0 16px;
    color: #777;
    text-align: center;
}

.maca-table-order-line {
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

.maca-table-order-line-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.maca-table-order-line-title {
    font-weight: 600;
    color: #222;
}

.maca-table-order-line-price {
    white-space: nowrap;
    color: #0073aa;
    font-weight: 600;
}

.maca-table-order-line-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.maca-table-order-qty-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #0073aa;
    border-radius: 50%;
    background: #fff;
    color: #0073aa;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.maca-table-order-qty {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

.maca-table-order-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: transparent;
    color: #666;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.maca-table-order-remove:hover,
.maca-table-order-remove:focus-visible {
    color: #0073aa;
    border-color: #0073aa;
    background: #f7f8fa;
    outline: none;
}

.maca-table-order-remove-icon {
    display: inline-flex;
    line-height: 0;
}

.maca-table-order-remove-icon svg {
    display: block;
}

.maca-table-order-line-note-label {
    display: block;
    margin-top: 8px;
}

.maca-table-order-line-note-label > span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #777;
}

.maca-table-order-total-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 2px solid #0073aa;
    font-size: 18px;
}

.maca-table-order-panel-footer {
    display: flex;
    gap: 10px;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.maca-table-order-clear,
.maca-table-order-show-waiter {
    flex: 1 1 auto;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.maca-table-order-clear {
    border: 1px solid #ccc;
    background: #fff;
    color: #444;
}

.maca-table-order-show-waiter {
    border: 0;
    background: #0073aa;
    color: #fff;
}

.maca-table-order-waiter {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;
    overflow-y: auto;
}

.maca-table-order-waiter-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px 32px;
}

.maca-table-order-waiter-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #0073aa;
}

.maca-table-order-waiter-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.maca-table-order-waiter-table {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0073aa;
}

.maca-table-order-waiter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.maca-table-order-waiter-item {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.maca-table-order-waiter-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 20px;
    line-height: 1.35;
}

.maca-table-order-waiter-qty {
    font-weight: 700;
    color: #0073aa;
    min-width: 2.5em;
}

.maca-table-order-waiter-title {
    flex: 1 1 auto;
    font-weight: 600;
}

.maca-table-order-waiter-price {
    white-space: nowrap;
    color: #666;
    font-size: 16px;
}

.maca-table-order-waiter-note {
    margin: 6px 0 0 3.5em;
    font-size: 16px;
    color: #666;
    font-style: italic;
}

.maca-table-order-waiter-order-note,
.maca-table-order-waiter-total {
    margin: 20px 0 0;
    font-size: 18px;
    line-height: 1.5;
}

.maca-table-order-back {
    display: block;
    width: 100%;
    margin-top: 28px;
    padding: 14px 18px;
    border: 0;
    border-radius: 8px;
    background: #0073aa;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.maca-table-order-sent-banner {
    margin: 0 0 20px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.maca-guest-order-status {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #fff;
    overflow-y: auto;
}

.maca-table-order-panel[hidden],
.maca-guest-order-status[hidden] {
    display: none !important;
}

.maca-guest-order-status-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding:
        calc(52px + env(safe-area-inset-top, 0px))
        20px
        calc(24px + env(safe-area-inset-bottom, 0px));
}

.maca-guest-order-status-dismiss {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 100001;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f0f0;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.maca-guest-order-status-dismiss:hover,
.maca-guest-order-status-dismiss:focus-visible {
    background: #e4e4e4;
    outline: none;
}

.maca-guest-order-status-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.maca-guest-order-status-table {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.maca-guest-order-status-hint {
    margin: 0 0 20px;
    color: #666;
    font-size: 15px;
}

.maca-guest-order-status-all-paid {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #edfaef;
    border: 1px solid #46b450;
    color: #1e4620;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.maca-guest-order-status-all-paid[hidden] {
    display: none;
}

.maca-guest-order-status-steps {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.maca-guest-order-status-steps li {
    position: relative;
    margin: 0 0 14px;
    padding: 12px 14px 12px 42px;
    border-radius: 10px;
    background: #f5f5f5;
    color: #888;
    font-size: 16px;
}

.maca-guest-order-status-steps li::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    background: #ccc;
}

.maca-guest-order-status-steps li.is-done {
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 600;
}

.maca-guest-order-status-steps li.is-done::before {
    background: #2e7d32;
}

.maca-guest-order-status-steps li.is-current {
    background: #e3f2fd;
    color: #0d47a1;
    font-weight: 700;
}

.maca-guest-order-status-steps li.is-current::before {
    background: #1565c0;
    box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.2);
}

.maca-guest-order-status-message {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.maca-guest-order-status-eta {
    margin: 0 0 16px;
    padding: 12px;
    border-radius: 8px;
    background: #fff8e1;
    color: #e65100;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.maca-guest-order-status-lines {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    border-top: 1px solid #eee;
}

.maca-guest-order-status-lines li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.maca-guest-order-status-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.maca-guest-order-more {
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: #2e7d32;
    color: #fff;
}

.maca-guest-order-share-qr,
.maca-guest-share-qr-inline {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #1565c0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: #fff;
    color: #1565c0;
}

.maca-guest-share-qr-prompt {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.maca-guest-share-qr-prompt-text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.45;
    color: #555;
}

.maca-guest-share-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.maca-guest-share-qr-modal[hidden] {
    display: none !important;
}

.maca-guest-share-qr-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.maca-guest-share-qr-modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.maca-guest-share-qr-modal-panel h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.maca-guest-share-qr-hint {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.45;
    color: #555;
}

.maca-guest-share-qr-image {
    display: block;
    width: 220px;
    height: 220px;
    margin: 0 auto 16px;
    border-radius: 8px;
    background: #fff;
}

.maca-guest-share-qr-close {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: #f5f5f5;
    color: #333;
}

body.maca-guest-share-qr-open {
    overflow: hidden;
}

.maca-guest-order-status-orders {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.maca-guest-order-status-combined {
    margin-top: 16px;
}

.maca-guest-combined-payment {
    padding: 16px;
    border: 2px solid #2e7d32;
    border-radius: 12px;
    background: #f1f8e9;
}

.maca-guest-combined-payment-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.maca-guest-combined-payment-count {
    margin: 0 0 12px;
    color: #555;
}

.maca-guest-order-card-subtotal,
.maca-guest-order-card-paid {
    margin: 12px 0 0;
    font-weight: 600;
}

.maca-guest-order-card {
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
}

.maca-guest-order-card-title {
    margin: 0 0 8px;
    font-size: 18px;
}

.maca-guest-order-card-status,
.maca-guest-order-card-message {
    margin: 0 0 12px;
    font-weight: 600;
}

.maca-guest-order-payment {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e0e0e0;
}

.maca-guest-order-payment-total {
    margin: 0 0 10px;
    font-size: 17px;
}

.maca-guest-order-payment-message,
.maca-guest-order-payment-wait,
.maca-guest-order-payment-manual,
.maca-guest-order-payment-done,
.maca-guest-order-payment-summary {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.45;
}

.maca-guest-order-payment-done,
.maca-guest-order-payment-summary {
    color: #1b5e20;
    font-weight: 700;
}

.maca-staff-order-payment-summary {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: #1b5e20;
}

.maca-order-payment-transactions,
.maca-staff-order-payment-transactions,
.maca-guest-order-payment-transactions {
    margin: 10px 0 0;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.maca-order-payment-transactions ul,
.maca-staff-order-payment-transactions-list,
.maca-guest-order-payment-transactions-list {
    margin: 8px 0 0;
    padding-left: 1.2em;
}

.maca-order-payment-transactions li,
.maca-staff-order-payment-transactions-list li,
.maca-guest-order-payment-transactions-list li {
    margin: 0 0 8px;
}

.maca-order-payment-external-id,
.maca-staff-order-payment-transactions-list code {
    font-size: 12px;
    word-break: break-all;
}

.maca-guest-order-payment-transactions-summary {
    margin: 0 0 6px;
    font-size: 14px;
}

.maca-guest-bill-split {
    margin: 0 0 14px;
}

.maca-guest-bill-split--inactive {
    margin-top: 4px;
}

.maca-guest-bill-split-toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: 1px dashed #7a8f9f;
    border-radius: 10px;
    background: #fff;
    color: #1a4d6d;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.maca-guest-bill-split-toggle:hover,
.maca-guest-bill-split-toggle:focus-visible {
    background: #f3f8fb;
    border-color: #1a4d6d;
    outline: none;
}

.maca-guest-bill-split--inactive.is-open .maca-guest-bill-split-toggle {
    margin-bottom: 10px;
    border-style: solid;
    background: #f3f6f9;
}

.maca-guest-bill-split-body {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f3f6f9;
    border: 1px solid #d8e0e8;
}

.maca-guest-bill-split--inactive .maca-guest-bill-split-body[hidden] {
    display: none;
}

.maca-guest-bill-split-title {
    margin: 0 0 6px;
}

.maca-guest-bill-split-hint,
.maca-guest-bill-split-active,
.maca-guest-bill-split-share,
.maca-guest-bill-split-progress {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
}

.maca-guest-bill-split-share {
    font-weight: 700;
    color: #1b5e20;
}

.maca-guest-bill-split-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 14px;
}

.maca-guest-bill-split-count {
    max-width: 120px;
}

.maca-guest-bill-split-modes {
    border: 0;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maca-guest-bill-split-mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.maca-guest-bill-split-panel {
    margin-bottom: 10px;
}

.maca-guest-bill-split-total-hint {
    margin: 4px 0 0;
    font-size: 13px;
    color: #5c6570;
}

.maca-guest-bill-split-fixed-amount {
    max-width: 160px;
}

.maca-guest-bill-split-apply,
.maca-guest-bill-split-clear {
    margin-top: 8px;
}

.maca-guest-bill-split-clear + .maca-guest-bill-split-apply,
.maca-guest-bill-split-apply + .maca-guest-bill-split-clear {
    margin-top: 10px;
}

.maca-guest-order-tips {
    margin: 12px 0;
}

.maca-guest-order-tip-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.maca-guest-order-tips-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.maca-guest-tip-select {
    width: 100%;
    max-width: 100%;
    padding: 12px 36px 12px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
}

.maca-guest-tip-select:disabled {
    opacity: 0.75;
    cursor: default;
    background-color: #f5f5f5;
}

.maca-guest-tip-custom {
    margin-top: 8px;
}

.maca-guest-tip-custom-label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.maca-guest-tip-custom-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.maca-guest-tip-custom-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.maca-guest-tip-custom-apply {
    flex-shrink: 0;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #1565c0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.maca-guest-tip-custom-apply:disabled,
.maca-guest-tip-custom-input:disabled {
    opacity: 0.65;
    cursor: default;
}

@media (min-width: 480px) {
    .maca-guest-order-tip-field {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .maca-guest-order-tips-title {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .maca-guest-tip-select {
        flex: 1 1 auto;
    }
}

.maca-guest-order-payment-actions--locked .maca-guest-pay-online,
.maca-guest-order-payment-actions--locked .maca-guest-pay-waiter,
.maca-guest-order-payment-actions--locked .maca-guest-pay-combined-online,
.maca-guest-order-payment-actions--locked .maca-guest-pay-combined-waiter {
    opacity: 0.55;
}

.maca-guest-order-payment-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maca-guest-order-payment-email {
    margin: 12px 0;
}

.maca-guest-confirmation-email-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
}

.maca-guest-confirmation-email-label input {
    margin-top: 3px;
}

.maca-guest-confirmation-email-input {
    display: block;
    width: 100%;
    max-width: 320px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.maca-guest-confirmation-email-input[hidden] {
    display: none !important;
}

.maca-guest-pay-online,
.maca-guest-pay-waiter,
.maca-guest-pay-combined-online,
.maca-guest-pay-combined-waiter {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 52px;
    padding: 18px 20px;
    border: 0;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.maca-guest-pay-online,
.maca-guest-pay-combined-online {
    background: #1565c0;
    color: #fff;
}

.maca-guest-pay-waiter,
.maca-guest-pay-combined-waiter {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ccc;
}

.maca-guest-order-status-message--success {
    color: #1b5e20;
    background: #e8f5e9;
    padding: 12px;
    border-radius: 8px;
}

.maca-guest-order-status-message--cancel {
    color: #5d4037;
    background: #fff8e1;
    padding: 12px;
    border-radius: 8px;
}

.maca-staff-order-payment-badge {
    display: inline-block;
    margin-top: 6px;
    margin-left: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff3e0;
    color: #e65100;
    font-size: 12px;
    font-weight: 700;
}

.maca-staff-order-payment-badge--manual {
    background: #fce4ec;
    color: #880e4f;
}

.maca-staff-order-payment-badge--paid {
    background: #e8f5e9;
    color: #1b5e20;
}

.maca-staff-order-payment-badge--partial,
.maca-staff-order-payment-summary--partial {
    background: #fff8e1;
    color: #e65100;
}

.maca-staff-order-card--payment-partial {
    border-left-color: #ff9800;
}

.maca-kds-card-paid--partial {
    background: #fff8e1;
    color: #e65100;
}

.maca-staff-order-payment-badge--pending {
    background: #e3f2fd;
    color: #0d47a1;
}

.maca-staff-order-payment-total {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 700;
}

.maca-staff-order-payment-receipt {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 13px;
    line-height: 1.45;
}

.maca-staff-order-payment-receipt p {
    margin: 0 0 6px;
}

.maca-staff-order-payment-receipt p:last-child {
    margin-bottom: 0;
}

.maca-staff-order-payment-id code {
    font-size: 11px;
    word-break: break-all;
}

.maca-staff-order-card--payment-paid {
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.35);
}

.maca-staff-orders-page--kitchen .maca-staff-order-payment-receipt {
    background: #2a2a2a;
    color: #eee;
}

.maca-guest-order-session-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 99998;
}

.maca-guest-order-session-button {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 999px;
    background: #1565c0;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.maca-table-order-waiter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.maca-table-order-more,
.maca-table-order-back {
    width: 100%;
}

.maca-table-order-more {
    padding: 14px 16px;
    border: 0;
    border-radius: 8px;
    background: #2e7d32;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.maca-table-order-waiter-batch {
    margin-bottom: 20px;
}

.maca-table-order-waiter-batch-title {
    margin: 0 0 10px;
    font-size: 18px;
}

body.maca-guest-order-status-open {
    overflow: hidden;
}

.maca-staff-order-status-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e3f2fd;
    color: #0d47a1;
    font-size: 13px;
    font-weight: 700;
}

.maca-staff-orders-page--kitchen .maca-staff-order-status-badge {
    background: #333;
    color: #fff;
}

.maca-staff-order-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.maca-staff-order-action {
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #0073aa;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.maca-staff-orders-page--kitchen .maca-staff-order-action {
    background: #f9a825;
    color: #1f1f1f;
}

.maca-staff-order-card--ready {
    border-left: 4px solid #f9a825;
}

.maca-staff-order-card--served {
    border-left: 4px solid #43a047;
}

.maca-staff-order-card--paid {
    border-left: 4px solid #1565c0;
    opacity: 0.92;
}

.maca-staff-orders-page {
    margin: 0;
    background: #f3f4f6;
    font-family: Arial, sans-serif;
}

.maca-staff-table-board-hint {
    margin: 0 0 1rem;
    color: #4b5563;
    font-size: 0.95rem;
}

.maca-staff-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem;
}

.maca-staff-table-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-height: 5.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    background: #fff;
    color: #111827;
    text-align: left;
    cursor: pointer;
}

.maca-staff-table-tile--ready {
    border-color: #f59e0b;
    box-shadow: inset 0 0 0 1px #f59e0b;
}

.maca-staff-table-tile--new {
    border-color: #2563eb;
}

.maca-staff-table-tile-label {
    font-size: 1.1rem;
    font-weight: 700;
}

.maca-staff-table-tile-count {
    font-size: 0.85rem;
    color: #6b7280;
}

.maca-staff-table-tile-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #b45309;
}

.maca-staff-table-back {
    margin: 0 0 1rem;
    padding: 0.55rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    cursor: pointer;
}

.maca-staff-table-detail-title {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.maca-staff-table-detail-status {
    margin: 0 0 1rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.maca-staff-table-detail-status:not([hidden]) {
    display: block;
}

.maca-staff-orders-page--kitchen {
    background: #1f1f1f;
    color: #fff;
}

.maca-staff-orders-app {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.maca-staff-orders-pin,
.maca-booking-staff-pin {
    max-width: 360px;
    margin: 60px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.maca-booking-staff-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.maca-booking-staff-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.maca-booking-staff-tab {
    padding: 8px 14px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #f6f7f7;
    cursor: pointer;
}

.maca-booking-staff-tab.is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.maca-booking-staff-pin-input {
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    box-sizing: border-box;
}

.maca-booking-staff-pin-error {
    color: #b32d2e;
    margin-top: 10px;
}

.maca-staff-orders-page--kitchen .maca-staff-orders-pin {
    background: #2d2d2d;
    color: #fff;
}

.maca-staff-orders-pin-input {
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    box-sizing: border-box;
}

.maca-staff-orders-unlock {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #0073aa;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.maca-staff-orders-pin-error {
    color: #b32d2e;
    margin-top: 10px;
}

.maca-staff-orders-board-header {
    margin-bottom: 20px;
}

.maca-staff-orders-board-header h1,
.maca-staff-orders-heading {
    margin: 0 0 6px;
}

.maca-staff-orders-heading--waiter {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.maca-staff-waiter-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 10px;
}

.maca-staff-waiter-filter-label {
    font-weight: 600;
}

.maca-staff-waiter-filter-select {
    min-width: 12rem;
    max-width: 100%;
    padding: 0.35rem 0.5rem;
}

.maca-staff-orders-status {
    margin: 0;
    color: #666;
}

.maca-staff-orders-page--kitchen .maca-staff-orders-status {
    color: #ccc;
}

.maca-staff-orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.maca-staff-orders-empty {
    text-align: center;
    color: #777;
    padding: 40px 0;
}

.maca-staff-orders-page--kitchen .maca-staff-orders-empty {
    color: #bbb;
}

.maca-staff-order-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #0073aa;
}

.maca-staff-orders-page--kitchen .maca-staff-order-card {
    background: #2d2d2d;
    border-left-color: #ffb347;
}

.maca-staff-order-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.maca-staff-order-table {
    margin: 0;
    font-size: 24px;
}

.maca-staff-order-table-change {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 4px;
}

.maca-staff-order-table-change-label {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.maca-staff-order-table-change-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.maca-staff-order-table-select,
.maca-staff-order-table-input {
    min-width: 72px;
    max-width: 120px;
    padding: 8px 10px;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    background: #fff;
}

.maca-staff-order-table-save {
    padding: 8px 12px;
    font-size: 13px;
}

.maca-staff-orders-page--kitchen .maca-staff-order-table-change-label {
    font-size: 30px;
}

.maca-staff-orders-page--kitchen .maca-staff-order-table-select,
.maca-staff-orders-page--kitchen .maca-staff-order-table-input {
    border-color: #555;
    background: #2a2a2a;
    color: #fff;
}

.maca-staff-orders-page--kitchen .maca-staff-order-table {
    font-size: 30px;
}

.maca-staff-order-time {
    margin: 4px 0 0;
    color: #777;
    font-size: 14px;
}

.maca-staff-orders-page--kitchen .maca-staff-order-time {
    color: #bbb;
}

.maca-staff-order-handle {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #0073aa;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.maca-staff-orders-page--kitchen .maca-staff-order-handle {
    background: #ffb347;
    color: #1f1f1f;
}

.maca-staff-order-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.maca-staff-order-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    font-size: 18px;
}

.maca-staff-orders-page--kitchen .maca-staff-order-line {
    font-size: 24px;
}

.maca-staff-order-qty {
    font-weight: 700;
    color: #0073aa;
    min-width: 2.5em;
}

.maca-staff-orders-page--kitchen .maca-staff-order-qty {
    color: #ffb347;
}

.maca-staff-order-title {
    flex: 1 1 auto;
    font-weight: 600;
    min-width: 0;
}

.maca-staff-order-prices {
    display: flex;
    flex: 0 0 auto;
    gap: 16px;
    margin-left: auto;
}

.maca-staff-order-unit-price,
.maca-staff-order-line-total {
    min-width: 5em;
    text-align: right;
    white-space: nowrap;
    color: #666;
}

.maca-staff-order-line-total {
    font-weight: 700;
    color: #333;
}

.maca-staff-order-line--header {
    padding-top: 0;
    padding-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    border-bottom: 1px solid #e5e5e5;
}

.maca-staff-order-line--header .maca-staff-order-unit-price,
.maca-staff-order-line--header .maca-staff-order-line-total {
    font-weight: 600;
    color: #888;
}

.maca-staff-order-price {
    white-space: nowrap;
    color: #666;
}

.maca-staff-order-line-note {
    list-style: none;
    margin: 0 0 8px 3.5em;
    font-size: 15px;
    color: #666;
    font-style: italic;
}

.maca-staff-orders-page--kitchen .maca-staff-order-line-note {
    color: #ddd;
    font-size: 18px;
}

.maca-staff-order-note,
.maca-staff-order-total {
    margin: 12px 0 0;
    font-size: 16px;
}

.maca-staff-order-action--guest-qr {
    background: #f0f6fc;
    border-color: #72aee6;
    color: #1d4ed8;
}

.maca-staff-guest-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.maca-staff-guest-qr-modal[hidden] {
    display: none !important;
}

.maca-staff-guest-qr-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.maca-staff-guest-qr-modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    padding: 22px 20px 18px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    text-align: center;
}

.maca-staff-guest-qr-modal-panel h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.maca-staff-guest-qr-hint {
    margin: 0 0 16px;
    color: #50575e;
    font-size: 0.92rem;
    line-height: 1.45;
}

.maca-staff-guest-qr-image {
    display: block;
    width: 220px;
    height: 220px;
    margin: 0 auto 16px;
    border-radius: 8px;
    background: #fff;
}

.maca-staff-guest-qr-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #2271b1;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

body.maca-staff-guest-qr-open {
    overflow: hidden;
}

.maca-staff-orders-page--kitchen .maca-staff-order-action--guest-qr,
.maca-kds-card-action.maca-staff-order-action--guest-qr {
    margin-top: 8px;
}

@media (max-width: 600px) {
    .maca-dish-image {
        flex: 0 0 70px;
        width: 70px;
        height: 70px;
        max-width: 70px;
        min-width: 70px;
    }

    .maca-dish-image img {
        width: 70px;
        height: 70px;
        max-width: 70px;
        max-height: 70px;
    }

    /* Rows + image: title left, thumbnail + price stacked on the right */
    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 70px;
        column-gap: 12px;
        row-gap: 6px;
        align-items: start;
    }

    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-details,
    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-header {
        display: contents;
    }

    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-image {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
    }

    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-title {
        grid-column: 1;
        grid-row: 1;
        flex: none;
        width: auto;
        font-size: 17px;
        margin-bottom: 0;
    }

    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-price {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        align-self: start;
        width: 70px;
        max-width: 70px;
        margin-left: 0;
        padding-top: 4px;
        line-height: 1.2;
        text-align: right;
        white-space: nowrap;
    }

    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-description,
    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-allergens,
    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-rating,
    .maca-dish-menu-shell--layout-rows .maca-dish-item:has(.maca-dish-image) .maca-dish-order-actions {
        grid-column: 1;
    }

    /* Grid cards: image on top, title + price in header as before */
    .maca-dish-menu-shell--layout-grid .maca-dish-item:has(.maca-dish-image) .maca-dish-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .maca-dish-menu-shell--layout-grid .maca-dish-item:has(.maca-dish-image) .maca-dish-title {
        flex: 1 1 8rem;
        width: auto;
    }

    .maca-dish-menu-shell--layout-grid .maca-dish-item:has(.maca-dish-image) .maca-dish-price {
        align-self: auto;
        width: auto;
        max-width: none;
        text-align: right;
        white-space: nowrap;
    }

    .maca-table-order-bar {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .maca-table-order-bar-button {
        min-height: 52px;
        padding: 12px 16px;
        font-size: 15px;
    }

    .maca-table-order-bar-label {
        line-height: 1.2;
        text-align: left;
    }

    body.maca-table-order-active {
        padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    }

    body.maca-table-order-panel-open {
        overflow: hidden;
    }

    .maca-table-order-panel-body {
        max-height: calc(100dvh - 220px - env(safe-area-inset-bottom, 0px));
    }
}

/* Table booking (bordsbokning) */
.maca-table-booking-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #fff8e5;
    border: 1px solid #e6d28a;
    border-radius: 6px;
    font-size: 14px;
}

.maca-table-booking-trigger {
    cursor: pointer;
    min-width: 220px;
    justify-content: center;
    text-align: center;
}

.maca-table-booking-trigger .maca-category-name {
    color: #0073aa;
}

.maca-table-booking-trigger:hover .maca-category-name,
.maca-table-booking-trigger:focus .maca-category-name {
    color: #fff;
}

.maca-table-booking-submit {
    width: 100%;
    cursor: pointer;
}

.maca-table-booking-submit .maca-category-name {
    color: #0073aa;
}

.maca-table-booking-submit:hover:not([disabled]) .maca-category-name,
.maca-table-booking-submit:focus:not([disabled]) .maca-category-name {
    color: #fff;
}

.maca-table-booking-submit[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.maca-table-booking-modal[hidden] {
    display: none !important;
}

.maca-table-booking-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    padding: 16px;
    overflow: hidden;
    overscroll-behavior: contain;
}

.maca-table-booking-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.maca-table-booking-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    min-width: 0;
    flex: 0 0 auto;
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.maca-table-booking-form {
    width: 100%;
    min-width: 0;
}

body.maca-booking-modal-open {
    overflow: hidden;
}

.maca-table-booking-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
}

.maca-table-booking-title {
    margin: 0 0 20px;
    font-size: 1.4rem;
}

.maca-booking-field {
    margin-bottom: 16px;
}

.maca-booking-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.maca-booking-field input,
.maca-booking-field select,
.maca-booking-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
}

.maca-booking-auto-table-note {
    margin: 6px 0 0;
    font-size: 0.9em;
    color: #50575e;
}

.maca-booking-arrival-notice {
    margin: 4px 0 16px;
    padding: 10px 12px;
    font-size: 0.9em;
    line-height: 1.45;
    color: #50575e;
    background: #f6f7f7;
    border-left: 3px solid #0073aa;
    border-radius: 0 6px 6px 0;
}

.maca-booking-tables {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.maca-booking-table-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    cursor: pointer;
    word-break: break-word;
}

.maca-booking-table-option:has(input:checked) {
    border-color: #0073aa;
    background: #f0f6fc;
}

.maca-booking-message {
    padding: 10px 12px;
    border-radius: 6px;
}

.maca-booking-message.maca-booking-success {
    background: #edfaef;
    color: #1e4620;
}

.maca-booking-message.maca-booking-error {
    background: #fcf0f1;
    color: #8a1f1f;
}

@media (max-width: 768px) {
    .maca-table-booking-modal {
        padding: 12px;
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        align-items: center;
    }

    .maca-table-booking-panel {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        padding: 20px 16px;
    }

    .maca-booking-field input,
    .maca-booking-field select,
    .maca-booking-field textarea {
        font-size: 16px;
    }

    .maca-booking-captcha {
        max-width: 100%;
        overflow: hidden;
    }
}

.maca-bookings-wrap .maca-booking-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.maca-bookings-wrap .maca-booking-status-pending {
    background: #fff8e5;
    color: #8a6d00;
}

.maca-bookings-wrap .maca-booking-status-confirmed {
    background: #edfaef;
    color: #1e4620;
}

.maca-bookings-wrap .maca-booking-status-cancelled {
    background: #f0f0f1;
    color: #50575e;
}

.maca-bookings-section {
    margin: 28px 0 0;
}

.maca-bookings-section-pending {
    padding: 16px 18px 18px;
    background: #fff8e5;
    border: 1px solid #f0d78c;
    border-radius: 8px;
}

.maca-bookings-section-day {
    padding-top: 8px;
}

.maca-bookings-section-title {
    margin: 0 0 8px;
    font-size: 1.2em;
}

.maca-bookings-section-title .count {
    color: #646970;
    font-weight: 400;
    font-size: 0.9em;
}

.maca-bookings-day-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.maca-bookings-day-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.maca-bookings-day-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.maca-bookings-day-filter input[type="date"] {
    min-height: 30px;
}

.maca-bookings-archive-link {
    margin-top: 24px;
}

.maca-bookings-list-table {
    margin-top: 10px;
}

.maca-bookings-availability-table {
    margin-top: 12px;
}

.maca-bookings-availability {
    position: relative;
    min-height: 280px;
}

.maca-bookings-availability-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 260px;
    padding: 32px 16px;
    color: #50575e;
    text-align: center;
}

.maca-bookings-availability-loading[hidden],
.maca-bookings-availability.is-loaded .maca-bookings-availability-loading {
    display: none !important;
}

.maca-bookings-availability:not(.is-loaded) .maca-bookings-availability-content {
    display: none !important;
}

.maca-bookings-availability-loading .spinner {
    visibility: visible;
    float: none;
    margin: 0;
}

.maca-bookings-availability-message {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 6px;
    color: #8a1f1f;
    background: #fdeaea;
}

.maca-bookings-availability-today {
    background: #f0f6fc;
}

.maca-bookings-today-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.maca-booking-availability-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.maca-booking-availability-status-open {
    background: #edfaef;
    color: #1e4620;
}

.maca-booking-occupancy {
    display: inline-block;
    min-width: 3.5em;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.maca-booking-occupancy-low {
    background: #edfaef;
    color: #1e4620;
}

.maca-booking-occupancy-medium {
    background: #fcf9e8;
    color: #6d4c00;
}

.maca-booking-occupancy-high {
    background: #fcf0f1;
    color: #8a2424;
}

.maca-booking-availability-status-closed,
.maca-booking-availability-status-no_tables {
    background: #f0f0f1;
    color: #50575e;
}

.maca-booking-availability-status-fully_booked,
.maca-booking-availability-status-full {
    background: #fdeaea;
    color: #8a1f1f;
}

/* Admin: floor overview (table booking) */
.maca-booking-floor {
    margin-top: 16px;
}

.maca-booking-floor-top-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.maca-booking-floor-add-panel {
    margin: 0 0 20px;
    padding: 16px 18px;
    max-width: 520px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.maca-booking-floor-add-title {
    margin: 0 0 8px;
    font-size: 1.1em;
}

.maca-booking-floor-add-form p {
    margin: 0 0 12px;
}

.maca-booking-floor-add-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.maca-booking-floor-link-bookings {
    font-weight: 600;
}

.maca-booking-floor-slot-hint {
    margin-top: 0;
}

.maca-booking-floor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 28px;
    align-items: flex-end;
    margin: 20px 0 12px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.maca-booking-floor-field-occupancy .maca-booking-floor-occupancy-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.maca-booking-floor-day-occupancy {
    font-size: 15px;
    min-width: 6em;
}

.maca-booking-floor-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.maca-booking-floor-date {
    min-width: 160px;
}

.maca-booking-floor-field-time {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 420px;
}

.maca-booking-floor-time-label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.maca-booking-floor-time {
    width: 100%;
    margin: 0;
}

.maca-booking-floor-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-left: auto;
    font-size: 13px;
}

.maca-booking-floor-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.maca-booking-floor-summary {
    margin: 0 0 8px;
    font-weight: 600;
}

.maca-booking-floor-message {
    margin: 0 0 12px;
    color: #50575e;
}

.maca-booking-floor-message.is-error {
    color: #b32d2e;
}

.maca-booking-floor-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.maca-booking-floor-queue {
    flex: 0 0 220px;
    max-width: min(100%, 280px);
    padding: 12px 14px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #f6f7f7;
}

.maca-booking-floor-queue-title {
    margin: 0 0 6px;
    font-size: 14px;
}

.maca-booking-floor-queue-hint {
    margin: 0 0 10px;
}

.maca-booking-floor-queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maca-booking-floor-queue-item {
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
}

.maca-booking-floor-queue-item .maca-booking-floor-drag {
    cursor: grab;
}

.maca-booking-floor-queue-item .maca-booking-floor-drag:active {
    cursor: grabbing;
}

.maca-booking-floor-queue-view {
    margin-top: 6px;
    padding: 0 !important;
    min-height: 0;
}

.maca-booking-floor-queue-empty {
    margin: 0;
    color: #50575e;
    font-size: 13px;
}

.maca-booking-floor-queue-item-waitlist {
    border-left: 3px solid #996800;
}

.maca-booking-floor-card-status-muted {
    color: #646970;
    font-size: 11px;
    font-weight: 500;
}

.maca-booking-floor-card-requested-time {
    font-weight: 600;
}

.maca-booking-floor-card-status-place-hint {
    color: #135e96;
    font-size: 11px;
    font-weight: 600;
}

.maca-booking-floor-layout .maca-booking-floor-grid {
    flex: 1 1 320px;
    min-width: 0;
}

.maca-booking-floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.maca-booking-floor-grid.is-floor-drag-active {
    user-select: none;
}

.maca-booking-floor-grid.is-floor-drag-active .maca-booking-floor-card.is-available.is-drop-target {
    cursor: copy;
}

.maca-booking-floor-loading,
.maca-booking-floor-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #50575e;
}

.maca-booking-floor-card {
    padding: 14px 12px 12px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.maca-booking-floor-card.is-floor-bookable {
    cursor: pointer;
}

.maca-booking-floor-card.is-floor-book-selected {
    outline: 3px solid #2271b1;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #2271b1;
}

.maca-booking-floor-book-hint {
    margin: 8px 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: #007017;
}

.maca-booking-floor-card.is-partial .maca-booking-floor-book-hint {
    color: #9a6700;
}

.maca-booking-floor-card.is-available {
    border-color: #46b450;
    background: #f6fff7;
}

.maca-booking-floor-card.is-available.is-drop-target {
    border-style: dashed;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(70, 180, 80, 0.25);
}

.maca-booking-floor-card.is-available.is-drag-over {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.35);
    transform: scale(1.02);
}

.maca-booking-floor-card.is-occupied.is-dragging {
    opacity: 0.55;
}

.maca-booking-floor-card.is-occupied {
    border-color: #d63638;
    background: #fff5f5;
}

.maca-booking-floor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.maca-booking-floor-card-title {
    font-size: 15px;
}

.maca-booking-floor-card-seats {
    font-size: 12px;
    color: #50575e;
}

.maca-booking-floor-card-chairs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.maca-booking-floor-seat-gap {
    width: 10px;
    flex-shrink: 0;
}

.maca-booking-floor-card.is-splittable .maca-booking-floor-seat-gap {
    width: 14px;
    border-left: 2px dashed rgba(219, 166, 23, 0.55);
    margin: 0 2px;
    height: 14px;
}

.maca-booking-floor-card-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: #8a5f00;
    background: #fff3cd;
    border: 1px solid #dba617;
    border-radius: 4px;
    vertical-align: middle;
}

.maca-booking-floor-seat {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.maca-booking-floor-seat-available {
    background: #46b450;
    box-shadow: inset 0 0 0 2px #2f9733;
}

.maca-booking-floor-seat-occupied {
    background: #d63638;
    box-shadow: inset 0 0 0 2px #b32d2e;
}

.maca-booking-floor-seat-shareable {
    background: #dba617;
    box-shadow: inset 0 0 0 2px #b38600;
}

.maca-booking-floor-card.is-partial {
    border-color: #dba617;
    background: linear-gradient(180deg, #fff9eb 0%, #fffdf6 100%);
}

.maca-booking-floor-card.is-split-part {
    min-width: 140px;
}

.maca-booking-floor-card.is-split-part .maca-booking-floor-card-title {
    font-size: 16px;
}

.maca-booking-floor-card-actions-split {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-sizing: border-box;
}

.maca-booking-floor-day-split-active {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
}

.maca-booking-floor-day-split-label {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.maca-booking-floor-day-split-select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    padding: 3px 6px;
}

.maca-booking-floor-card-actions-split .button,
.maca-booking-floor-card-actions-split .button-link {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    font-size: 12px;
    line-height: 1.35;
    padding: 4px 8px;
    min-height: 0;
    height: auto;
}

.maca-booking-floor-card-actions-split .button-link {
    padding-left: 8px;
}

.maca-booking-floor-card.is-partial .maca-booking-floor-card-booking {
    border-color: rgba(219, 166, 23, 0.45);
}

.maca-booking-floor-card.is-full {
    border-color: #d63638;
}

.maca-booking-floor-drop-hint {
    margin: 0 0 8px;
    font-size: 11px;
    color: #1e4620;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.maca-booking-floor-card.is-drop-target .maca-booking-floor-drop-hint {
    opacity: 1;
    font-weight: 600;
}

.maca-booking-floor-card-booking {
    margin: 0 0 8px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(214, 54, 56, 0.25);
}

.maca-booking-floor-card-booking.maca-booking-floor-drag {
    cursor: grab;
    border-color: rgba(214, 54, 56, 0.45);
    touch-action: none;
}

.maca-booking-floor-card-booking.maca-booking-floor-drag:active {
    cursor: grabbing;
}

.maca-booking-floor-card.is-available.is-drop-target .maca-booking-floor-drop-hint,
.maca-booking-floor-card.is-partial.is-drop-target .maca-booking-floor-drop-hint,
.maca-booking-floor-grid.is-floor-drag-active .maca-booking-floor-card.is-available.is-drop-target .maca-booking-floor-drop-hint,
.maca-booking-floor-grid.is-floor-drag-active .maca-booking-floor-card.is-partial.is-drop-target .maca-booking-floor-drop-hint {
    opacity: 1;
    font-weight: 600;
}

.maca-booking-floor-card.is-partial.is-drop-target .maca-booking-floor-drop-hint-share {
    color: #8a5f00;
}

.maca-booking-floor-card-guest {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #1d2327;
}

.maca-booking-floor-card-meta {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #50575e;
}

.maca-booking-floor-card-status-pending {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    color: #996800;
}

.maca-booking-floor-card-actions {
    margin-top: 10px;
}

.maca-booking-floor-btn-view {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.maca-booking-floor-btn-view:hover,
.maca-booking-floor-btn-view:focus {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.maca-booking-floor-drag-hint {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.35;
    color: #50575e;
}

.maca-booking-floor-drag-hint-muted {
    color: #787c82;
    font-style: italic;
}

.maca-booking-matrix-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    margin: 12px 0 16px;
}

.maca-booking-matrix-toolbar label {
    font-weight: 600;
    margin-right: 8px;
}

.maca-booking-matrix-date {
    max-width: 180px;
}

.maca-booking-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
}

.maca-booking-matrix-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.maca-booking-matrix-message {
    min-height: 1.25em;
    margin: 0 0 8px;
}

.maca-booking-matrix-message.is-error {
    color: #b32d2e;
}

.maca-booking-matrix-scroll {
    overflow: auto;
    max-width: 100%;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
}

.maca-booking-matrix-table {
    border-collapse: collapse;
    font-size: 12px;
    min-width: 100%;
}

.maca-booking-matrix-table th,
.maca-booking-matrix-table td {
    border: 1px solid #dcdcde;
    padding: 0;
    vertical-align: middle;
    text-align: center;
}

.maca-booking-matrix-time-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f6f7f7;
    font-weight: 600;
    padding: 6px 10px !important;
    white-space: nowrap;
    text-align: left !important;
    min-width: 52px;
}

.maca-booking-matrix-table thead .maca-booking-matrix-time-col {
    z-index: 3;
}

.maca-booking-matrix-seat-col {
    min-width: 28px;
    max-width: 72px;
    padding: 4px 2px !important;
    vertical-align: bottom;
}

.maca-booking-matrix-seat-label {
    display: block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-height: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 auto;
}

.maca-booking-matrix-cell {
    width: 22px;
    height: 22px;
}

.maca-booking-matrix-cell-inner {
    display: block;
    width: 18px;
    height: 18px;
    margin: 2px auto;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.maca-booking-matrix-cell-free .maca-booking-matrix-cell-inner,
.maca-booking-matrix-cell-inner.maca-booking-matrix-cell-free {
    background: #00a32a;
}

.maca-booking-matrix-cell-busy .maca-booking-matrix-cell-inner,
.maca-booking-matrix-cell-inner.maca-booking-matrix-cell-busy {
    background: #d63638;
}

.maca-booking-matrix-loading,
.maca-booking-matrix-empty {
    padding: 16px;
    color: #50575e;
}

.maca-booking-captcha {
    margin-top: 4px;
}

body.maca-booking-cancel-page {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 24px 16px;
}

.maca-booking-cancel-panel {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 28px 24px;
}

.maca-booking-cancel-panel h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.maca-booking-cancel-restaurant {
    color: #666;
    margin: 0 0 20px;
}

.maca-booking-cancel-details {
    margin: 0 0 20px;
}

.maca-booking-cancel-details dt {
    font-weight: 600;
    margin-top: 10px;
}

.maca-booking-cancel-details dd {
    margin: 4px 0 0;
}

.maca-booking-cancel-success {
    color: #1e4620;
    background: #edfaef;
    padding: 12px 14px;
    border-radius: 6px;
}

.maca-booking-cancel-error,
.maca-booking-cancel-info {
    padding: 12px 14px;
    border-radius: 6px;
}

.maca-booking-cancel-error {
    color: #8a1f1f;
    background: #fdeaea;
}

.maca-booking-cancel-info {
    color: #50575e;
    background: #f0f0f1;
}

.maca-booking-cancel-submit {
    margin-top: 8px;
}

.maca-opening-hours {
    max-width: 420px;
}

.maca-opening-hours-title {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.maca-opening-hours-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.maca-opening-hours-item {
    padding: 8px 0;
    border-bottom: 1px solid #e2e6ea;
}

.maca-opening-hours-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.maca-opening-hours-time--stacked {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.maca-opening-hours-window {
    display: block;
    white-space: nowrap;
}

.maca-opening-hours-time-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.maca-opening-hours-recurring {
    list-style: none;
    margin: 4px 0 0;
    padding: 0 0 0 12px;
}

.maca-opening-hours-recurring-item {
    font-size: 0.9em;
    color: #646970;
    padding: 2px 0;
}

.maca-opening-hours-item:last-child {
    border-bottom: none;
}

.maca-opening-hours-today {
    font-weight: 700;
    background: #f0f6fc;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 4px;
}

.maca-opening-hours-day {
    min-width: 0;
}

.maca-opening-hours-time {
    white-space: nowrap;
    color: #50575e;
}

.maca-opening-hours-notice {
    padding: 12px 14px;
    background: #fff8e5;
    border: 1px solid #f0d78c;
    border-radius: 6px;
}

.maca-takeaway-hours-notice {
    margin: 0 0 20px;
}

.maca-takeaway-hours-notice-text {
    margin: 0;
    font-weight: 600;
    color: #5c4a00;
}

.maca-opening-hours-exceptions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e6ea;
}

.maca-opening-hours-exceptions-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.maca-opening-hours-exception .maca-opening-hours-time {
    text-align: right;
}

.maca-opening-hours-note {
    display: block;
    font-size: 0.85em;
    font-weight: 400;
    color: #646970;
    margin-top: 2px;
    white-space: normal;
}

.maca-opening-hours-today.maca-opening-hours-exception {
    background: #fcf0f1;
}

/* Menu footer (allergy, prices, contact) */
.maca-menu-footer {
    margin-top: 36px;
    padding: 24px 20px;
    background: #f7f8fa;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
}

.maca-menu-footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px 28px;
}

.maca-menu-footer-block {
    min-width: 0;
}

.maca-menu-footer-heading {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0073aa;
}

.maca-menu-footer-text,
.maca-menu-footer-name {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #444;
}

.maca-menu-footer-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.maca-menu-footer-phone a,
.maca-menu-footer-email a,
.maca-menu-footer-website a,
.maca-menu-footer-contact-item a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.maca-menu-footer-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.maca-menu-footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #0073aa;
}

.maca-menu-footer-icon-svg {
    display: block;
    width: 14px;
    height: 14px;
}

.maca-menu-footer-contact-sep {
    margin: 0 6px;
    color: #666;
    font-weight: 400;
}

.maca-menu-footer-phone a:hover,
.maca-menu-footer-phone a:focus,
.maca-menu-footer-email a:hover,
.maca-menu-footer-email a:focus,
.maca-menu-footer-website a:hover,
.maca-menu-footer-website a:focus,
.maca-menu-footer-contact-item a:hover,
.maca-menu-footer-contact-item a:focus {
    text-decoration: underline;
}

.maca-menu-footer-contact {
    grid-column: 1 / -1;
    padding-top: 16px;
    border-top: 1px solid #e2e6ea;
    text-align: center;
}

.maca-menu-footer-company {
    max-width: 720px;
    margin: 0 auto;
}

.maca-menu-footer-company-line {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: #222;
}

.maca-menu-footer-company-line:last-child {
    margin-bottom: 0;
}

.maca-menu-footer-contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 0;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.maca-menulist-wrap-qr .maca-menu-footer,
.maca-dish-menu-qr + .maca-menu-footer {
    margin-top: 28px;
}

@media (max-width: 600px) {
    .maca-menu-footer {
        padding: 20px 16px;
    }

    .maca-menu-footer-inner {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}
