/* ============================================
   NewVend Shop - Modern Black & White Liquid Glass
   ============================================ */

:root {
    --shop-font-body: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --shop-font-heading: "Space Grotesk", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --shop-font-mono: "SFMono-Regular", "Consolas", "Menlo", monospace;

    --shop-bg-0: #050505;
    --shop-bg-1: #0b0b0b;
    --shop-bg-2: #111111;
    --shop-bg-3: #171717;
    --shop-bg-4: #1f1f1f;

    --shop-text-1: #f8f8f8;
    --shop-text-2: #d0d0d0;
    --shop-text-3: #9d9d9d;
    --shop-text-4: #7b7b7b;

    --shop-glass-bg: rgba(255, 255, 255, 0.05);
    --shop-glass-bg-strong: rgba(255, 255, 255, 0.08);
    --shop-glass-hover: rgba(255, 255, 255, 0.12);
    --shop-glass-selected: rgba(255, 255, 255, 0.16);

    --shop-stroke-1: rgba(255, 255, 255, 0.16);
    --shop-stroke-2: rgba(255, 255, 255, 0.11);
    --shop-stroke-3: rgba(255, 255, 255, 0.07);

    --shop-shadow-1: 0 8px 30px rgba(0, 0, 0, 0.28);
    --shop-shadow-2: 0 14px 40px rgba(0, 0, 0, 0.4);
    --shop-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.18);

    --shop-accent: #f2f2f2;
    --shop-accent-ink: #121212;
    --shop-accent-soft: rgba(255, 255, 255, 0.22);

    --shop-success: #43c683;
    --shop-success-soft: rgba(67, 198, 131, 0.17);
    --shop-warning: #f5c66b;
    --shop-warning-soft: rgba(245, 198, 107, 0.19);
    --shop-danger: #f06d6d;
    --shop-danger-soft: rgba(240, 109, 109, 0.17);
    --shop-info: #7db7ff;
    --shop-info-soft: rgba(125, 183, 255, 0.17);

    --shop-radius-xs: 10px;
    --shop-radius-sm: 14px;
    --shop-radius-md: 18px;
    --shop-radius-lg: 24px;
    --shop-radius-xl: 30px;
    --shop-radius-pill: 999px;

    --shop-blur: 18px;
    --shop-nav-height: 72px;

    --shop-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --shop-fast: 160ms var(--shop-ease);
    --shop-enter: 240ms var(--shop-ease);

    /* compatibility aliases (legacy templates/js) */
    --bg-primary: var(--shop-bg-0);
    --bg-secondary: var(--shop-bg-2);
    --bg-tertiary: var(--shop-bg-3);
    --text-primary: var(--shop-text-1);
    --text-secondary: var(--shop-text-3);
    --accent-primary: var(--shop-accent);
    --accent-secondary: #cfcfcf;
    --success: var(--shop-success);
    --warning: var(--shop-warning);
    --info: var(--shop-info);
    --danger: var(--shop-danger);
    --error: var(--shop-danger);
    --border-color: var(--shop-stroke-1);
}

[data-theme="light"] {
    --shop-bg-0: #efefef;
    --shop-bg-1: #f5f5f5;
    --shop-bg-2: #fbfbfb;
    --shop-bg-3: #ffffff;
    --shop-bg-4: #ffffff;

    --shop-text-1: #121212;
    --shop-text-2: #2c2c2c;
    --shop-text-3: #5f5f5f;
    --shop-text-4: #7f7f7f;

    --shop-glass-bg: rgba(255, 255, 255, 0.62);
    --shop-glass-bg-strong: rgba(255, 255, 255, 0.8);
    --shop-glass-hover: rgba(255, 255, 255, 0.95);
    --shop-glass-selected: rgba(255, 255, 255, 1);

    --shop-stroke-1: rgba(18, 18, 18, 0.12);
    --shop-stroke-2: rgba(18, 18, 18, 0.08);
    --shop-stroke-3: rgba(18, 18, 18, 0.05);

    --shop-shadow-1: 0 10px 30px rgba(24, 24, 24, 0.12);
    --shop-shadow-2: 0 18px 38px rgba(24, 24, 24, 0.18);
    --shop-shadow-soft: 0 4px 16px rgba(24, 24, 24, 0.09);

    --shop-accent: #171717;
    --shop-accent-ink: #ffffff;
    --shop-accent-soft: rgba(25, 25, 25, 0.12);

    --shop-success: #2a9c63;
    --shop-success-soft: rgba(42, 156, 99, 0.16);
    --shop-warning: #b5862d;
    --shop-warning-soft: rgba(181, 134, 45, 0.15);
    --shop-danger: #c45454;
    --shop-danger-soft: rgba(196, 84, 84, 0.14);
    --shop-info: #3d7ab7;
    --shop-info-soft: rgba(61, 122, 183, 0.15);

    --accent-secondary: #404040;
}

