:root {
    --bg: var(--tg-theme-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #000000);
    --hint: var(--tg-theme-hint-color, #999999);
    --link: var(--tg-theme-link-color, #2481cc);
    --button: var(--tg-theme-button-color, #2481cc);
    --button-text: var(--tg-theme-button-text-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #f1f1f1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 88px;
}

.view { padding: 12px; }
.center { text-align: center; }
.muted { color: var(--hint); }
.hidden { display: none !important; }
.section-title { font-size: 14px; color: var(--hint); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: .04em; }

/* Vaizdo perjungiklis (adminams) */
.mode-switch {
    display: flex; gap: 6px; padding: 4px; margin-bottom: 12px;
    background: var(--secondary-bg); border-radius: 12px;
}
.mode-switch button {
    flex: 1; padding: 10px; border: none; border-radius: 9px;
    background: transparent; color: var(--text); font-size: 15px; font-weight: 600;
}
.mode-switch button.active { background: var(--button); color: var(--button-text); }

/* Paieška */
.searchbar { position: sticky; top: 0; background: var(--bg); padding: 4px 0 8px; z-index: 5; }
#search {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    border: none;
    border-radius: 12px;
    background: var(--secondary-bg);
    color: var(--text);
    outline: none;
}

.results { display: flex; flex-direction: column; gap: 6px; }
.result-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--secondary-bg); border-radius: 10px;
    cursor: pointer;
}
.result-row .r-name { font-size: 16px; }
.result-row .r-store { font-size: 12px; color: var(--hint); margin-top: 2px; }
.result-row .r-add { font-size: 22px; color: var(--button); font-weight: 700; padding-left: 10px; }
.result-new { color: var(--link); font-weight: 600; }

/* Krepšelis */
.cart { display: flex; flex-direction: column; gap: 8px; }
.cart-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--secondary-bg); border-radius: 10px;
}
.cart-item .c-info { flex: 1; min-width: 0; }
.cart-item .c-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item .c-store { font-size: 12px; color: var(--hint); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
    width: 34px; height: 34px; border-radius: 8px; border: none;
    background: var(--button); color: var(--button-text); font-size: 20px; font-weight: 700;
}
.stepper .qty { min-width: 26px; text-align: center; font-size: 16px; }
.c-remove { color: var(--hint); font-size: 20px; padding: 0 4px; }

/* Apatinis mygtukas */
.bottom-btn {
    position: fixed; left: 12px; right: 12px; bottom: 12px;
    padding: 16px; font-size: 17px; font-weight: 600;
    border: none; border-radius: 12px;
    background: var(--button); color: var(--button-text);
}
.bottom-btn:disabled { opacity: .5; }
.bottom-btn.danger { background: #e0533d; color: #fff; }

/* Admino tab'ai */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tab {
    flex: 0 0 auto; padding: 8px 16px; border-radius: 20px;
    background: var(--secondary-bg); color: var(--text); font-size: 15px; border: none;
}
.tab.active { background: var(--button); color: var(--button-text); }
.tab .badge { opacity: .7; margin-left: 4px; }

/* Admino blokai */
.blocks { display: flex; flex-direction: column; gap: 10px; }
.block {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 18px; border-radius: 14px;
    background: var(--button); color: var(--button-text);
    font-size: 19px; font-weight: 600;
    transition: background .3s ease, opacity .3s ease, transform .3s ease;
}
.block .b-qty { font-size: 17px; opacity: .85; font-weight: 700; }
.block .b-store { display: block; font-size: 12px; opacity: .7; font-weight: 400; margin-top: 2px; }
.block.bought {
    background: var(--secondary-bg);
    color: var(--hint);
    text-decoration: line-through;
    opacity: .6;
}

/* Modalas */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 50; }
.modal-box { background: var(--bg); width: 100%; border-radius: 16px 16px 0 0; padding: 18px; }
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; text-align: center; }
.store-options { display: flex; flex-direction: column; gap: 8px; }
.store-options button {
    padding: 14px; font-size: 16px; border: none; border-radius: 10px;
    background: var(--secondary-bg); color: var(--text);
}
.link-btn { width: 100%; margin-top: 12px; padding: 12px; background: none; border: none; color: var(--link); font-size: 16px; }
