/* =========================================
   robox - Custom CSS (Advanced Edition)
   ========================================= */

/* CSS Variables */
:root {
    --color-primary:   #6C63FF;
    --color-secondary: #FF6584;
    --color-accent:    #43BCCD;
    --color-dark:      #1A1A2E;
    --color-light-bg:  #F8F9FF;
    --shadow-card:     0 2px 16px rgba(108,99,255,0.09);
    --shadow-hover:    0 12px 40px rgba(108,99,255,0.22);
    --shadow-glow:     0 0 30px rgba(108,99,255,0.35);
    --radius-card:     18px;
    --transition:      all 0.28s cubic-bezier(.4,0,.2,1);
    --gradient-hero:   linear-gradient(135deg, #6C63FF 0%, #a78bfa 50%, #FF6584 100%);
    --gradient-dark:   linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
}

/* Global */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-light-bg);
    color: var(--color-dark);
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5a52e0; }

/* ── Glassmorphism ─────────────────────── */
.glass {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.25);
}
.glass-dark {
    background: rgba(26,26,46,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ── Gradient text ─────────────────────── */
.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Buttons ───────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #6C63FF, #8b5cf6);
    color: #fff;
    padding: 0.7rem 1.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(108,99,255,0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108,99,255,0.45);
    background: linear-gradient(135deg, #5a52e0, #7c3aed);
}

.btn-secondary {
    background: linear-gradient(135deg, #FF6584, #f43f5e);
    color: #fff;
    padding: 0.7rem 1.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255,101,132,0.35);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,101,132,0.45); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.6rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    cursor: pointer;
}
.btn-outline:hover { background: var(--color-primary); color: #fff; transform: translateY(-1px); }

/* ── Product Card ──────────────────────── */
.product-card {
    border-radius: var(--radius-card);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
}
.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, rgba(108,99,255,0.04), transparent);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    z-index: 1;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-6px); }
.product-card:hover::before { opacity: 1; }
.product-card img { transition: transform 0.5s cubic-bezier(.4,0,.2,1); }
.product-card:hover img { transform: scale(1.08); }

/* ── Category Card ─────────────────────── */
.category-card {
    transition: var(--transition);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}
.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,26,46,0.7) 0%, transparent 60%);
    pointer-events: none;
}
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.category-card img { transition: transform 0.5s ease; }
.category-card:hover img { transform: scale(1.1); }

/* ── Hero section ──────────────────────── */
.hero-gradient {
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}
.hero-gradient::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -200px; right: -150px;
    animation: float 8s ease-in-out infinite;
}
.hero-gradient::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -150px; left: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

/* ── Animated orbs / blobs ─────────────── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    opacity: 0.4;
    animation: float 12s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, #6C63FF 0%, transparent 70%); }
.orb-2 { width: 300px; height: 300px; background: radial-gradient(circle, #FF6584 0%, transparent 70%); animation-delay: -4s; animation-direction: reverse; }
.orb-3 { width: 250px; height: 250px; background: radial-gradient(circle, #43BCCD 0%, transparent 70%); animation-delay: -8s; }

/* ── Marquee / ticker ──────────────────── */
.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 25s linear infinite;
    white-space: nowrap;
}
.marquee-wrap { overflow: hidden; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

/* ── Stats counter ─────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-hero);
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

/* ── Admin sidebar ─────────────────────── */
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.admin-nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
    border-radius: inherit;
}
.admin-nav-link:hover::before,
.admin-nav-link.active::before { transform: scaleX(1); }
.admin-nav-link:hover, .admin-nav-link.active { color: #fff; }
.admin-nav-link.active { background: rgba(255,255,255,0.12); }

/* ── Form inputs ───────────────────────── */
.form-input {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.875rem;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    transition: var(--transition);
    outline: none;
    background: #fff;
}
.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(108,99,255,0.1);
}

