/* ============================================
   CCS — Celestial Cargo Syndicate
   Sci-Fi Space Design System
   ============================================ */

/* ---------- Custom Properties ---------- */
:root {
    --bg-primary: #060b18;
    --bg-secondary: #0c1425;
    --bg-card: rgba(15, 25, 50, 0.7);
    --bg-glass: rgba(20, 35, 65, 0.5);
    --bg-hover: rgba(30, 50, 85, 0.6);

    --accent: #00e5ff;
    --accent-dim: #0097a7;
    --accent-glow: rgba(0, 229, 255, 0.3);
    --accent-gold: #fbbf24;
    --accent-gold-dim: #d97706;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(0, 229, 255, 0.15);
    --border-hover: rgba(0, 229, 255, 0.35);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --purple: #8b5cf6;

    --discord: #5865f2;

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

main {
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover { color: #fff; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

code {
    background: var(--bg-card);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent);
}

/* ---------- Container ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(6, 11, 24, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo {
    font-size: 1.8rem;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
    transition: var(--transition);
}

.nav-brand:hover .nav-logo {
    transform: rotate(60deg);
    filter: drop-shadow(0 0 16px var(--accent-glow));
}

.nav-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-link-admin {
    color: var(--accent-gold);
}

.nav-link-logout {
    color: var(--text-muted);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border);
    margin-left: 0.5rem;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-dim);
}

.nav-username {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 4rem;
    position: relative;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    position: relative;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.hero-title-line {
    display: block;
}

.hero-title-line.accent {
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.hero-tagline {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.3em;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- Sections ---------- */
.section {
    padding: 5rem 0;
    position: relative;
}

.section-dark {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.section-cta {
    text-align: center;
    margin-top: 3rem;
}

/* ---------- Page Header ---------- */
.page-header {
    padding: 7rem 0 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-secondary);
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.back-link:hover { color: var(--accent); }

/* ---------- Services Grid ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.service-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.service-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ---------- Steps Grid ---------- */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    counter-reset: step;
}

.step {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---------- Products Grid ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.product-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.product-category {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 1rem;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.price-quote {
    font-style: italic;
    color: var(--text-muted);
}

/* ---------- Product Detail ---------- */
.product-detail {
    max-width: 700px;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-category-badge {
    display: inline-block;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    padding: 0.3rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--accent);
    width: fit-content;
}

.product-detail-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.product-detail-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.price-currency {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-gold-dim);
}

.product-detail-status {
    margin-bottom: 0.5rem;
}

.product-order-form {
    margin-top: 1rem;
    max-width: 500px;
}

/* ---------- Orders ---------- */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    display: block;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    color: var(--text-primary);
    text-decoration: none;
}

.order-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
    color: var(--text-primary);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-id {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--accent);
}

.order-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.order-items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-item-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.order-total {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-weight: 700;
}

.order-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- Order Detail ---------- */
.order-detail {
    max-width: 800px;
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.order-status-large {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.order-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ---------- Status Tracker ---------- */
.status-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
}

.status-tracker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 0;
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--text-muted);
    transition: var(--transition);
}

.status-step.active .status-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.status-step.current .status-dot {
    animation: pulse 2s ease-in-out infinite;
}

.status-step span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.status-step.active span {
    color: var(--accent);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 12px var(--accent-glow); }
    50% { box-shadow: 0 0 24px var(--accent-glow), 0 0 40px var(--accent-glow); }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #000;
    border-color: var(--accent);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
    color: #000;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-glass);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn-discord {
    background: var(--discord);
    color: #fff;
    border-color: var(--discord);
}

