/* ===============================
   ROOT / THEME
================================ */
:root {
    --brand: #ea5a26;
    --bg: #111;
    --card: #1c1c1c;
    --text: #fff;
    --muted: rgba(255,255,255,0.7);
    --border: rgba(255,255,255,0.10);

    --header-h: 96px; /* header stacked */
    --bottom-h: 64px;
    --radius: 16px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

/* ===============================
   LAYOUT BASE
================================ */
.app-layout {
    min-height: 100vh;
}

.app-main {
    padding-top: var(--header-h);
    padding-bottom: calc(var(--bottom-h) + 16px);
    padding-left: 12px;
    padding-right: 12px;
}

/* ===============================
   HEADER APP (LOGO + SEARCH)
================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    padding: 10px 12px 12px;
    height: auto;

    display: flex;
    flex-direction: column;
    gap: 8px;

    background: black;
    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.app-header-logo {
    display: flex;
    justify-content: center;
}

.app-header-search {
    width: 100%;
}

.app-search-input {
    width: 100%;
    height: 40px;

    padding: 0 12px;

    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);
    font-size: 14px;
}

.app-search-input::placeholder {
    color: var(--muted);
}

/* ===============================
   ICONS BASE
================================ */
.app-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.app-icon-menu {
    background:
            linear-gradient(#fff 0 0) center 5px / 20px 2px no-repeat,
            linear-gradient(#fff 0 0) center / 20px 2px no-repeat,
            linear-gradient(#fff 0 0) center 15px / 20px 2px no-repeat;
}

.app-icon-cart::before { content: "🛒"; font-size: 20px; }
.app-icon-home::before { content: "⌂"; font-size: 22px; }
.app-icon-search::before { content: "⌕"; font-size: 20px; }
.app-icon-user::before { content: "👤"; font-size: 20px; }

/* ===============================
   CARD / CONTENT
================================ */
.app-page {
    display: grid;
    gap: 12px;
}

.app-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.app-title {
    margin: 0 0 6px;
    font-size: 20px;
}

.app-subtitle {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--muted);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 44px;
    padding: 0 14px;

    border-radius: 14px;
    background: var(--brand);
    color: #111;
    font-weight: 700;
    text-decoration: none;
}

/* ===============================
   BOTTOM NAV
================================ */
.app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    height: var(--bottom-h);
    padding: 6px 6px 8px;

    display: flex;
    justify-content: space-around;
    align-items: center;

    background: rgba(17,17,17,0.96);
    backdrop-filter: blur(12px);

    border-top: 1px solid var(--border);
    z-index: 900;
}

.app-bottom-item {
    flex: 1;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    background: transparent;
    border: none;

    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 11px;
}

.app-bottom-item.is-active {
    color: var(--brand);
}

.app-bottom-icon {
    width: 22px;
    height: 22px;
    display: block;
}


/* ===============================
   CATEGORY TREE
================================ */




.panel-categories {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--bottom-h); /* ⬅️ SI FERMA SOPRA LA BOTTOM BAR */

    background: #111;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.panel-categories.is-open {
    transform: translateX(0);
}

.panel-header {
    position: sticky;
    top: 0;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: #111;
    border-bottom: 1px solid #222;
    z-index: 10;
}

.panel-back {
    background: none;
    border: 0;
    color: #fff;
    font-size: 18px;
}

.panel-stack {
    position: relative;
    flex: 1;
    height: calc(100vh - 56px);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

.panel-level {
    position: absolute;
    inset: 0; /* ⬅️ prende SOLO lo spazio del panel-stack */

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    background: #111;

    display: none;
    transform: translateX(100%);
    transition: transform .3s ease;
}

.panel-level.is-active {
    display: block;
    transform: translateX(0);
}

.panel-item {
    border-bottom: 1px solid #222;
}

.panel-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    color: #fff;
    text-decoration: none;
}

.panel-arrow {
    opacity: .6;
}

@media (min-width: 1024px) {
    .panel-categories {
        display: none;
    }
}
.panel-close {
    margin-left: auto;
    background: none;
    border: 0;
    color: #fff;
    font-size: 20px;
}

.panel-item-level-0 .panel-link {
    gap: 12px;
}

.panel-cat-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.panel-view-all {
    margin-left: auto;
    font-size: 13px;
    color: var(--brand);
    text-decoration: none;
}