@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;800&display=swap');

:root {
  /* Vibrant Violet Theme */
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #ddd6fe;
  --accent: #ec4899;
  
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

h1, h2, h3, h4, .brand-logo {
  font-family: 'Outfit', sans-serif;
}

/* Header & Navigation */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 24px;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.cart-btn:hover {
  background: var(--primary-light);
}

.cart-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-main);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid white;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Marquee Promo */
.promo-marquee {
  background: var(--primary-dark);
  color: white;
  padding: 8px 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.promo-marquee-inner {
  display: flex;
  white-space: nowrap;
  animation: marquee 15s linear infinite;
}

.promo-marquee-inner span {
  padding: 0 20px;
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* Main Content Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Hero Section */
.hero {
  margin: 16px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}

.hero img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 16/9;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.5), transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  color: white;
}

.hero-tag {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 8px;
}

.hero h2 {
  font-size: 28px;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 14px;
  opacity: 0.9;
  max-width: 70%;
}

/* Categories Ribbon */
.categories-ribbon {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 16px;
  scrollbar-width: none; /* Firefox */
}

.categories-ribbon::-webkit-scrollbar {
  display: none; /* Chrome */
}

.category-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 80px;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.2s ease;
}

.category-pill:hover {
  transform: translateY(-2px);
}

.cat-img-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
}

.cat-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.category-pill span {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* Product Section */
.section-title {
  padding: 0 16px;
  margin: 24px 0 16px;
  font-size: 20px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 0 16px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.product-img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  background: #f1f5f9;
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.sell-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.mrp-price {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.discount-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 4px;
}

.delivery-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.delivery-info svg {
  color: var(--success);
}

/* Safe Ad Slot Strategy */
.ad-container {
  margin: 32px 16px;
  padding: 16px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  text-align: center;
  position: relative;
}

.ad-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.ad-placeholder {
  width: 100%;
  min-height: 100px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 4px;
}

/* Cart Sidebar / Modal Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: white;
  z-index: 101;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  font-size: 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-cart {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.close-cart:hover {
  background: #e2e8f0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.cart-item-img {
  width: 72px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.qty-btn {
  background: #f1f5f9;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
}

.qty-val {
  font-size: 13px;
  font-weight: 600;
  width: 16px;
  text-align: center;
}

.remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cart-total-label {
  font-size: 16px;
  color: var(--text-muted);
}

.cart-total-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.checkout-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.checkout-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.checkout-btn:active {
  transform: translateY(0);
}

/* Add to Cart Floating Button on Product Detail (simulated) */
.add-to-cart-action {
  width: 100%;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: none;
  padding: 8px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.add-to-cart-action:hover {
  background: #c4b5fd;
}

/* Footer Section */
.footer {
  background: white;
  border-top: 1px solid #f1f5f9;
  padding: 40px 20px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-main);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  margin-top: 32px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}