@media (max-width: 767px) {
    :root {
        --shop-blur: 12px;
    }
}

html[data-theme="dark"],
html[data-theme="light"] {
    color-scheme: dark;
}

[data-theme="light"] {
    color-scheme: light;
}

body.glass-shell,
body.glass-standalone {
    font-family: var(--shop-font-body);
    color: var(--shop-text-1);
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 5% -20%, rgba(255, 255, 255, 0.09), transparent 45%),
        radial-gradient(1000px 600px at 100% 0%, rgba(255, 255, 255, 0.04), transparent 42%),
        linear-gradient(180deg, var(--shop-bg-1) 0%, var(--shop-bg-0) 100%);
}

body.glass-shell::before,
body.glass-standalone::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 3px 3px;
    opacity: 0.18;
    z-index: -1;
}

body.glass-shell,
body.glass-standalone,
body.glass-shell * {
    border-color: var(--shop-stroke-1);
}

h1,
h2,
h3,
h4,
.section-title,
.page-header h1,
.shop-welcome h1,
.hero h1,
.product-title,
.modal-title,
.profile-name,
.select-title h1 {
    font-family: var(--shop-font-heading);
    letter-spacing: -0.02em;
}

a,
button {
    transition: transform var(--shop-fast),
                color var(--shop-fast),
                border-color var(--shop-fast),
                background-color var(--shop-fast),
                box-shadow var(--shop-fast),
                opacity var(--shop-fast);
}

.glass-panel,
.shop-header,
.shop-bottom-nav,
.shop-user-menu,
.shop-balance,
.shop-welcome,
.quick-action,
.product-card,
.category-chip,
.filter-chip,
.page-header,
.balance-card,
.charge-section,
.history-item,
.stat-card,
.quick-links,
.server-info,
.profile-header,
.product-image-container,
.product-info-card,
.modal-content,
.hero,
.shop-card,
.server-card,
.search-box,
.select-header,
.select-title,
.empty-state,
.empty-products,
.empty-banks,
.shop-flash .alert,
.dropdown-menu,
.alert {
    background: linear-gradient(130deg, var(--shop-glass-bg), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--shop-stroke-2);
    backdrop-filter: blur(var(--shop-blur));
    -webkit-backdrop-filter: blur(var(--shop-blur));
    box-shadow: var(--shop-shadow-soft);
}

.glass-shell {
    position: relative;
}

.shop-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem;
    z-index: 1200;
    border-bottom: 1px solid var(--shop-stroke-1);
}

.select-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--shop-stroke-1);
}

.shop-header-left,
.shop-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shop-header-logo,
.logo,
.select-header-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--shop-text-1);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.shop-header-logo i,
.logo i,
.select-header-logo i,
.section-title i,
.page-header h1 i,
.shop-nav-item i,
.quick-action i,
.shop-stat i {
    color: var(--shop-accent);
}

.shop-header-logo:hover,
.logo:hover,
.select-header-logo:hover {
    opacity: 0.9;
}

.shop-server-badge {
    display: none;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--shop-text-3);
    padding: 0.35rem 0.65rem;
    border-radius: var(--shop-radius-pill);
    border: 1px solid var(--shop-stroke-2);
    background: var(--shop-glass-bg);
}

.shop-balance {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--shop-radius-pill);
    color: var(--shop-text-1);
    font-weight: 600;
    font-size: 0.86rem;
}

.shop-balance i {
    color: var(--shop-warning);
}

.theme-toggle,
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--shop-stroke-2);
    border-radius: var(--shop-radius-sm);
    color: var(--shop-text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--shop-glass-bg);
    cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle-btn:hover {
    color: var(--shop-text-1);
    background: var(--shop-glass-hover);
}

[data-theme="dark"] .theme-toggle .fa-sun,
[data-theme="dark"] .theme-toggle-btn .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-moon,
[data-theme="dark"] .theme-toggle-btn .fa-moon {
    display: inline;
}

[data-theme="light"] .theme-toggle .fa-sun,
[data-theme="light"] .theme-toggle-btn .fa-sun {
    display: inline;
}

[data-theme="light"] .theme-toggle .fa-moon,
[data-theme="light"] .theme-toggle-btn .fa-moon {
    display: none;
}

.shop-user-dropdown,
.dropdown {
    position: relative;
}

