*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Hero spacing and header stacking */
header.primary-background-color {
    z-index: 40;
    position: relative;
    margin-bottom: 0;
    box-shadow: none !important;
    border-bottom: 0 !important;
}

/* Pull hero up to touch the header (including when main or other nodes exist between) */
header ~ .hero-restaurant,
header ~ main .hero-restaurant { margin-top: -12px !important; }

/* Ensure the main wrapper itself has no gap */
body > header + main.restaurant-view { margin-top: -12px !important; }

/* Hero container */
.hero-restaurant {
    margin-top: 0 !important;
    padding-top: 0;
    line-height: 0;
    position: relative;
    --hero-title-color: #ffffff;
    --hero-overlay-start: rgba(0, 0, 0, 0.55);
    --hero-overlay-end: rgba(0, 0, 0, 0.85);
}

.hero-restaurant-content {
    position: relative;
    z-index: 1;
    line-height: normal;
    color: var(--hero-title-color, #ffffff);
}

.hero-restaurant.has-image .hero-restaurant-content {
    position: absolute;
    inset: 0;
}

/* Gradient fallback when there is no image */
.hero-restaurant.no-image {
    background-color: rgb(255, 145, 0);
    padding-top: 1.25rem;
    padding-bottom: 1.75rem;
}

.hero-restaurant-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--hero-overlay-start, rgba(0, 0, 0, 0.55)), var(--hero-overlay-end, rgba(0, 0, 0, 0.85)));
    pointer-events: none;
}

.hero-restaurant-text {
    min-width: 0;
}

.hero-restaurant-title,
.hero-restaurant-description,
.hero-restaurant-badge,
.hero-restaurant-badge i {
    color: var(--hero-title-color, #ffffff);
}

/* Hero image sizing */
.hero-restaurant-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
}

.menu-dish-modal-image-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-dish-modal-image-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #fff;
}

.restaurant-view {
    width: 100%;
}

#category-dishes,
#categoryRows {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.category-row {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.5rem);
}

.category-wrapper {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.category-button {
    --category-button-size: 8.75rem;
    width: min(var(--category-button-size), 100%);
    height: var(--category-button-size);
    max-width: 100%;
    min-width: 0;
    padding: 0.65rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@supports (aspect-ratio: 1 / 1) {
    .category-button {
        aspect-ratio: 1 / 1;
        height: auto;
    }
}

.category-button-label {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem;
}

.category-button-text {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
    text-align: center;
}

@media (max-width: 640px) {
    .category-row {
        gap: 0.5rem;
    }

    .category-button {
        --category-button-size: 7rem;
        padding: 0.5rem;
    }
}

.dish-card .dish-title {
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    text-align: left;
}

.dish-card .dish-title-text {
    display: block;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
}

.dish-card {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dish-card-unavailable::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(148, 163, 184, 0.55);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.dish-status-unavailable {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
