:root {
  --orange: #F47B20;
  --orange-light: #FFF0E5;
  --orange-dark: #D4660A;
  --gray-900: #1A1A1A;
  --gray-700: #444444;
  --gray-500: #6B7280;
  --gray-200: #E5E7EB;
  --gray-100: #F5F5F7;
  --white: #FFFFFF;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; font-family: 'Inter', sans-serif; color: var(--gray-700); background-color: var(--white); line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

h1, h2, h3, h4, h5, h6 { color: var(--gray-900); margin-top: 0; margin-bottom: 0.5em; line-height: 1.2; }
h1 { font-size: 3rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin-top: 0; margin-bottom: 1rem; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; height: auto; display: block; image-rendering: -webkit-optimize-contrast; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; }

/* --- Layout --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- Navigation --- */
.navbar { position: sticky; top: 0; background-color: rgba(255,255,255,0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--gray-200); z-index: 100; }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-logo a { display: flex; align-items: center; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-weight: 500; color: var(--gray-700); }
.nav-links a:hover, .nav-links a.active { color: var(--orange); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-action-btn { background: none; border: none; cursor: pointer; color: var(--gray-700); position: relative; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 8px; transition: color var(--transition), background var(--transition); }
.nav-action-btn:hover { color: var(--orange); background: var(--orange-light); }
.cart-badge { position: absolute; top: -8px; right: -8px; background-color: var(--orange); color: var(--white); font-size: 0.75rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.hamburger { display: none; background: none; border: none; color: var(--gray-900); cursor: pointer; }
.mobile-menu-overlay { display: none; position: fixed; top: 72px; left: 0; width: 100%; height: calc(100vh - 72px); background-color: var(--white); z-index: 99; padding: 24px; flex-direction: column; gap: 8px; overflow-y: auto; }
.mobile-menu-overlay.active { display: flex; }
.mobile-menu-overlay a { padding: 14px 16px; font-weight: 600; font-size: 1rem; border-radius: 10px; color: var(--gray-700); }
.mobile-menu-overlay a:hover { background: var(--orange-light); color: var(--orange); }
.sell-btn-desktop { display: flex; }
@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-links { display: none; }
  .sell-btn-desktop { display: none; }
}

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-sm); padding: 12px 24px; font-weight: 600; cursor: pointer; transition: all var(--transition); border: none; font-size: 1rem; font-family: inherit; text-decoration: none; }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(244,123,32,0.3); }
.btn-secondary { background: var(--white); color: var(--orange); border: 2px solid var(--orange); }
.btn-secondary:hover { background: var(--orange-light); }
.btn-ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-block { width: 100%; display: flex; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.875rem; color: var(--gray-900); }
.form-control { width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 1rem; background: var(--white); color: var(--gray-900); transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,123,32,0.12); }
.form-control::placeholder { color: var(--gray-500); }

/* --- Cards --- */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* --- Product Cards --- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; position: relative; transition: all var(--transition); text-decoration: none; display: block; }
.product-card:hover { border-color: var(--orange); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-image-wrap { height: 200px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; padding: 16px; }
.product-image-wrap img { max-height: 170px; object-fit: contain; image-rendering: -webkit-optimize-contrast; }
.product-info { padding: 16px; }
.product-title { font-weight: 700; font-size: 0.95rem; color: var(--gray-900); margin-bottom: 4px; }
.product-rating { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--gray-500); margin-bottom: 10px; }
.star-icon { color: #F4B400; width: 14px; height: 14px; }
.product-price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-new { font-size: 1.2rem; font-weight: 800; color: var(--orange); }
.price-old { font-size: 0.85rem; color: var(--gray-500); text-decoration: line-through; }
.discount-tag { background: #FEF3C7; color: #D97706; padding: 3px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.product-hover-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(255,255,255,1) 60%, transparent); padding: 16px; transform: translateY(100%); transition: transform 0.25s ease; }
.product-card:hover .product-hover-overlay { transform: translateY(0); }
.product-wishlist { position: absolute; top: 12px; right: 12px; background: white; border: 1.5px solid var(--gray-200); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; color: var(--gray-500); transition: all var(--transition); }
.product-wishlist:hover { border-color: var(--orange); color: var(--orange); }

/* --- Badges --- */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-orange { background: var(--orange-light); color: var(--orange-dark); }

/* --- Filter chips --- */
.filter-chip { display: inline-flex; align-items: center; padding: 8px 16px; border: 1.5px solid var(--gray-200); border-radius: 999px; background: var(--white); cursor: pointer; font-size: 0.875rem; font-weight: 500; transition: all var(--transition); font-family: inherit; }
.filter-chip:hover { border-color: var(--orange); color: var(--orange); }
.filter-chip.active { background: var(--orange-light); border-color: var(--orange); color: var(--orange-dark); }

/* --- Cart --- */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; padding: 40px 0; align-items: start; }
.cart-item { display: flex; gap: 16px; padding: 20px; align-items: center; border-bottom: 1px solid var(--gray-200); }
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 80px; height: 80px; object-fit: contain; border-radius: 8px; background: var(--gray-100); padding: 6px; }
.cart-item-info { flex-grow: 1; }
.summary-card { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: 28px; position: sticky; top: 100px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.qty-control { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--gray-200); background: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; transition: all var(--transition); }
.qty-btn:hover { border-color: var(--orange); color: var(--orange); }
@media (max-width: 768px) { .cart-layout { grid-template-columns: 1fr; } }