.shop-user-btn,
.dropdown-btn {
    background: none;
    border: none;
    color: var(--shop-text-1);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.shop-user-avatar,
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--shop-stroke-1);
    background: var(--shop-bg-3);
}

.shop-user-avatar-fallback,
.user-avatar-placeholder,
.user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text-3);
}

.shop-user-menu,
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: 220px;
    background: var(--shop-bg-2);
    background-image: none;
    border: 1px solid var(--shop-stroke-1);
    border-radius: var(--shop-radius-md);
    box-shadow: var(--shop-shadow-2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0.4rem;
    display: none;
    z-index: 1300;
}

.shop-user-menu.show,
.dropdown.active .dropdown-menu {
    display: block;
}

.shop-user-info,
.dropdown-user {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--shop-stroke-2);
    margin-bottom: 0.2rem;
}

.shop-user-name,
.dropdown-user-name,
.user-name {
    color: var(--shop-text-1);
    font-weight: 600;
    font-size: 0.88rem;
}

.shop-user-id,
.dropdown-user-id,
.user-tag {
    color: var(--shop-text-3);
    font-size: 0.76rem;
}

.shop-user-menu-item,
.dropdown-item,
.quick-link,
.logout-btn,
.change-server-btn,
.login-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--shop-text-2);
    text-decoration: none;
    border-radius: var(--shop-radius-sm);
    border: 1px solid transparent;
}

.shop-user-menu-item,
.dropdown-item {
    padding: 0.68rem 0.8rem;
    font-size: 0.84rem;
}

.shop-user-menu-item:hover,
.dropdown-item:hover,
.quick-link:hover,
.change-server-btn:hover,
.login-btn:hover,
.logout-btn:hover {
    color: var(--shop-text-1);
    background: var(--shop-glass-hover);
    border-color: var(--shop-stroke-1);
}

.shop-user-menu-item.danger,
.dropdown-item.danger,
.logout-btn {
    color: var(--shop-danger);
}

.shop-user-menu-divider,
.dropdown-divider {
    height: 1px;
    margin: 0.3rem 0;
    background: var(--shop-stroke-2);
}

.shop-main {
    min-height: 100vh;
    padding-top: 74px;
    padding-bottom: 1.2rem;
}

.glass-shell.has-shop-nav .shop-main {
    padding-top: calc(64px + var(--shop-nav-height) + 10px);
}

.shop-content {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0.9rem 1rem 1.8rem;
}

.shop-content > *,
.main-container > *,
.select-container > * {
    opacity: 0;
    transform: translateY(14px);
    animation: glass-page-enter var(--shop-enter) forwards;
}

.shop-content > *:nth-child(1),
.main-container > *:nth-child(1),
.select-container > *:nth-child(1) { animation-delay: 0ms; }
.shop-content > *:nth-child(2),
.main-container > *:nth-child(2),
.select-container > *:nth-child(2) { animation-delay: 40ms; }
.shop-content > *:nth-child(3),
.main-container > *:nth-child(3),
.select-container > *:nth-child(3) { animation-delay: 80ms; }
.shop-content > *:nth-child(4),
.main-container > *:nth-child(4),
.select-container > *:nth-child(4) { animation-delay: 120ms; }
.shop-content > *:nth-child(5),
.main-container > *:nth-child(5),
.select-container > *:nth-child(5) { animation-delay: 160ms; }
.shop-content > *:nth-child(6),
.main-container > *:nth-child(6),
.select-container > *:nth-child(6) { animation-delay: 200ms; }
.shop-content > *:nth-child(7),
.main-container > *:nth-child(7),
.select-container > *:nth-child(7) { animation-delay: 240ms; }
.shop-content > *:nth-child(8),
.main-container > *:nth-child(8),
.select-container > *:nth-child(8) { animation-delay: 280ms; }

@keyframes glass-page-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shop-bottom-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: var(--shop-nav-height);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    padding: 0.4rem 0.5rem 0.35rem;
    border-bottom: 1px solid var(--shop-stroke-1);
    z-index: 1190;
}

.shop-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    text-decoration: none;
    color: var(--shop-text-4);
    font-size: 0.68rem;
    padding: 0.44rem 0.22rem;
    border-radius: var(--shop-radius-sm);
}

.shop-nav-item i {
    font-size: 1.06rem;
}

.shop-nav-item.active {
    color: var(--shop-text-1);
    background: var(--shop-glass-selected);
    box-shadow: inset 0 0 0 1px var(--shop-stroke-2);
}

.shop-nav-item:hover {
    color: var(--shop-text-1);
}