/* ── Badges ────────────────────────────── */
.badge-sale     { background: linear-gradient(135deg,#FF6584,#f43f5e); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 3px 9px; border-radius: 9999px; }
.badge-stock    { background: #d1fae5; color: #065f46; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 9999px; }
.badge-out      { background: #fee2e2; color: #991b1b; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 9999px; }
.badge-pending  { background: #fef3c7; color: #92400e; font-size:0.75rem;font-weight:600;padding:3px 10px;border-radius:9999px; }
.badge-shipped  { background: #ede9fe; color: #4c1d95; font-size:0.75rem;font-weight:600;padding:3px 10px;border-radius:9999px; }
.badge-delivered{ background: #d1fae5; color: #065f46; font-size:0.75rem;font-weight:600;padding:3px 10px;border-radius:9999px; }
.badge-cancelled{ background: #fee2e2; color: #991b1b; font-size:0.75rem;font-weight:600;padding:3px 10px;border-radius:9999px; }

/* ── Flash toast ───────────────────────── */
#flash-msg {
    animation: slideInRight 0.4s cubic-bezier(.4,0,.2,1) forwards;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* ── Animations ────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33%       { transform: translateY(-20px) rotate(2deg); }
    66%       { transform: translateY(10px) rotate(-1deg); }
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes scaleIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes bounce-in {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    80%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.fade-in-up    { animation: fadeInUp 0.55s ease forwards; }
.fade-in-down  { animation: fadeInDown 0.45s ease forwards; }
.fade-in       { animation: fadeIn 0.35s ease; }
.scale-in      { animation: scaleIn 0.35s cubic-bezier(.4,0,.2,1) forwards; }
.success-bounce{ animation: bounce-in 0.6s ease; }
.spin-slow     { animation: spin-slow 10s linear infinite; }

/* Staggered children */
.stagger > *:nth-child(1){ animation-delay:0s }
.stagger > *:nth-child(2){ animation-delay:.08s }
.stagger > *:nth-child(3){ animation-delay:.16s }
.stagger > *:nth-child(4){ animation-delay:.24s }
.stagger > *:nth-child(5){ animation-delay:.32s }
.stagger > *:nth-child(6){ animation-delay:.40s }
.stagger > *:nth-child(7){ animation-delay:.48s }
.stagger > *:nth-child(8){ animation-delay:.56s }

/* ── Skeleton loading ──────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ── Animated gradient border ──────────── */
.gradient-border {
    position: relative;
    background: #fff;
    border-radius: var(--radius-card);
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-card) + 2px);
    background: var(--gradient-hero);
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
    z-index: -1;
}

/* ── Pulse ring ────────────────────────── */
.pulse-ring {
    position: relative;
}
.pulse-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
    0%   { transform: scale(0.95); opacity: 1; }
    70%  { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* ── Text utilities ────────────────────── */
.line-clamp-1 { display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden; }
.line-clamp-2 { display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.line-clamp-3 { display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }

/* ── Animated underline link ───────────── */
.underline-hover {
    position: relative;
    display: inline-block;
}
.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}
.underline-hover:hover::after { width: 100%; }

/* ── Table ─────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; padding: 0.75rem 1rem; background: #f9fafb; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; border-bottom: 1px solid #e5e7eb; }
.data-table td { padding: 0.875rem 1rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.data-table tr:hover td { background-color: #f9fafb; }

/* ── Prose ─────────────────────────────── */
.prose { color: #374151; line-height: 1.75; }
.prose p + p { margin-top: 0.75em; }

/* ── Mobile-specific ───────────────────── */
@media (max-width: 480px) {
    .product-card { border-radius: 14px; }
    h1 { font-size: 1.6rem !important; }
    .hero-gradient { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}

/* ── Hover glow effect ─────────────────── */
.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ── Sticky header backdrop ────────────── */
.header-blur {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255,255,255,0.88);
    border-bottom: 1px solid rgba(108,99,255,0.08);
}

/* ── Cart item animation ───────────────── */
.cart-item-enter {
    animation: fadeInUp 0.3s ease forwards;
}

/* ── Notification dot pulse ────────────── */
.notify-dot {
    position: absolute;
    top: -2px; right: -2px;
    width: 8px; height: 8px;
    background: var(--color-secondary);
    border-radius: 50%;
    animation: bounce-in 0.5s ease, pulse-ring 2s 0.5s ease-out infinite;
}

