:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #10B981;
  --dark: #111827;
  --dark-light: #1F2937;
  --gray: #6B7280;
  --gray-light: #F3F4F6;
  --white: #FFFFFF;
  --danger: #EF4444;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: var(--gray-light); color: var(--dark); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
button { cursor: pointer; border: none; background: none; font-family: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; font-weight: 600; border-radius: var(--radius-md); transition: var(--transition); }
.btn-primary { background-color: var(--primary); color: var(--white); box-shadow: var(--shadow-md); }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background-color: var(--primary); color: var(--white); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.btn-danger { background-color: #fee2e2; color: var(--danger); }
.btn-danger:hover { background-color: var(--danger); color: white; }

.navbar { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0, 0, 0, 0.05); position: sticky; top: 0; z-index: 50; padding: 1rem 0; }
.nav-content { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.search-bar { flex: 1; max-width: 500px; margin: 0 2rem; position: relative; }
.search-bar input { width: 100%; padding: 0.75rem 1.5rem; border-radius: var(--radius-full); border: 1px solid var(--gray-light); background: var(--gray-light); font-size: 0.95rem; transition: var(--transition); }
.search-bar input:focus { outline: none; border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.nav-actions { display: flex; align-items: center; gap: 1.5rem; }
.cart-btn { position: relative; font-size: 1.5rem; color: var(--dark); }
.cart-btn:hover { color: var(--primary); transform: scale(1.1); }
.cart-badge { position: absolute; top: -8px; right: -8px; background-color: var(--danger); color: white; font-size: 0.7rem; font-weight: bold; height: 20px; width: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid white; }

.hero { padding: 4rem 0; background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%); color: var(--white); border-radius: var(--radius-xl); margin: 2rem 0; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 50%; background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.3) 0%, transparent 60%); pointer-events: none; }
.hero-content { position: relative; z-index: 10; max-width: 600px; padding: 2rem; }
.hero h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -1px; }
.hero p { font-size: 1.125rem; color: var(--gray); margin-bottom: 2rem; }

.category-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn { padding: 0.5rem 1rem; border-radius: var(--radius-full); background: var(--white); color: var(--gray); font-weight: 600; font-size: 0.9rem; border: 1px solid var(--gray-light); transition: var(--transition); }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.section-title { font-size: 2rem; font-weight: 700; color: var(--dark); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem; padding-bottom: 4rem; }
.product-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; cursor: pointer; }
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.product-image { height: 220px; width: 100%; object-fit: cover; background-color: var(--gray-light); }
.product-info { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.product-category { font-size: 0.8rem; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 0.5rem; }
.product-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-price { font-size: 1.25rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; margin-top: auto; }
.add-to-cart { width: 100%; padding: 0.75rem; background-color: var(--gray-light); color: var(--dark); font-weight: 600; border-radius: var(--radius-md); }
.product-card:hover .add-to-cart { background-color: var(--primary); color: var(--white); }

/* Overlays & Modals */
.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 100; opacity: 0; visibility: hidden; transition: var(--transition); }
.overlay.active { opacity: 1; visibility: visible; }

.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); opacity: 0; visibility: hidden; z-index: 110; width: 100%; max-width: 800px; padding: 1rem; transition: var(--transition); }
.modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-content { background: var(--white); padding: 2rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-hover); position: relative; max-height: 90vh; overflow-y: auto; }
.close-modal { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; color: var(--gray); background: var(--gray-light); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.close-modal:hover { background: var(--danger); color: white; transform: rotate(90deg); }

/* Cart Sidebar */
.cart-sidebar { position: fixed; top: 0; right: -400px; width: 100%; max-width: 400px; height: 100vh; background: var(--white); z-index: 110; box-shadow: -5px 0 25px rgba(0,0,0,0.1); transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
.cart-sidebar.active { right: 0; }
.cart-header { padding: 1.5rem; border-bottom: 1px solid var(--gray-light); display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { font-size: 1.5rem; font-weight: 800; }
.close-btn { font-size: 1.5rem; color: var(--gray); }
.close-btn:hover { color: var(--danger); }
.cart-items { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.cart-item { display: flex; gap: 1rem; border-bottom: 1px solid var(--gray-light); padding-bottom: 1.5rem; }
.cart-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-md); }
.cart-item-info { flex: 1; }
.cart-item-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; color: var(--dark); }
.cart-item-price { color: var(--primary); font-weight: 700; margin-bottom: 0.5rem; }
.cart-item-controls { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn { width: 28px; height: 28px; background: var(--gray-light); border-radius: var(--radius-sm); font-weight: bold; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: var(--primary); color: white; }
.cart-footer { padding: 1.5rem; border-top: 1px solid var(--gray-light); background: var(--white); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.25rem; font-weight: 800; color: var(--dark); margin-bottom: 1rem; }

footer { background: var(--dark); color: var(--white); padding: 4rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; margin-bottom: 3rem; }
.footer-col h3 { font-size: 1.25rem; margin-bottom: 1.5rem; color: var(--white); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.75rem; color: var(--gray); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--dark-light); padding-top: 2rem; text-align: center; color: var(--gray); }

@media (max-width: 768px) {
  .search-bar { display: none; }
  .hero h1 { font-size: 2.5rem; }
  .md-flex-row { flex-direction: column; }
}
@media (min-width: 769px) {
  .md-flex-row { flex-direction: row; }
}