.shop-flash,
.flash-container {
    position: fixed;
    top: calc(64px + var(--shop-nav-height) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1250;
    width: min(460px, calc(100vw - 1.5rem));
}

.shop-flash .alert,
.alert {
    border-radius: var(--shop-radius-sm);
    color: var(--shop-text-1);
    margin-bottom: 0.45rem;
    padding: 0.9rem 1rem;
}

.alert-success { border-color: var(--shop-success); background: var(--shop-success-soft); color: var(--shop-success); }
.alert-warning { border-color: var(--shop-warning); background: var(--shop-warning-soft); color: var(--shop-warning); }
.alert-info { border-color: var(--shop-info); background: var(--shop-info-soft); color: var(--shop-info); }
.alert-error { border-color: var(--shop-danger); background: var(--shop-danger-soft); color: var(--shop-danger); }

/* common content blocks */
.section-header,
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    border-radius: var(--shop-radius-md);
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
}

.page-header h1,
.section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.58rem;
    color: var(--shop-text-1);
    font-size: clamp(1.12rem, 1.8vw, 1.4rem);
    font-weight: 700;
}

.section-link {
    color: var(--shop-text-2);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--shop-radius-pill);
    border: 1px solid var(--shop-stroke-2);
    background: var(--shop-glass-bg);
}

.section-link:hover {
    color: var(--shop-text-1);
    background: var(--shop-glass-hover);
}

.result-count,
.section-count,
.danger-title,
.balance-label,
.stat-label,
.meta-label,
.total-label,
.server-id,
.history-date,
.product-stock,
.product-description,
.product-description-text,
.form-label,
.empty-state p,
.empty-products p,
.empty-banks p,
.success-text,
.modal-message,
.shop-card-description,
.shop-user-id {
    color: var(--shop-text-3);
}

/* home */
.shop-welcome {
    border-radius: var(--shop-radius-lg);
    margin-bottom: 1.2rem;
    padding: 2.1rem 1.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.shop-welcome::after {
    content: "";
    position: absolute;
    inset: -20% -5% auto;
    height: 65%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.28), transparent 62%);
    opacity: 0.35;
    pointer-events: none;
}

.shop-welcome h1 {
    color: var(--shop-text-1);
    font-size: clamp(1.35rem, 4vw, 2rem);
    margin-bottom: 0.45rem;
}

