/* ============================================
   NuggetShop — Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #131316;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-border: rgba(255, 255, 255, 0.08);

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;
    --accent-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --accent-glow: rgba(245, 158, 11, 0.15);

    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(245, 158, 11, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(245, 158, 11, 0.1);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(217, 119, 6, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* --- Loading Screen --- */
#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loader-brand {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Header / Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    user-select: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
    border-color: var(--bg-glass-border);
}

.nav-btn.active {
    color: var(--accent);
    background: var(--accent-glow);
    border-color: var(--border-active);
}

.nav-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- Main Content --- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    min-height: calc(100vh - 64px);
}

/* --- Section Headers --- */
.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --- Hero / Login Section --- */
.hero {
    text-align: center;
    padding: 80px 24px;
    max-width: 640px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-title .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-feature .icon {
    font-size: 1.2rem;
}

#telegram-login-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

/* --- Search & Filters --- */
.search-bar-container {
    position: relative;
    margin-bottom: 24px;
}

.search-bar {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.search-bar:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 7px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-glow);
    border-color: var(--border-active);
    color: var(--accent);
}

/* --- Store Grid --- */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.store-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.store-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.store-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.store-card:hover::before {
    opacity: 0.03;
}

.store-card-content {
    position: relative;
    z-index: 1;
}

.store-card-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.store-card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.store-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--accent-glow);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 10px;
}

/* --- Store Detail View --- */
.store-detail-header {
    margin-bottom: 32px;
}

.store-detail-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.store-detail-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
    font-style: italic;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

/* --- Product Table --- */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.product-row:hover {
    border-color: var(--bg-glass-border);
    background: var(--bg-card-hover);
}

.product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-denom {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-original-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-final-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.product-discount-badge {
    padding: 2px 8px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}

.product-stock {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-input {
    width: 60px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    text-align: center;
    outline: none;
}

.qty-input:focus {
    border-color: var(--accent);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #000;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--bg-glass-border);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Cart Drawer --- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 201;
    transform: translateX(100%);
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.cart-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.cart-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.cart-qty-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.cart-qty-value {
    width: 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.cart-item-price {
    font-weight: 700;
    color: var(--accent);
    min-width: 60px;
    text-align: right;
}

.cart-remove-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.cart-remove-btn:hover {
    color: #ef4444; /* red */
    background: rgba(239, 68, 68, 0.1);
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
}

.cart-empty-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.cart-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-total-amount {
    font-size: 1.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Checkout Page --- */
.checkout-container {
    max-width: 600px;
    margin: 0 auto;
}

.checkout-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.checkout-summary h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.checkout-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.checkout-line.total {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.payment-method:hover {
    border-color: var(--border-active);
    background: var(--bg-card-hover);
}

.payment-method-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
}

.payment-method-info h4 {
    font-weight: 600;
    margin-bottom: 2px;
}

.payment-method-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.payment-method.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Coupon Input --- */
.coupon-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.coupon-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    outline: none;
}

.coupon-input:focus {
    border-color: var(--accent);
}

.coupon-applied {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--success);
    margin-top: 12px;
}

/* --- Profile Section --- */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
}

.profile-username {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.profile-stat {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Order History --- */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.order-card:hover {
    border-color: var(--bg-glass-border);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.order-status {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.order-status.completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.order-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.order-status.paid {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.order-status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.order-status.credited {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.order-card-items {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.order-total {
    font-weight: 700;
    color: var(--accent);
}

.order-date {
    color: var(--text-muted);
}

/* --- Card/Code Display --- */
.card-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 8px;
}

.card-display-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.card-display-code {
    font-family: monospace;
    font-size: 0.85rem;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--accent);
}

/* --- Payment Status --- */
.payment-waiting {
    text-align: center;
    padding: 48px 24px;
}

.payment-waiting-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.payment-waiting h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.payment-waiting p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 12px;
}

/* --- TOS Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal p, .modal li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal ul {
    padding-left: 16px;
    margin: 12px 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* --- Pending Payment Actions (Order Detail) --- */
.pending-payment-actions {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Admin Dashboard --- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.admin-section {
    margin-bottom: 32px;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.admin-store-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.admin-toggle-label input[type="checkbox"] {
    accent-color: var(--accent);
}

/* --- Admin Store Table --- */
.admin-store-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.admin-store-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 0.6fr 0.5fr 0.7fr;
    padding: 12px 16px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.admin-store-row:last-child {
    border-bottom: none;
}

.admin-store-row-header {
    background: var(--bg-glass);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-store-hidden {
    opacity: 0.55;
}

.admin-store-link {
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
}

.admin-store-link:hover {
    color: var(--accent);
}

.admin-flag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-right: 4px;
}

.admin-flag-hidden { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.admin-flag-pdf { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.admin-flag-pin { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.admin-flag-manual { background: rgba(245, 158, 11, 0.15); color: var(--accent); }

/* --- Admin Store Detail / Edit --- */
.admin-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.admin-edit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.admin-edit-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-form-row label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.admin-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.admin-form-row input[type="text"],
.admin-form-row input[type="number"],
.admin-form-row textarea {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.admin-form-row input:focus,
.admin-form-row textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.admin-form-row textarea {
    resize: vertical;
    min-height: 60px;
}

.admin-checkbox-row {
    flex-direction: row !important;
    gap: 16px !important;
    flex-wrap: wrap;
}

.admin-checkbox-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.admin-checkbox-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* --- Admin Stock List --- */
.admin-add-stock {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-stock-list {
    max-height: 400px;
    overflow-y: auto;
}

.admin-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.admin-stock-item:last-child {
    border-bottom: none;
}

.admin-stock-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.admin-stock-denom {
    font-weight: 600;
    color: var(--accent);
    min-width: 50px;
}

.admin-stock-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Admin Quick Links --- */
.admin-quick-links {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

/* --- Admin Orders Filters --- */
.admin-orders-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-select {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.admin-select:focus {
    border-color: var(--accent);
}

.admin-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* --- Admin Detail Rows --- */
.admin-detail-rows {
    display: flex;
    flex-direction: column;
}

.admin-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.admin-detail-row:last-child {
    border-bottom: none;
}

.admin-detail-row code {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .app-container {
        padding: 20px 16px 80px;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .hero-features {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .store-grid {
        grid-template-columns: 1fr;
    }

    .product-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .product-actions {
        width: 100%;
    }

    .product-actions .btn {
        flex: 1;
    }

    .nav-btn span.label {
        display: none;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .admin-store-row {
        grid-template-columns: 1.5fr 1fr 0.8fr 0.5fr 0.5fr 0.6fr;
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .admin-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-store-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .checkout-container {
        padding: 0;
    }
}
