:root {
  /* Default Theme (Normal) */
  --primary-color: #6366f1;
  --secondary-color: #a855f7;
  --bg-color: #0f172a;
  --nav-bg: rgba(15, 23, 42, 0.8);
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.1);
}

.light-theme {
  --primary-color: #4f46e5;
  --secondary-color: #9333ea;
  --bg-color: #f8fafc;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --card-bg: rgba(255, 255, 255, 0.8);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --glass-border: rgba(0, 0, 0, 0.1);
}

.classic-theme {
  --primary-color: #2563eb;
  --secondary-color: #db2777;
  --bg-color: #ffffff;
  --nav-bg: rgba(240, 240, 240, 0.9);
  --card-bg: #f9fafb;
  --text-main: #111827;
  --text-muted: #4b5563;
  --glass-border: #e5e7eb;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

/* --- Navigation --- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.nav-btn.listening {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

select {
  background: var(--card-bg);
  color: white;
  border: 1px solid var(--glass-border);
  padding: 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 4rem 5% 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.hero p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.search-hint {
  font-size: 0.9rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 2rem;
}

/* --- Products --- */
#products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  padding: 2rem 5% 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.product-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.product-image {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  background: #1e293b;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  object-fit: cover;
}

.product-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.product-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.buy-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.buy-btn:hover {
  opacity: 0.9;
}

.hidden {
  display: none !important;
}

.reordered {
  order: -1;
  border-color: var(--secondary-color) !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* Transcription overlay */
#transcription {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem 2rem;
  border-radius: 40px;
  font-size: 1.1rem;
  color: white;
  z-index: 1000;
  display: none;
  animation: slideUp 0.3s ease-out;
}

/* --- Media Queries --- */

/* Tablet (Laptops & iPads) */
@media (max-width: 1024px) {
  nav { padding: 1rem 3%; }
  .nav-container { gap: 1rem; }
  .nav-links { gap: 1rem; }
  .nav-controls { gap: 1rem; }
  #products { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* Mobile (Phones) */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .nav-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    height: 100vh;
    background: var(--bg-color);
    flex-direction: column;
    justify-content: flex-start;
    padding: 6rem 2rem;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
  }

  .nav-container.active { right: 0; box-shadow: -20px 0 40px rgba(0,0,0,0.5); }

  .nav-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row !important;
    gap: 0.8rem !important;
    width: auto !important;
    z-index: 100;
  }

  .nav-btn, select {
    width: 45px !important;
    height: 45px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden;
  }

  .btn-text { display: none !important; }

  .nav-links {
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
  }

  /* Hamburger Animation */
  .menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(8px, -8px); }

  .hero h1 { font-size: 2.2rem; }
  .hero { padding: 3rem 5% 1rem; }
  
  #products { 
    grid-template-columns: 1fr;
    padding: 1rem 5% 3rem;
    gap: 1.5rem;
  }
}

/* Small Phones */
@media (max-width: 480px) {
  .logo { font-size: 1.2rem; }
  .nav-btn .btn-text { display: none; }
  .nav-btn { width: auto; padding: 0.8rem; }
}

@keyframes slideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}