﻿/* Place this file after chapresto-app.css in App.razor */

:root {
    --cr-public-max: 1180px;
}

.cr-page-head,
.cr-filter-panel,
.cr-page-grid,
.cr-empty,
.cr-cart-wrap,
.cr-order-status,
.cr-loading {
    width: min(100% - 2rem, var(--cr-public-max));
    margin-left: auto;
    margin-right: auto;
}

.cr-page-head {
    padding-top: clamp(3rem, 7vw, 4.8rem);
    margin-bottom: 1.6rem;
}

    .cr-page-head > div {
        max-width: 820px;
    }

    .cr-page-head p {
        margin: 0 0 .5rem;
        color: var(--cr-primary-dark, #a74113);
        font-size: .78rem;
        font-weight: 950;
        letter-spacing: .18em;
        text-transform: uppercase;
    }

    .cr-page-head h1 {
        margin: 0;
        color: var(--cr-text, #201b17);
        font-size: clamp(2.35rem, 5vw, 3.55rem);
        line-height: 1.02;
        letter-spacing: -.055em;
    }

.cr-filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, auto)) auto;
    gap: .65rem;
    align-items: center;
    margin-bottom: 1.35rem;
    padding: .75rem;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--cr-border, #eee3d7);
    border-radius: 22px;
    box-shadow: var(--cr-shadow, 0 18px 45px rgba(49, 37, 26, .08));
}

    .cr-filter-panel input,
    .cr-filter-panel select {
        width: 100%;
        min-height: 44px;
        border: 1px solid var(--cr-border, #eee3d7);
        border-radius: 13px;
        background: #fff;
        color: var(--cr-text, #201b17);
        padding: .65rem .78rem;
        outline: none;
        font-weight: 700;
    }

        .cr-filter-panel input:focus,
        .cr-filter-panel select:focus {
            border-color: #efa15f;
            box-shadow: 0 0 0 4px rgba(239, 108, 0, .10);
        }

    .cr-filter-panel .cr-check {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .45rem;
        padding: .5rem .75rem;
        border: 1px solid var(--cr-border, #eee3d7);
        border-radius: 999px;
        background: #fff;
        color: var(--cr-text, #201b17);
        font-size: .92rem;
        font-weight: 900;
        white-space: nowrap;
    }

        .cr-filter-panel .cr-check input {
            width: 16px;
            min-height: 16px;
            height: 16px;
            padding: 0;
            accent-color: var(--cr-primary, #d85b1f);
        }

    .cr-filter-panel .cr-btn {
        min-height: 44px;
        padding-left: 1.35rem;
        padding-right: 1.35rem;
    }

.cr-page-grid {
    display: grid;
    gap: 1.1rem;
    align-items: stretch;
    margin-top: 0;
    margin-bottom: 4rem;
}

.cr-restaurant-grid,
.cr-menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.cr-rest-card,
.cr-menu-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--cr-border, #eee3d7);
    border-radius: 24px;
    box-shadow: var(--cr-shadow-soft, 0 10px 25px rgba(49, 37, 26, .06));
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

    .cr-rest-card:hover,
    .cr-menu-card:hover {
        transform: translateY(-2px);
        border-color: var(--cr-border-strong, #f2cfaa);
        box-shadow: var(--cr-shadow, 0 18px 45px rgba(49, 37, 26, .08));
    }

.cr-rest-card {
    cursor: pointer;
}

.cr-rest-cover,
.cr-menu-img {
    width: 100%;
    background-color: #f8e7d1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.cr-rest-cover {
    position: relative;
    height: 140px;
}

.cr-menu-img {
    height: 170px;
}

.cr-rest-body,
.cr-menu-body {
    padding: 1rem;
}

.cr-rest-body {
    display: flex;
    gap: .8rem;
    align-items: flex-start;
}

.cr-rest-logo {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #078443;
    color: #fff;
    font-weight: 950;
}

.cr-rest-body h3,
.cr-menu-body h3 {
    margin: 0 0 .35rem;
    color: var(--cr-text, #201b17);
    font-size: 1.12rem;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.cr-rest-body p,
.cr-menu-body p,
.cr-menu-body small {
    color: var(--cr-muted, #766b61);
}

.cr-rest-body p,
.cr-menu-body p {
    margin: 0 0 .55rem;
}

.cr-menu-body small {
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.cr-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin: .7rem 0;
}

    .cr-meta-row span {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
        padding: .32rem .58rem;
        border-radius: 999px;
        background: var(--cr-primary-soft, #fff1e7);
        color: #5b351f;
        font-size: .82rem;
        font-weight: 900;
    }

.cr-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--cr-primary-dark, #a74113);
    font-size: .78rem;
    font-weight: 950;
}

.cr-btn-full {
    width: 100%;
}

.cr-empty,
.cr-loading {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 190px;
    margin-top: 1rem;
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--cr-border, #eee3d7);
    border-radius: 24px;
    box-shadow: var(--cr-shadow-soft, 0 10px 25px rgba(49, 37, 26, .06));
    color: var(--cr-muted, #766b61);
    font-weight: 750;
}

    .cr-empty h3,
    .cr-empty h2 {
        margin: 0 0 .55rem;
        color: var(--cr-text, #201b17);
    }

    .cr-empty p {
        margin: 0 0 .75rem;
    }

.cr-cart-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.1rem;
    align-items: start;
    margin-bottom: 4rem;
}

.cr-cart-list,
.cr-cart-total,
.cr-order-status {
    background: #fff;
    border: 1px solid var(--cr-border, #eee3d7);
    border-radius: 24px;
    box-shadow: var(--cr-shadow-soft, 0 10px 25px rgba(49, 37, 26, .06));
    padding: 1.15rem;
}

    .cr-cart-list h2,
    .cr-cart-total h3,
    .cr-order-status h2 {
        margin: 0 0 1rem;
        color: var(--cr-text, #201b17);
        letter-spacing: -.025em;
    }

.cr-cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--cr-border, #eee3d7);
}

    .cr-cart-row:first-of-type {
        border-top: 0;
    }

    .cr-cart-row h3 {
        margin: 0 0 .25rem;
        font-size: 1.02rem;
    }

    .cr-cart-row p {
        margin: 0 0 .5rem;
        color: var(--cr-muted, #766b61);
    }

    .cr-cart-row input {
        width: 100%;
        min-height: 42px;
        border: 1px solid var(--cr-border, #eee3d7);
        border-radius: 12px;
        padding: .55rem .7rem;
    }

.cr-qty {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem;
    background: var(--cr-surface-soft, #fffaf4);
    border: 1px solid var(--cr-border, #eee3d7);
    border-radius: 999px;
}

    .cr-qty button {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 999px;
        background: #fff;
        color: var(--cr-text, #201b17);
        font-weight: 950;
    }

.cr-cart-total {
    position: sticky;
    top: calc(var(--cr-header-height, 76px) + 1rem);
    display: grid;
    gap: .75rem;
}

    .cr-cart-total div {
        display: flex;
        justify-content: space-between;
        gap: .75rem;
    }

    .cr-cart-total small,
    .cr-cart-total p {
        color: var(--cr-muted, #766b61);
    }

.cr-order-status {
    margin-bottom: 1.1rem;
}

.cr-status-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .45rem;
    margin-top: 1rem;
}

    .cr-status-steps span {
        min-height: 42px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        background: #f3eee8;
        color: #7a6d62;
        font-size: .85rem;
        font-weight: 900;
        text-align: center;
    }

        .cr-status-steps span.active {
            background: var(--cr-success-soft, #e9f8ee);
            color: var(--cr-success, #147a39);
        }

.cr-floating-cart {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    border-radius: 999px;
    background: var(--cr-text, #201b17);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 18px 38px rgba(32, 27, 23, .25);
    font-weight: 900;
}

@media (max-width: 1100px) {
    .cr-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .cr-filter-panel .cr-btn {
            grid-column: 1 / -1;
        }

    .cr-cart-wrap {
        grid-template-columns: 1fr;
    }

    .cr-cart-total {
        position: static;
    }
}

@media (max-width: 720px) {
    .cr-page-head,
    .cr-filter-panel,
    .cr-page-grid,
    .cr-empty,
    .cr-cart-wrap,
    .cr-order-status,
    .cr-loading {
        width: min(100% - 1rem, var(--cr-public-max));
    }

    .cr-page-head {
        padding-top: 1.8rem;
    }

    .cr-filter-panel {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .cr-restaurant-grid,
    .cr-menu-grid {
        grid-template-columns: 1fr;
    }

    .cr-cart-row {
        grid-template-columns: 1fr;
    }

    .cr-status-steps {
        grid-template-columns: 1fr 1fr;
    }
}
