* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #111111;
    --card: #1b1b1b;
    --card-light: #242424;
    --yellow: #ffc400;
    --yellow-dark: #e5a900;
    --white: #ffffff;
    --gray: #9b9b9b;
    --border: #303030;
    --danger: #ff4d4d;
}

html,
body {
    width: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    padding-bottom: 85px;
}

button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.hidden {
    display: none !important;
}


/* =========================
   TOP BAR
========================= */

.topbar {
    height: 72px;
    padding: 12px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #111111;

    position: sticky;
    top: 0;
    z-index: 50;

    border-bottom: 1px solid #242424;
}

.brand {
    color: var(--yellow);
    font-size: 23px;
    font-weight: 900;
    letter-spacing: 1px;
}

.brand-sub {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
    margin-top: -2px;
}

.profile-button {
    width: 44px;
    height: 44px;

    border-radius: 50%;

    background: var(--card-light);
    color: white;

    font-size: 20px;

    border: 1px solid #333;
}


/* =========================
   CATEGORIES
========================= */

.categories {
    display: flex;
    gap: 9px;

    overflow-x: auto;

    padding: 14px 16px;

    scrollbar-width: none;

    position: sticky;
    top: 72px;
    z-index: 40;

    background: #111111;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category {
    flex: 0 0 auto;

    padding: 10px 15px;

    border-radius: 22px;

    background: #202020;
    color: #d0d0d0;

    font-size: 14px;
    font-weight: 600;

    border: 1px solid #2e2e2e;

    transition: 0.2s;
}

.category.active {
    background: var(--yellow);
    color: #111111;
    border-color: var(--yellow);
}


/* =========================
   MAIN
========================= */

main {
    padding: 4px 14px 20px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 10px 4px 15px;
}

.section-title h1 {
    font-size: 27px;
    font-weight: 900;
}

#menu-count {
    color: var(--gray);
    font-size: 13px;
}


/* =========================
   PRODUCTS
========================= */

.products {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.product-card {
    background: var(--card);

    border-radius: 18px;

    overflow: hidden;

    border: 1px solid #292929;

    position: relative;

    transition: transform 0.15s;
}

.product-card:active {
    transform: scale(0.97);
}

.product-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 0.85;

    background: #252525;

    position: relative;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.product-no-image {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 42px;
    color: #666;
}

.stopped {
    opacity: 0.55;
}

.stop-label {
    position: absolute;

    top: 9px;
    left: 9px;

    background: #111;
    color: #ff5b5b;

    padding: 5px 8px;

    border-radius: 8px;

    font-size: 11px;
    font-weight: 800;
}

.product-body {
    padding: 11px;
}

.product-name {
    font-size: 15px;
    line-height: 19px;

    min-height: 38px;

    font-weight: 700;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 11px;
}

.product-price {
    color: var(--yellow);

    font-size: 17px;
    font-weight: 900;
}

.add-small {
    width: 35px;
    height: 35px;

    border-radius: 11px;

    background: var(--yellow);
    color: #111;

    font-size: 23px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;
}

.add-small:active {
    background: var(--yellow-dark);
}


/* =========================
   LOADING
========================= */

.loading {
    grid-column: 1 / -1;

    padding: 60px 20px;

    text-align: center;

    color: var(--gray);
}


/* =========================
   BOTTOM NAV
========================= */

.bottom-nav {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    height: 72px;

    display: flex;
    justify-content: space-around;
    align-items: center;

    background: rgba(20, 20, 20, 0.97);

    border-top: 1px solid #303030;

    z-index: 100;

    padding-bottom: env(safe-area-inset-bottom);
}

.nav-button {
    position: relative;

    background: transparent;
    color: #777;

    min-width: 75px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 3px;
}

.nav-button span {
    font-size: 22px;
}

.nav-button small {
    font-size: 11px;
    font-weight: 600;
}

.nav-button.active {
    color: var(--yellow);
}

.cart-nav b {
    position: absolute;

    top: -4px;
    right: 10px;

    min-width: 18px;
    height: 18px;

    padding: 0 4px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--yellow);
    color: #111;

    font-size: 10px;
}


/* =========================
   MODAL
========================= */

.modal {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.75);

    z-index: 200;

    display: flex;
    align-items: flex-end;
}

