:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-soft: #e7f1ff;
    --accent: #00b4d8;
    --dark: #0f172a;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    background: #f1f5f9;
    overflow-x: hidden;
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.35); }
    50% { box-shadow: 0 0 0 12px rgba(13, 110, 253, 0); }
}

.anim-fade-up { animation: fadeUp 0.6s ease both; }
.anim-fade-in { animation: fadeIn 0.5s ease both; }
.anim-scale-in { animation: scaleIn 0.45s ease both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

/* Reveal on scroll helper */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Top bar & Navbar ===== */
.top-bar {
    font-size: 0.8rem;
    background: linear-gradient(90deg, #0f172a, #1e3a5f) !important;
}
.navbar {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    backdrop-filter: blur(8px);
}
.navbar-brand img.site-logo {
    height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
@media (max-width: 575.98px) {
    .navbar-brand img.site-logo {
        height: 34px;
        max-width: 140px;
    }
}
.dropdown-menu-columns {
    columns: 2;
    min-width: 340px;
}
.nav-link {
    font-weight: 500;
    transition: color 0.2s;
}
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #3b82f6);
    border: none;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.45);
    background: linear-gradient(135deg, #0a58ca, #2563eb);
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 45%, #0d6efd 100%);
    color: white;
    border-radius: 0 0 32px 32px;
    padding: 4.5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -120px;
    right: -80px;
    animation: float 7s ease-in-out infinite;
}
.hero::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.12);
    bottom: -60px;
    left: 10%;
    animation: float 9s ease-in-out infinite reverse;
}
.hero h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.15;
}
.hero .badge {
    animation: pulse-soft 2.5s infinite;
}

/* ===== Product cards ===== */
.product-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15,23,42,0.04);
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}
.product-card .card-img-top,
.product-card .product-thumb {
    height: 200px;
    object-fit: contain;
    background: linear-gradient(180deg, #f8fafc, #fff);
    padding: 1rem;
    width: 100%;
}
.product-card .price {
    font-weight: 800;
    color: var(--dark);
    font-size: 1.05rem;
}
.product-card .old-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.9rem;
}
.badge-promo {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    border-radius: 8px;
}
.badge-new {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    border-radius: 8px;
}
.product-img-placeholder {
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 3rem;
    height: 200px;
}

/* ===== Quantity ===== */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.qty-selector button {
    width: 38px;
    height: 38px;
    border: none;
    background: #f1f5f9;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.15s;
}
.qty-selector button:hover { background: #e2e8f0; }
.qty-selector input {
    width: 48px;
    height: 38px;
    border: none;
    text-align: center;
    font-weight: 700;
}

/* Category pills */
.cat-pill {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border-radius: 50px;
    background: white;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.cat-pill:hover, .cat-pill.active {
    background: linear-gradient(135deg, #0d6efd, #3b82f6);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13,110,253,0.3);
}

/* Trust cards */
.trust-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s;
    height: 100%;
}
.trust-card:hover { transform: translateY(-4px); }
.trust-card i {
    font-size: 2rem;
    background: linear-gradient(135deg, #0d6efd, #00b4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== USER DASHBOARD ===== */
.dash-wrapper {
    background: linear-gradient(180deg, #eef2ff 0%, #f1f5f9 180px, #f1f5f9 100%);
    min-height: 70vh;
    padding-bottom: 3rem;
}
.dash-sidebar {
    background: white;
    border-radius: 18px;
    padding: 1.5rem 1.1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
}
.dash-sidebar .user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    margin-bottom: 1rem;
}
.dash-sidebar .user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d6efd, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}
.dash-sidebar .nav-link {
    color: #475569;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
    transition: all 0.2s;
}
.dash-sidebar .nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: translateX(3px);
}
.dash-sidebar .nav-link.active {
    background: linear-gradient(135deg, #0d6efd, #3b82f6);
    color: white !important;
    box-shadow: 0 6px 16px rgba(13,110,253,0.3);
}
.dash-sidebar .nav-link.active i { color: white !important; }

.stat-tile {
    border: none;
    border-radius: 18px;
    padding: 1.35rem;
    color: white;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s;
}
.stat-tile:hover { transform: translateY(-4px) scale(1.02); }
.stat-tile::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    top: -30px;
    right: -20px;
}
.stat-tile .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}
.stat-tile .stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; }
.stat-tile .stat-label { opacity: 0.9; font-size: 0.9rem; margin-top: 0.25rem; }
.stat-tile.bg-blue { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.stat-tile.bg-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.stat-tile.bg-pink { background: linear-gradient(135deg, #db2777, #f472b6); }
.stat-tile.bg-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.stat-tile.bg-orange { background: linear-gradient(135deg, #ea580c, #fbbf24); }

.dash-card {
    border: none;
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    background: white;
}
.dash-card .card-header {
    background: white;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
    padding: 1rem 1.25rem;
}
.dash-welcome {
    background: linear-gradient(135deg, #0f172a, #1e40af);
    color: white;
    border-radius: 18px;
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.dash-welcome::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    right: -40px;
    top: -40px;
}

/* Admin */
.admin-sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a, #1e293b);
    color: white;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    margin-bottom: 2px;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}
.stat-card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background: linear-gradient(180deg, #0f172a, #020617) !important;
}
.footer a:hover { color: white !important; }
.footer-logo {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

/* Image upload preview */
.img-preview-box {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}
.img-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 767.98px) {
    .hero { padding: 2.75rem 0; text-align: center; border-radius: 0 0 24px 24px; }
    .dropdown-menu-columns { columns: 1; }
    .dash-sidebar { position: static; margin-bottom: 1rem; }
}