.shop-welcome p {
    color: var(--shop-text-2);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

.quick-action {
    border-radius: var(--shop-radius-md);
    padding: 1.15rem 0.9rem;
    text-decoration: none;
    color: var(--shop-text-1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.quick-action:hover,
.product-card:hover,
.shop-card:hover,
.server-card:hover,
.filter-chip:hover,
.category-chip:hover,
.bank-account-option:hover,
.history-item:hover,
.stat-card:hover,
.charge-section:hover,
.profile-header:hover,
.server-info:hover,
.product-info-card:hover,
.product-image-container:hover {
    transform: translateY(-2px);
    border-color: var(--shop-stroke-1);
    box-shadow: var(--shop-shadow-1);
}

.quick-action i {
    font-size: 1.3rem;
}

.quick-action span {
    font-size: 0.84rem;
    font-weight: 600;
}

.category-scroll,
.filter-bar,
.filter-tabs {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    padding-bottom: 0.15rem;
}

.category-scroll::-webkit-scrollbar,
.filter-bar::-webkit-scrollbar,
.filter-tabs::-webkit-scrollbar {
    display: none;
}

.category-chip,
.filter-chip,
.filter-tab {
    border-radius: var(--shop-radius-pill);
    border: 1px solid var(--shop-stroke-2);
    color: var(--shop-text-2);
    white-space: nowrap;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--shop-glass-bg);
}

.filter-chip.active,
.filter-tab.active {
    color: var(--shop-accent-ink);
    background: var(--shop-accent);
    border-color: transparent;
    font-weight: 700;
}

.category-chip .color-dot,
.filter-chip .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.product-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-card {
    border-radius: var(--shop-radius-md);
    text-decoration: none;
    overflow: hidden;
    color: inherit;
}

.product-image {
    position: relative;
    width: 100%;
    height: 132px;
    background: linear-gradient(145deg, var(--shop-bg-3), var(--shop-bg-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text-4);
    font-size: 2rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-category-badge {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    border-radius: var(--shop-radius-pill);
    padding: 0.2rem 0.55rem;
    font-size: 0.64rem;
    font-weight: 700;
    color: #fff;
}

.product-info {
    padding: 0.85rem;
}

.product-name {
    color: var(--shop-text-1);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-description {
    font-size: 0.75rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
}

.product-price,
.product-price-large,
.total-value,
.balance-amount,
.success-amount {
    color: var(--shop-text-1);
    font-weight: 700;
}

.product-price-large,
.balance-amount {
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
}

.product-stock.out-of-stock,
.meta-value.danger,
.history-amount.negative,
.warning-box p,
.warning-box i,
.danger-zone .danger-title,
.logout-btn {
    color: var(--shop-danger);
}

.empty-state,
.empty-products,
.empty-banks {
    border-radius: var(--shop-radius-md);
    text-align: center;
    padding: 2rem 1.1rem;
}

.empty-state i,
.empty-products i,
.empty-banks i {
    color: var(--shop-text-4);
    font-size: 2rem;
    margin-bottom: 0.55rem;
}

/* product detail */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--shop-text-3);
    text-decoration: none;
    margin-bottom: 0.8rem;
    font-size: 0.82rem;
}

.back-link:hover {
    color: var(--shop-text-1);
}

.product-detail {
    display: grid;
    gap: 0.9rem;
}

.product-image-container,
.product-info-card {
    border-radius: var(--shop-radius-lg);
    padding: 1.1rem;
}

.product-image-container {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--shop-radius-lg) - 6px);
}

.product-image-placeholder {
    color: var(--shop-text-4);
    font-size: 4rem;
}

.product-category {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.7rem;
    border-radius: var(--shop-radius-pill);
    margin-bottom: 0.7rem;
    color: #fff;
}

.product-title {
    color: var(--shop-text-1);
    font-size: clamp(1.2rem, 2.8vw, 1.8rem);
    margin-bottom: 0.4rem;
}

.product-meta {
    margin: 1rem 0;
    padding: 0.95rem 0;
    border-top: 1px solid var(--shop-stroke-2);
    border-bottom: 1px solid var(--shop-stroke-2);
    display: grid;
    gap: 0.62rem;
}

.meta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.meta-value {
    color: var(--shop-text-1);
    font-weight: 600;
}

.meta-value.success,
.history-amount.positive,
.stat-value.positive,
.success-icon,
.modal-icon,
.status-badge.completed,
.stat-icon.balance,
.stat-icon.role,
.info-box i {
    color: var(--shop-success);
}

.quantity-selector {
    margin: 0.95rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.quantity-label {
    font-size: 0.82rem;
}

.quantity-input-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.quantity-btn,
.quantity-input,
.form-input,
.secondary-btn,
.submit-btn,
.buy-btn,
.modal-btn,
.copy-btn,
.load-more,
.change-server-btn {
    border-radius: var(--shop-radius-sm);
    border: 1px solid var(--shop-stroke-2);
    background: var(--shop-glass-bg);
    color: var(--shop-text-1);
}

.quantity-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-btn:hover,
.modal-btn:hover,
.copy-btn:hover,
.secondary-btn:hover,
.load-more:hover,
.change-server-btn:hover {
    background: var(--shop-glass-hover);
}

.quantity-btn:disabled,
.submit-btn:disabled,
.buy-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.quantity-input {
    width: 58px;
    padding: 0.45rem;
    text-align: center;
    font-weight: 700;
}

.total-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    border-radius: var(--shop-radius-sm);
    border: 1px solid var(--shop-stroke-2);
    background: var(--shop-glass-bg);
    margin-bottom: 0.8rem;
}

.submit-btn,
.buy-btn,
.modal-btn,
.copy-btn,
.secondary-btn,
.load-more {
    width: 100%;
    padding: 0.72rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.submit-btn,
.buy-btn,
.modal-btn {
    background: var(--shop-accent);
    color: var(--shop-accent-ink);
    border-color: transparent;
}

.submit-btn:hover,
.buy-btn:hover,
.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shop-shadow-1);
}

.buy-btn.loading,
.submit-btn.loading {
    pointer-events: none;
}

.warning-box {
    border: 1px solid var(--shop-danger);
    background: var(--shop-danger-soft);
    border-radius: var(--shop-radius-sm);
    padding: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    width: min(430px, 100%);
    border-radius: var(--shop-radius-lg);
    padding: 1.4rem;
    text-align: center;
}

.modal-icon {
    font-size: 2.6rem;
}

.modal-title {
    margin-top: 0.35rem;
    color: var(--shop-text-1);
}

.modal-items {
    margin: 0.95rem 0;
    max-height: 210px;
    overflow-y: auto;
    padding: 0.7rem;
    border-radius: var(--shop-radius-sm);
    border: 1px solid var(--shop-stroke-2);
    background: var(--shop-glass-bg);
    text-align: left;
}

