/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --bg-input: #15151f;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --text-primary: #e8e8f0;
    --text-secondary: #9898a8;
    --text-muted: #6a6a7a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ========== NAVBAR ========== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.logo-jlr {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-dot { color: var(--accent); }

.currency-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: 0.5rem;
}

.cur-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: transparent;
    transition: all var(--transition);
    text-decoration: none;
}

.cur-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.cur-btn.active {
    background: var(--accent);
    color: #fff;
}

.mobile-currency {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.mobile-currency .cur-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.nav-categories {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-cat-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-cat-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.nav-icon:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
}

.nav-username {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-mobile {
    display: none;
    flex-direction: column;
    padding: 0.5rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
}

.nav-mobile a {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.nav-mobile a:last-child { border-bottom: none; }

.nav-mobile.active { display: flex; }

/* ========== MAIN ========== */
.main-content {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.main-content.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 1.5rem;
}

/* ========== FLASH MESSAGES ========== */
.flash-container {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: var(--success-bg); border: 1px solid var(--success); color: var(--success); }
.flash-danger { background: var(--danger-bg); border: 1px solid var(--danger); color: var(--danger); }
.flash-warning { background: var(--warning-bg); border: 1px solid var(--warning); color: var(--warning); }
.flash-info { background: var(--info-bg); border: 1px solid var(--info); color: var(--info); }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

/* ========== AUTH FORMS ========== */
.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239898a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-error {
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2, .card-header h3 {
    font-weight: 600;
}

/* ========== PAGE HEADERS ========== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== PRODUCTS GRID ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.product-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card h3 a {
    color: var(--text-primary);
}

.product-card h3 a:hover { color: var(--accent); }

.product-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    flex: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.product-price small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.tag-12v {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-no12v {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-app {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: var(--info-bg);
    border: 1px solid var(--info);
    border-radius: var(--radius-sm);
    color: var(--info);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-web {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid #a855f7;
    border-radius: var(--radius-sm);
    color: #a855f7;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ========== PRODUCT DETAIL ========== */
.product-detail {
    max-width: 700px;
}

.product-detail h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.product-detail-price small {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.product-detail-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.product-detail-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* ========== CART ========== */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.cart-total {
    text-align: right;
    padding: 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.cart-total span { color: var(--accent); }

/* ========== CHECKOUT SECTION ========== */
.checkout-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
}

.checkout-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ========== ORDERS TABLE ========== */
.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.orders-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.orders-table tr:hover td { background: var(--bg-card-hover); }

/* ========== STATUS BADGES ========== */
.status {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-confirmed { background: var(--info-bg); color: var(--info); }
.status-pending_approval { background: var(--warning-bg); color: var(--warning); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-completed { background: var(--success-bg); color: var(--success); }
.status-cancelled { background: var(--danger-bg); color: var(--danger); }

/* ========== ORDER DETAIL ========== */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.order-info-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.order-info-item label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.order-info-item span {
    font-size: 1rem;
    font-weight: 600;
}

/* ========== MESSAGES ========== */
.messages-section {
    margin-top: 2rem;
}

.messages-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.message-bubble {
    margin-bottom: 1rem;
    max-width: 80%;
}

.message-bubble.user { margin-left: 0; }
.message-bubble.admin { margin-left: auto; }

.message-content {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
}

.message-bubble.user .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.message-bubble.admin .message-content {
    background: var(--accent-glow);
    border: 1px solid var(--accent);
}

.message-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

.message-bubble.admin .message-meta { text-align: right; }

/* ========== PAYMENT INFO ========== */
.payment-info {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 1.5rem;
}

.payment-info h2 {
    color: var(--accent);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.payment-method-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
}

.payment-method-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.payment-method-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.payment-method-card.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ========== ADMIN STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* ========== ADMIN TABS / FILTERS ========== */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.filter-btn:hover, .filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ========== PENDING PAGE ========== */
.pending-card {
    text-align: center;
    max-width: 500px;
}

.pending-card i {
    font-size: 3rem;
    color: var(--warning);
    margin-bottom: 1rem;
}

.pending-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.pending-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ========== CONFIRMATION ========== */
.confirmation-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 1rem;
}

/* ========== UPLOAD SECTION ========== */
.upload-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.upload-section h3 {
    margin-bottom: 1rem;
}

input[type="file"] {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

input[type="file"]::file-selector-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 0.75rem;
    font-family: inherit;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-size: 1rem;
    font-weight: 700;
}

.footer-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ========== ERROR PAGE ========== */
.error-page {
    text-align: center;
}

.error-page h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.error-page p {
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-categories, .nav-right, .nav-user { display: none; }
    .nav-toggle { display: block; }

    .products-grid { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .order-info-grid { grid-template-columns: 1fr; }

    .payment-methods { grid-template-columns: 1fr; }

    .footer-container { flex-direction: column; text-align: center; }
    .footer-links { flex-direction: column; gap: 0.5rem; }

    .auth-card { padding: 1.5rem; }

    .message-bubble { max-width: 95%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.35rem; }
}