.btn-discord:hover {
    background: #4752c4;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

textarea.input {
    resize: vertical;
    min-height: 60px;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-form {
    display: inline;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .input {
    width: 250px;
}

/* ---------- Cards ---------- */
.card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.card-glass h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

/* ---------- Status Badges ---------- */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.status-available {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.status-unavailable {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

/* ---------- Tables ---------- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table thead {
    background: var(--bg-card);
}

.table th {
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0,229,255,0.05);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-glass);
}

.table tfoot td {
    border-top: 2px solid var(--border);
    padding: 1rem;
}

.td-truncate {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted {
    color: var(--text-muted);
}

.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.edit-row td {
    background: var(--bg-secondary);
}

.actions-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-card-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-card-warning .stat-card-number { color: var(--warning); }
.stat-card-success .stat-card-number { color: var(--success); }
.stat-card-info .stat-card-number { color: var(--info); }
.stat-card-gold .stat-card-number { color: var(--accent-gold); }

.stat-card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---------- Admin Nav ---------- */
.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ---------- Shop Toolbar ---------- */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Cart Panel ---------- */
.cart-panel {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 500;
}

.cart-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #000;
    border: none;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}

.cart-toggle:hover { transform: scale(1.05); }

.cart-count {
    background: #000;
    color: var(--accent);
    padding: 0.1rem 0.5rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
}

.cart-body {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 380px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    display: none;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.cart-body.open {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-body h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-name {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-qty {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-qty:hover { border-color: var(--accent); }

.cart-item-qty {
    font-size: 0.85rem;
    min-width: 20px;
    text-align: center;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--accent-gold);
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
    transition: var(--transition);
}

.btn-remove:hover { transform: scale(1.2); }

.cart-total {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent-gold);
    text-align: right;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.cart-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    margin: 5.5rem 1.5rem 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
    position: relative;
    z-index: 100;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ---------- CTA Section ---------- */
.cta-section {
    text-align: center;
    padding: 2rem 0;
}

/* ---------- Footer ---------- */
.footer {
    position: relative;
    z-index: 1;
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-brand .nav-logo {
    font-size: 2rem;
}

.footer-brand h3 {
    font-size: 1rem;
    color: var(--accent);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.footer-links a, .footer-links p {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(6, 11, 24, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open { display: flex; }

    .nav-user {
        border-left: none;
        margin-left: 0;
        padding-left: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .hero-stats { flex-direction: column; gap: 1.5rem; }
    .hero-actions { flex-direction: column; align-items: center; }

    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

    .shop-toolbar { flex-direction: column; align-items: stretch; }
    .search-form .input { width: 100%; }

    .cart-body { width: calc(100vw - 3rem); right: -0.5rem; }

    .order-detail-header { flex-direction: column; }
    .status-tracker { flex-wrap: wrap; gap: 1rem; justify-content: center; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: 1fr; }
}

/* ---------- Page Transitions ---------- */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.page-transition-overlay.active {
    opacity: 1;
}

main {
    animation: pageEnter 0.5s ease forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-exit {
    animation: pageExit 0.3s ease forwards !important;
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ---------- Discount Code Input ---------- */
.discount-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.discount-input-row .input {
    flex: 1;
}

.discount-result {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.discount-result.valid {
    color: var(--success);
}

.discount-result.invalid {
    color: var(--danger);
}

.discount-result.loading {
    color: var(--text-muted);
}

.discount-applied-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.order-discount-line {
    color: var(--success);
    font-size: 0.9rem;
}

.order-subtotal-line {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Navbar Cart Button ---------- */
.nav-cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.2s;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-cart-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-cart-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
}

.nav-cart-badge.bump {
    transform: scale(1.4);
}

.nav-cart-badge:empty,
.nav-cart-badge[data-count="0"] {
    display: none;
}

/* ---------- Cart Overlay ---------- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ---------- Cart Drawer ---------- */
.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: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-drawer-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.cart-close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Cart Items */
.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.cart-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cart-item-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-qty {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.btn-qty:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.08);
}

.cart-item-qty {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-price {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    color: var(--accent-cyan);
    min-width: 70px;
    text-align: right;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.btn-remove:hover {
    color: var(--danger);
}

/* Cart Footer / Summary */
.cart-drawer-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.15);
}

.cart-summary {
    margin-bottom: 1rem;
}

.cart-subtotal-row,
.cart-discount-row,
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.cart-total-row {
    font-size: 1.05rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
}

.cart-drawer-footer .form-group {
    margin-bottom: 0.8rem;
}

.cart-drawer-footer label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: block;
}

.cart-drawer-footer .input {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* ---------- Add to Cart Button on Detail ---------- */
.product-qty-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.product-qty-selector .btn-qty {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
}

.product-qty-selector .qty-value {
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
}

.product-add-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}