/* ===== SHOP BOTTOM SHEET - Black Market Operations ===== */
#shop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(6px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#shop-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Scanline overlay */
#shop-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(168, 85, 247, 0.015) 2px,
        rgba(168, 85, 247, 0.015) 4px
    );
    pointer-events: none;
}

#shop-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background:
        linear-gradient(180deg,
            rgba(24, 24, 42, 0.98) 0%,
            rgba(10, 10, 16, 0.99) 100%
        );
    border-top: 2px solid var(--violet-dim);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow:
        0 -8px 50px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(168, 85, 247, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

#shop-overlay.visible #shop-sheet {
    transform: translateY(0);
}

/* Handle bar */
.shop-sheet-handle {
    width: 100%;
    padding: 12px 0 8px;
    display: flex;
    justify-content: center;
}

.shop-sheet-handle::before {
    content: '';
    width: 48px;
    height: 3px;
    background: var(--violet-dim);
    border-radius: 2px;
    opacity: 0.6;
}

/* Header with balance */
.shop-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 16px;
}

.shop-sheet-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--violet);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: relative;
}

.shop-sheet-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--violet), transparent);
}

.shop-sheet-currencies-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.shop-sheet-currencies {
    display: flex;
    gap: 8px;
}

.shop-sheet-currencies.elite {
    gap: 6px;
}

.shop-sheet-balance.elite {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(185, 242, 255, 0.08));
    border-color: rgba(255, 215, 0, 0.25);
}

.shop-sheet-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--void);
    border: 1px solid var(--steel);
    border-radius: 4px;
}

.shop-sheet-balance-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.shop-sheet-balance-icon.badge-currency {
    background: linear-gradient(135deg, var(--azure), var(--azure-dim));
}

.shop-sheet-balance-icon.gun-currency {
    background: linear-gradient(135deg, var(--crimson), #991b1b);
}

.shop-sheet-balance-icon.gold-currency {
    background: linear-gradient(135deg, #ffd700, #b8860b);
}

.shop-sheet-balance-icon.diamond-currency {
    background: linear-gradient(135deg, #b9f2ff, #00bfff);
}

.shop-sheet-balance-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
}

/* Category tabs - horizontal scroll */
.shop-categories {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

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

.shop-category-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--void);
    border: 1px solid var(--steel);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
}

.shop-category-tab:hover {
    border-color: var(--violet-dim);
    background: var(--slate);
}

.shop-category-tab.active {
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.05));
    border-color: var(--violet-dim);
    border-left: 3px solid var(--violet);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.shop-category-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.shop-category-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.shop-category-tab.active .shop-category-name {
    color: var(--violet-bright);
}

.shop-category-count {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--steel);
    padding: 2px 6px;
    border-radius: 3px;
}

.shop-category-tab.active .shop-category-count {
    background: var(--violet-dim);
    color: var(--text-bright);
}

/* Items container - horizontal scroll */
.shop-items-container {
    position: relative;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    /* Height set dynamically by JS to match tallest tab */
}

.shop-items-scroll {
    display: flex;
    gap: 12px;
    padding: 0 20px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 20px;
}

.shop-items-scroll::-webkit-scrollbar {
    display: none;
}

/* Individual shop item card */
.shop-item-card {
    flex-shrink: 0;
    width: 140px;
    background:
        linear-gradient(180deg,
            var(--slate) 0%,
            var(--void) 100%
        );
    border: 1px solid var(--steel);
    border-radius: 4px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    scroll-snap-align: start;
    transition: all 0.2s ease;
    position: relative;
}

/* Top accent line */
.shop-item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--violet-dim), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.shop-item-card:hover::before {
    opacity: 1;
}

.shop-item-card:hover {
    transform: translateY(-2px);
    border-color: var(--violet-dim);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(168, 85, 247, 0.1);
}

.shop-item-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.shop-item-icon {
    width: 64px;
    height: 64px;
    background:
        linear-gradient(180deg,
            var(--graphite) 0%,
            var(--obsidian) 100%
        );
    border-radius: 4px;
    border: 1px solid var(--steel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.shop-item-name {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.2;
}

.shop-item-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
    flex: 1;
}

.shop-buy-btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(180deg, var(--violet-dim), var(--violet));
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shop-buy-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--violet), var(--violet-bright));
    box-shadow: 0 4px 16px var(--violet-glow);
}

.shop-buy-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.shop-buy-btn:disabled {
    background: var(--steel);
    color: var(--text-dim);
    cursor: not-allowed;
}

.shop-buy-btn .cost-icon {
    font-size: 0.75rem;
}

/* Empty state */
.shop-empty-state {
    padding: 32px 20px;
    text-align: center;
}

.shop-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.shop-empty-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Gradient fade on scroll edges */
.shop-items-container::before,
.shop-items-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 20px;
    width: 24px;
    pointer-events: none;
    z-index: 10;
}

.shop-items-container::before {
    left: 0;
    background: linear-gradient(90deg, rgba(10, 10, 16, 0.99), transparent);
}

.shop-items-container::after {
    right: 0;
    background: linear-gradient(270deg, rgba(10, 10, 16, 0.99), transparent);
}

/* Animation for items appearing */
@keyframes shopItemReveal {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.shop-item-card {
    animation: shopItemReveal 0.35s ease-out backwards;
}

.shop-item-card:nth-child(1) { animation-delay: 0.05s; }
.shop-item-card:nth-child(2) { animation-delay: 0.1s; }
.shop-item-card:nth-child(3) { animation-delay: 0.15s; }
.shop-item-card:nth-child(4) { animation-delay: 0.2s; }
.shop-item-card:nth-child(5) { animation-delay: 0.25s; }

/* Business item level indicator */
.shop-item-level {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--violet);
    background: rgba(168, 85, 247, 0.15);
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Maxed out business card */
.shop-item-card.maxed {
    border-color: var(--emerald);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), var(--void));
}

.shop-item-card.maxed::before {
    background: linear-gradient(90deg, transparent, var(--emerald), transparent);
    opacity: 1;
}

.shop-item-card.maxed .shop-item-level {
    color: var(--emerald);
    background: rgba(34, 197, 94, 0.15);
}

.shop-buy-btn.maxed {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.15));
    color: var(--emerald);
    cursor: default;
}

/* Multi-cost button styling */
.shop-buy-btn.multi-cost {
    gap: 8px;
    flex-wrap: wrap;
}

.shop-buy-btn .cost-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