.modal-content {
    width: 100%;

    max-height: 92vh;

    background: #181818;

    border-radius: 24px 24px 0 0;

    overflow-y: auto;

    padding: 20px;

    border-top: 1px solid #333;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.modal-header h2 {
    font-size: 24px;
}

.modal-header button,
.modal-close {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #292929;
    color: white;

    font-size: 18px;
}


/* =========================
   CART
========================= */

.cart-item {
    display: flex;
    gap: 12px;

    padding: 12px 0;

    border-bottom: 1px solid #2d2d2d;
}

.cart-item-image {
    width: 65px;
    height: 65px;

    border-radius: 12px;

    object-fit: cover;

    background: #252525;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 700;

    line-height: 18px;
}

.cart-item-price {
    color: var(--yellow);

    font-weight: 800;

    margin-top: 5px;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 8px;
}

.cart-controls button {
    width: 28px;
    height: 28px;

    border-radius: 8px;

    background: #303030;
    color: white;

    font-size: 17px;
}

.cart-quantity {
    min-width: 20px;

    text-align: center;

    font-weight: 700;
}

.empty-cart {
    text-align: center;

    padding: 50px 20px;

    color: var(--gray);
}

.cart-footer {
    padding-top: 18px;
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 18px;

    margin-bottom: 15px;
}

.cart-total-row strong {
    color: var(--yellow);

    font-size: 22px;
}

.checkout-button {
    width: 100%;

    height: 54px;

    border-radius: 15px;

    background: var(--yellow);
    color: #111;

    font-size: 16px;
    font-weight: 900;
}

.checkout-button:disabled {
    opacity: 0.4;
}


/* =========================
   PRODUCT MODAL
========================= */

.product-modal {
    padding: 0 0 25px;

    position: relative;
}

.product-modal .modal-close {
    position: absolute;

    top: 14px;
    right: 14px;

    z-index: 5;
}

.product-big-image {
    width: 100%;

    max-height: 430px;

    object-fit: cover;

    background: #222;
}

.product-info {
    padding: 20px;
}

.product-info h2 {
    font-size: 24px;
    line-height: 29px;
}

.product-info .product-price {
    font-size: 22px;

    margin: 10px 0 20px;
}

.add-button {
    width: 100%;

    height: 54px;

    border-radius: 15px;

    background: var(--yellow);
    color: #111;

    font-size: 16px;
    font-weight: 900;
}


/* =========================
   PROFILE
========================= */

.profile-header {
    display: flex;
    align-items: center;

    gap: 12px;

    margin: 10px 0 20px;
}

.profile-header h1 {
    font-size: 25px;
}

.back-button {
    width: 40px;
    height: 40px;

    border-radius: 12px;

    background: #242424;
    color: white;

    font-size: 22px;
}

.profile-card {
    display: flex;
    align-items: center;

    gap: 14px;

    background: var(--card);

    border: 1px solid #2d2d2d;

    border-radius: 18px;

    padding: 18px;

    margin-bottom: 15px;
}

.profile-avatar {
    width: 55px;
    height: 55px;

    border-radius: 50%;

    background: var(--yellow);
    color: #111;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 25px;
}

.profile-name {
    font-size: 18px;
    font-weight: 800;
}

.profile-username {
    color: var(--gray);

    font-size: 13px;

    margin-top: 3px;
}

.stats {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 9px;

    margin-bottom: 15px;
}

.stat-card {
    background: var(--card);

    border: 1px solid #2d2d2d;

    border-radius: 15px;

    padding: 14px 7px;

    text-align: center;
}

.stat-number {
    color: var(--yellow);

    font-size: 18px;
    font-weight: 900;
}

.stat-label {
    color: var(--gray);

    font-size: 11px;

    margin-top: 4px;
}

.profile-menu-button {
    width: 100%;

    height: 54px;

    margin-bottom: 10px;

    border-radius: 14px;

    background: var(--card);

    border: 1px solid #303030;

    color: white;

    text-align: left;

    padding: 0 17px;

    font-size: 15px;
    font-weight: 700;
}


/* =========================
   DESKTOP
========================= */

@media (min-width: 700px) {

    body {
        max-width: 900px;
        margin: 0 auto;
    }

    .topbar {
        max-width: 900px;
        margin: auto;
    }

    .categories {
        max-width: 900px;
        margin: auto;
    }

    .products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bottom-nav {
        max-width: 900px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 100%;
    }
}