.modal-item {
    border-radius: var(--shop-radius-xs);
    padding: 0.5rem;
    background: var(--shop-glass-bg-strong);
    color: var(--shop-text-1);
    font-family: var(--shop-font-mono);
    font-size: 0.8rem;
    margin-bottom: 0.42rem;
    word-break: break-all;
}

.modal-item:last-child {
    margin-bottom: 0;
}

/* charge */
.balance-card,
.charge-section,
.history-item,
.stat-card,
.quick-links,
.server-info,
.profile-header,
.select-title,
.hero,
.shop-card,
.server-card {
    border-radius: var(--shop-radius-lg);
}

.balance-card,
.profile-header,
.hero,
.select-title {
    padding: 1.3rem;
}

.balance-card {
    margin-bottom: 0.9rem;
}

.charge-section {
    padding: 1.2rem;
    margin-bottom: 0.9rem;
}

.section-title {
    margin-bottom: 0.75rem;
}

.form-group {
    margin-bottom: 0.72rem;
}

.form-input {
    width: 100%;
    padding: 0.72rem 0.86rem;
    font-size: 0.92rem;
    outline: none;
}

.form-input:focus {
    border-color: var(--shop-stroke-1);
    box-shadow: inset 0 0 0 1px var(--shop-stroke-1);
}

.bank-accounts {
    display: grid;
    gap: 0.55rem;
}

.bank-account-option {
    border-radius: var(--shop-radius-sm);
    border: 1px solid var(--shop-stroke-2);
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    background: var(--shop-glass-bg);
}

.bank-account-option input {
    display: none;
}

.bank-account-option.selected {
    background: var(--shop-glass-selected);
    border-color: var(--shop-stroke-1);
}

.bank-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--shop-stroke-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bank-radio::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: none;
    background: var(--shop-text-1);
}

.bank-account-option.selected .bank-radio::after {
    display: block;
}

.bank-name,
.server-name,
.history-description,
.stat-value,
.success-title,
.shop-card-name {
    color: var(--shop-text-1);
    font-weight: 600;
}

.info-box {
    border-radius: var(--shop-radius-sm);
    border: 1px solid var(--shop-info);
    background: var(--shop-info-soft);
    padding: 0.75rem;
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
}

.info-box p {
    color: var(--shop-text-2);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
}

.success-message {
    display: none;
    text-align: center;
    padding: 1rem 0.5rem;
}

.success-message.show {
    display: block;
}

.success-icon {
    font-size: 2.4rem;
    margin-bottom: 0.45rem;
}

.crypto-summary {
    margin-top: 0.75rem;
    padding: 0.72rem;
    border-radius: var(--shop-radius-sm);
    border: 1px solid var(--shop-stroke-2);
    background: var(--shop-glass-bg);
    display: none;
}

.crypto-summary.show {
    display: block;
}

.crypto-summary .row {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.44rem;
}

.crypto-summary .row:last-child {
    margin-bottom: 0;
}

.crypto-summary .label {
    color: var(--shop-text-3);
    font-size: 0.76rem;
}

.crypto-summary .value {
    color: var(--shop-text-1);
    font-size: 0.82rem;
    text-align: right;
    font-weight: 600;
    word-break: break-all;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: var(--shop-radius-pill);
    padding: 0.24rem 0.62rem;
    margin-bottom: 0.65rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.status-badge.pending { background: var(--shop-info-soft); color: var(--shop-info); }
.status-badge.detected { background: var(--shop-warning-soft); color: var(--shop-warning); }
.status-badge.completed { background: var(--shop-success-soft); color: var(--shop-success); }
.status-badge.expired { background: var(--shop-danger-soft); color: var(--shop-danger); }

/* history */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    margin-bottom: 0.9rem;
}

.stat-card {
    padding: 0.9rem;
    text-align: center;
}

.stat-value {
    margin-top: 0.22rem;
    font-size: 1.14rem;
}

.stat-value.negative,
.stat-icon.spent {
    color: var(--shop-danger);
}

.history-list {
    display: grid;
    gap: 0.65rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem;
}

.history-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--shop-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--shop-glass-bg-strong);
    flex-shrink: 0;
}

.history-icon.purchase { color: var(--shop-danger); }
.history-icon.charge { color: var(--shop-success); }

.history-info {
    min-width: 0;
    flex: 1;
}

.history-description {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
}

.history-amount {
    font-weight: 700;
    font-size: 0.92rem;
    text-align: right;
}

/* profile */
.profile-header {
    text-align: center;
    margin-bottom: 0.9rem;
}

