@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

:root {
    --layout-shell-max: 980px;
    --layout-top-gap: 8px;
    --layout-side-gap: 8px;
    --layout-bottom-gap: 8px;
    --layout-topbar-h: 64px;
    --layout-nav-mobile-h: 84px;
    --layout-glass: rgba(255,255,255,0.88);
    --layout-glass-strong: rgba(255,255,255,0.94);
    --layout-border: rgba(255,255,255,0.92);
    --layout-text: #181818;
    --layout-text-soft: #8b8b8b;
    --layout-red: #e61e23;
    --layout-brown-1: #5b2618;
    --layout-brown-2: #3b170f;
    --layout-shadow: 0 18px 34px rgba(20,20,20,0.10);
    --layout-shadow-strong: 0 24px 44px rgba(20,20,20,0.14);
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body.has-shared-layout {
    min-height: 100vh;
    position: relative;
}

.page-shell,
.page-home .app-home,
.page-menu .productos,
.page-promos #contenedor-tarjetas {
    width: min(calc(100% - 20px), var(--layout-shell-max));
    margin-left: auto;
    margin-right: auto;
}

/* TOPBAR */

#user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: fixed;
    top: var(--layout-top-gap);
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 16px), var(--layout-shell-max));
    min-height: var(--layout-topbar-h);
    padding: 10px 14px;
    z-index: 1100;
    border-radius: 22px;
    background: var(--layout-glass);
    border: 1px solid var(--layout-border);
    box-shadow: var(--layout-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: "Outfit", sans-serif;
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-welcome {
    font-size: 12px;
    color: #6a7280;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 3px;
}

#user-photo,
.user-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.95);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

#user-name {
    font-family: "Outfit", sans-serif;
    font-weight: 1000;
    color: #121212;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

#profile-menu.menu-visible {
    position: fixed;
    top: 72px;
    right: 10px;
    z-index: 1200;
}

.show-login-button {
    z-index: 1110;
}

/* BOTTOM NAV */

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: var(--layout-bottom-gap);
    width: min(calc(100% - 16px), var(--layout-shell-max));
    z-index: 1000;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    border-radius: 28px;
    background: var(--layout-glass-strong);
    border: 1px solid var(--layout-border);
    box-shadow: var(--layout-shadow-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.bottom-nav-simple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-height: 64px;
    text-decoration: none;
    color: var(--layout-text-soft);
    font-family: "Outfit", sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
    transition: color .24s ease, transform .24s ease, opacity .24s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--layout-red);
}

.bottom-nav-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.bottom-nav-home {
    position: relative;
}

.bottom-nav-home-circle {
    width: 66px;
    height: 66px;
    margin-top: -30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--layout-brown-1) 0%, var(--layout-brown-2) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 28px rgba(59, 23, 15, 0.28);
    border: 6px solid rgba(255,255,255,0.96);
}

.bottom-nav-home-circle svg {
    width: 28px;
    height: 28px;
}

/* PAGE SPACING */

.page-home.bodyindex {
    padding-top: 84px;
    padding-bottom: 116px;
}

.page-menu.bodymenu {
    padding-top: 84px;
    padding-bottom: 146px;
}

.page-promos {
    padding-top: 88px;
    padding-bottom: 116px;
}

/* MENU CART POSITION */

.page-menu .cart-float {
    right: 14px;
    bottom: calc(var(--layout-nav-mobile-h) + 14px);
    z-index: 1060;
    border: 1px solid rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.98);
    box-shadow: 0 18px 40px rgba(0,0,0,.22);
}

.page-menu .cart-panel {
    z-index: 1055;
    padding-bottom: calc(6.2rem + env(safe-area-inset-bottom));
}

/* MOBILE */

@media (max-width: 768px) {
    #user-info {
        width: calc(100% - 12px);
        top: 6px;
        padding: 8px 10px;
        border-radius: 18px;
    }

    #user-name {
        max-width: 115px;
        font-size: 14px;
    }

    .bottom-nav {
        width: calc(100% - 12px);
        bottom: 6px;
        padding: 9px 10px max(9px, env(safe-area-inset-bottom));
        border-radius: 24px;
    }

    .bottom-nav-item {
        font-size: 0.66rem;
    }

    .bottom-nav-home-circle {
        width: 60px;
        height: 60px;
        margin-top: -22px;
    }

    .page-home .app-home,
    .page-menu .productos,
    .page-promos #contenedor-tarjetas {
        width: calc(100% - 16px);
    }

    .page-menu .cart-float {
        bottom: calc(var(--layout-nav-mobile-h) + 12px);
        right: 10px;
    }
}

@media (min-width: 701px) {
    .page-menu .cart-float {
        top: 92px;
        right: 20px;
        bottom: auto;
    }

    .page-menu .cart-panel {
        top: 148px;
        right: 20px;
        left: auto;
        bottom: auto;
    }
}