:root {
    --bg-base: #090a0f;
    --bg-surface: #10131a;
    --bg-surface-elevated: #161b24;
    --bg-input: #0b0e14;
    
    --border-subtle: #1e2430;
    --border-strong: #2a3344;
    --border-focus: #3b82f6;

    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;
    --brand-accent: #6366f1;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.theme-dark {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #60a5fa;
}

/* Header */
.site-header {
    background: rgba(16, 19, 26, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.brand-img-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}

.accent-text {
    color: var(--brand-primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: #fff;
    background: var(--bg-surface-elevated);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-btn {
    position: relative;
    width: 38px;
    height: 38px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

.cart-btn:hover {
    border-color: var(--brand-primary);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.avatar-sm {
    width: 22px;
    height: 22px;
    background: var(--brand-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 230px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0.4rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

.dropdown-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #fff;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.35rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.dropdown-item.text-danger:hover {
    color: var(--danger);
}

/* Page Layout */
.page-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Hero Section */
.hero-banner {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: #fff;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 620px;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.stat-item strong {
    display: block;
    font-size: 1.25rem;
    color: #fff;
    font-family: var(--font-heading);
}

.stat-item span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: #fff;
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: #1e2430;
}

.btn-outline-cyan {
    background: transparent;
    color: var(--brand-primary);
    border: 1px solid var(--border-strong);
}

.btn-outline-cyan:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--brand-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

/* Alerts */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Cards & Surfaces */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* Products */
.products-section-header {
    margin-bottom: 1.5rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.product-image-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    background: #080a0e;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-placeholder-img {
    font-size: 3rem;
    color: var(--text-muted);
}

.product-category-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(16, 19, 26, 0.9);
    color: var(--brand-primary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
}

.product-body {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.35rem;
    line-height: 1.35;
}

.product-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.empty-icon {
    font-size: 2.75rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
    color: #fff;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto;
    font-size: 0.9rem;
}

/* Form inputs */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.88rem;
}

.custom-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-strong);
}

.custom-table td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Method Selector */
.payment-methods-grid {
    display: grid;
    gap: 1rem;
}

.method-choice {
    position: relative;
}

.method-choice input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.method-box {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.method-choice input[type="radio"]:checked + .method-box {
    border-color: var(--brand-primary);
    background: rgba(59, 130, 246, 0.08);
}

.auth-container {
    max-width: 420px;
    margin: 2rem auto;
}

/* Footer */
.site-footer {
    background: #06070a;
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    max-width: 380px;
}

.security-badges {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.sec-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.92rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.payment-icons-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pay-chip {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
}
.image-lightbox.open { display: flex; }
.image-lightbox-stage {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    cursor: grab;
}
.image-lightbox-stage.dragging { cursor: grabbing; }
.image-lightbox-stage img {
    max-width: 95vw;
    max-height: 90vh;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}
.image-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    background: rgba(20,20,24,0.8);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
.image-lightbox-toolbar {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 0.5rem;
    background: rgba(20,20,24,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
}
.image-lightbox-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.image-lightbox-btn:hover { background: rgba(255,255,255,0.1); }
.product-image-zoom-trigger img { transition: opacity 0.15s ease; }
.product-image-zoom-trigger:hover img { opacity: 0.92; }

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