.profile-avatar,
.profile-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    border: 2px solid var(--shop-stroke-1);
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text-4);
    font-size: 2.1rem;
    background: var(--shop-glass-bg);
}

.profile-name {
    color: var(--shop-text-1);
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.profile-username {
    color: var(--shop-text-3);
    margin-bottom: 0.65rem;
}

.profile-discord-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: var(--shop-radius-pill);
    padding: 0.42rem 0.9rem;
    background: var(--shop-accent);
    color: var(--shop-accent-ink);
    font-size: 0.78rem;
    font-weight: 700;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.75rem;
    margin-bottom: 0.9rem;
}

.server-icon,
.server-icon-placeholder {
    width: 50px;
    height: 50px;
    border-radius: var(--shop-radius-sm);
    background: var(--shop-glass-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text-4);
    border: 1px solid var(--shop-stroke-2);
}

.server-icon img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.server-details {
    min-width: 0;
    flex: 1;
}

.change-server-btn {
    padding: 0.45rem 0.8rem;
    width: auto;
    font-size: 0.8rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    margin-bottom: 0.9rem;
}

.stat-card {
    padding: 0.9rem 0.75rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 0.55rem;
    border-radius: var(--shop-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--shop-glass-bg-strong);
}

.quick-links {
    overflow: hidden;
    border-radius: var(--shop-radius-lg);
    margin-bottom: 0.7rem;
}

.quick-link {
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid var(--shop-stroke-2);
    border-radius: 0;
}

.quick-link:last-child {
    border-bottom: none;
}

.quick-link .arrow {
    color: var(--shop-text-4);
    margin-left: auto;
}

.logout-btn {
    margin-top: 0.48rem;
    border-color: var(--shop-danger);
    background: var(--shop-danger-soft);
}

.danger-zone {
    margin-top: 1rem;
}

/* landing */
.main-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 78px 1rem 1rem;
}

.shop-header,
.select-header {
    border-radius: 0;
}

.header-left,
.header-right,
.select-header-left,
.select-header-right,
.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.search-box {
    display: none;
    align-items: center;
    width: min(360px, 40vw);
    border-radius: var(--shop-radius-pill);
    padding: 0.52rem 0.74rem;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--shop-text-1);
    width: 100%;
    font-size: 0.84rem;
}

.search-box input::placeholder {
    color: var(--shop-text-4);
}

.search-box i {
    color: var(--shop-text-3);
}

.hero {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -35% 10% auto;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 62%);
    opacity: 0.48;
    pointer-events: none;
}

.hero-icon {
    font-size: 2.5rem;
    color: var(--shop-accent);
    margin-bottom: 0.55rem;
}

.hero h1 {
    font-size: clamp(1.5rem, 5vw, 2.6rem);
    color: var(--shop-text-1);
    margin-bottom: 0.48rem;
}

.hero p {
    color: var(--shop-text-2);
    width: min(700px, 100%);
    margin: 0 auto;
}

.section {
    margin-bottom: 1rem;
}

.section-count {
    font-size: 0.74rem;
    border-radius: var(--shop-radius-pill);
    padding: 0.26rem 0.67rem;
}

.shop-grid {
    display: grid;
    gap: 0.78rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.shop-card {
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.shop-card-banner {
    position: relative;
    height: 125px;
    background-size: cover;
    background-position: center;
}

.shop-card-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
}

[data-theme="light"] .shop-card-banner::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.34));
}