/* --- Admin table --- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { text-align: left; padding: 12px 16px; font-weight: 600; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-200); color: var(--gray-700); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-100); }

/* --- Tabs --- */
.tab-btn { padding: 16px 24px; background: none; border: none; border-bottom: 2px solid transparent; font-weight: 600; color: var(--gray-500); cursor: pointer; white-space: nowrap; font-family: inherit; transition: all var(--transition); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Skeleton --- */
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 4px; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Scroll animations --- */
.scroll-animate { opacity: 0; transform: translateY(36px) scale(0.98); transition: opacity 0.7s cubic-bezier(.22,.9,.3,1), transform 0.7s cubic-bezier(.22,.9,.3,1); will-change: opacity, transform; }
.scroll-animate.visible { opacity: 1; transform: translateY(0) scale(1); }
.scroll-animate-delay-1 { transition-delay: 0.1s; }
.scroll-animate-delay-2 { transition-delay: 0.2s; }
.scroll-animate-delay-3 { transition-delay: 0.3s; }
.scroll-animate-delay-4 { transition-delay: 0.4s; }
/* Fade-in-from-side variants for extra motion variety */
.scroll-fade-left { opacity: 0; transform: translateX(-32px); transition: opacity 0.7s cubic-bezier(.22,.9,.3,1), transform 0.7s cubic-bezier(.22,.9,.3,1); }
.scroll-fade-left.visible { opacity: 1; transform: translateX(0); }
.scroll-fade-right { opacity: 0; transform: translateX(32px); transition: opacity 0.7s cubic-bezier(.22,.9,.3,1), transform 0.7s cubic-bezier(.22,.9,.3,1); }
.scroll-fade-right.visible { opacity: 1; transform: translateX(0); }

/* --- Utilities --- */
.text-center { text-align: center; }
.mb-8 { margin-bottom: 32px; }
.mb-4 { margin-bottom: 16px; }
.mt-8 { margin-top: 32px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 16px; }
.gap-2 { gap: 8px; }
.text-orange { color: var(--orange); }
.font-bold { font-weight: 700; }
.relative { position: relative; }
.flex-1 { flex: 1; }

/* --- Offer/Sell wizard --- */
.step-progress { display: flex; gap: 8px; }
.progress-bar { flex: 1; height: 4px; background: #E5E7EB; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: #F47B20; width: 0%; transition: width 0.3s; }
.step-view { display: none; }
.step-view.active { display: block; animation: fadeInUp 0.3s; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* --- Timeline --- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 7px; top: 36px; bottom: -16px; width: 2px; background: var(--gray-200); }
.timeline-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--gray-200); flex-shrink: 0; margin-top: 4px; border: 2px solid var(--gray-200); }
.timeline-item.active .timeline-dot { background: var(--orange); border-color: var(--orange); }
.timeline-item.done .timeline-dot { background: #10B981; border-color: #10B981; }