.shop-card-banner.gradient-1 { background: linear-gradient(145deg, #2c2c2c, #151515); }
.shop-card-banner.gradient-2 { background: linear-gradient(145deg, #3b3b3b, #181818); }
.shop-card-banner.gradient-3 { background: linear-gradient(145deg, #474747, #202020); }
.shop-card-banner.gradient-4 { background: linear-gradient(145deg, #262626, #111111); }
.shop-card-banner.gradient-5 { background: linear-gradient(145deg, #555555, #242424); }
.shop-card-banner.gradient-6 { background: linear-gradient(145deg, #1f1f1f, #080808); }

[data-theme="light"] .shop-card-banner.gradient-1 { background: linear-gradient(145deg, #f2f2f2, #e2e2e2); }
[data-theme="light"] .shop-card-banner.gradient-2 { background: linear-gradient(145deg, #f7f7f7, #e6e6e6); }
[data-theme="light"] .shop-card-banner.gradient-3 { background: linear-gradient(145deg, #efefef, #dcdcdc); }
[data-theme="light"] .shop-card-banner.gradient-4 { background: linear-gradient(145deg, #ffffff, #ebebeb); }
[data-theme="light"] .shop-card-banner.gradient-5 { background: linear-gradient(145deg, #f9f9f9, #dfdfdf); }
[data-theme="light"] .shop-card-banner.gradient-6 { background: linear-gradient(145deg, #ededed, #d8d8d8); }

.shop-card-icon,
.shop-card-icon-placeholder {
    position: absolute;
    left: 0.95rem;
    bottom: -27px;
    z-index: 2;
    width: 56px;
    height: 56px;
    border-radius: var(--shop-radius-sm);
    border: 2px solid var(--shop-stroke-1);
    object-fit: cover;
    background: var(--shop-bg-2);
}

.is-hidden {
    display: none !important;
}

.shop-card-icon-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--shop-text-3);
}

.shop-card-body {
    padding: 2.05rem 0.95rem 0.95rem;
}

.shop-card-name {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.shop-card-description {
    font-size: 0.8rem;
    margin-bottom: 0.7rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.shop-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--shop-text-3);
    font-size: 0.73rem;
}

.dropdown-chevron {
    font-size: 0.72rem;
    color: var(--shop-text-3);
}

/* server select */
.select-container {
    width: min(900px, 100%);
    margin: 0 auto;
    padding: 1rem;
}

.crypto-manual-btn {
    display: none;
}

.header-right .login-btn,
.header-right .logout-btn,
.select-header-right .logout-btn {
    width: auto;
    margin-top: 0;
    padding: 0.56rem 0.88rem;
    border-radius: var(--shop-radius-sm);
}

.header-right .logout-btn,
.select-header-right .logout-btn {
    background: var(--shop-glass-bg);
    border-color: var(--shop-stroke-2);
    color: var(--shop-text-2);
}

.header-right .logout-btn:hover,
.select-header-right .logout-btn:hover {
    color: var(--shop-danger);
    border-color: var(--shop-danger);
    background: var(--shop-danger-soft);
}

.danger-zone .logout-btn {
    width: 100%;
    padding: 0.85rem 0.95rem;
    font-size: 0.84rem;
}

.header-right .login-btn {
    background: var(--shop-accent);
    color: var(--shop-accent-ink);
    border-color: transparent;
}

.header-right .login-btn:hover {
    background: var(--shop-accent);
    color: var(--shop-accent-ink);
    transform: translateY(-1px);
    box-shadow: var(--shop-shadow-1);
}

.select-title {
    text-align: center;
    margin-bottom: 0.95rem;
}

.select-title h1 {
    color: var(--shop-text-1);
    font-size: clamp(1.2rem, 3.2vw, 1.7rem);
    margin-bottom: 0.34rem;
}

.select-title p {
    color: var(--shop-text-3);
}

.server-grid {
    display: grid;
    gap: 0.72rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.server-card {
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.58rem;
}

.server-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.server-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--shop-radius-sm);
    object-fit: cover;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: var(--shop-radius-pill);
    padding: 0.22rem 0.6rem;
    background: var(--shop-warning-soft);
    color: var(--shop-warning);
    font-size: 0.68rem;
    font-weight: 700;
}

.loading-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--shop-stroke-2);
    border-top-color: var(--shop-text-1);
    animation: glass-spin 0.8s linear infinite;
}

.server-card.loading .loading-spinner {
    display: block;
}

@keyframes glass-spin {
    to {
        transform: rotate(360deg);
    }
}

/* responsive */
@media (min-width: 360px) {
    .shop-content,
    .main-container,
    .select-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 768px) {
    .shop-main {
        padding-top: 82px;
    }

    .glass-shell.has-shop-nav .shop-main {
        padding-top: calc(72px + var(--shop-nav-height) + 10px);
    }

    .main-container {
        padding-top: 86px;
    }

    .shop-header,
    .select-header {
        height: 72px;
        padding: 0 1.3rem;
    }

    .shop-bottom-nav {
        top: 72px;
    }

    .shop-flash,
    .flash-container {
        top: calc(72px + var(--shop-nav-height) + 10px);
    }

    .shop-server-badge,
    .user-details,
    .search-box {
        display: inline-flex;
    }

    .shop-content {
        padding-top: 1.2rem;
        padding-bottom: 2.2rem;
    }

    .quick-actions {
        gap: 1rem;
    }

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

    .product-image {
        height: 152px;
    }

    .product-detail {
        grid-template-columns: 1.02fr 1fr;
        gap: 1rem;
    }

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

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

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

@media (min-width: 1200px) {
    .shop-content {
        max-width: 1280px;
    }

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

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

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }

    .shop-content > *,
    .main-container > *,
    .select-container > * {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
