:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --dark: #1e293b;
  --light: #f8fafc;
  --success: #10b981;
  --danger: #ef4444;
  --info: #0ea5e9;
  --gradient: linear-gradient(135deg, #2563eb, #1d4ed8);
  --allersafe-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 12px 0;
}
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary) !important;
  text-decoration: none;
}
.navbar-brand span { color: var(--accent); }
.nav-link { color: var(--dark) !important; font-weight: 500; }
.nav-link:hover { color: var(--primary) !important; }

/* Navbar Dropdown */
.navbar .dropdown-menu {
  background: white;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 8px 0;
  margin-top: 8px;
}
.navbar .dropdown-item {
  color: var(--dark);
  padding: 10px 20px;
  transition: all 0.2s ease;
  font-weight: 500;
}
.navbar .dropdown-item:hover {
  background: var(--light);
  color: var(--primary);
  padding-left: 28px;
}
.navbar .dropdown-item i {
  width: 24px;
  color: var(--primary);
}
.navbar .dropdown-divider {
  border-color: #e2e8f0;
  margin: 8px 0;
}
.dropdown-toggle::after {
  vertical-align: middle;
  margin-left: 8px;
}

/* Hero */
.hero {
  background: var(--gradient);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 10px; }
.hero p { font-size: 1.2rem; opacity: 0.95; }

/* ALLERSAFE Hero */
.allersafe-hero {
  background: var(--allersafe-gradient);
  padding: 80px 0;
}
.allersafe-hero h1 {
  font-size: 3rem;
  font-weight: 800;
}

/* Buttons */
.btn {
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 5px 20px rgba(37,99,235,0.3); }
.btn-outline-primary { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-light { background: white; color: var(--primary); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
.btn-outline-light { border: 2px solid white; color: white; background: transparent; }
.btn-outline-light:hover { background: white; color: var(--primary); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-lg { padding: 14px 35px; font-size: 1.1rem; }
.btn-sm { padding: 6px 16px; font-size: 0.85rem; }

/* Cards */
.card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
  height: 100%;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 35px rgba(0,0,0,0.15); }
.card-body { padding: 20px; }
.card-img-top { width: 100%; height: 200px; object-fit: cover; }

/* Product Card */
.product-card .price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

/* Badges */
.badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
}
.badge-primary { background: var(--primary); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--accent); color: var(--dark); }
.badge-danger { background: var(--danger); color: white; }
.badge-info { background: var(--info); color: white; }
.badge-safe { background: #10b981; color: white; }
.badge-low { background: #0ea5e9; color: white; }
.badge-medium { background: #f59e0b; color: var(--dark); }
.badge-high { background: #ef4444; color: white; }

/* Section */
.section { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 2rem; font-weight: 700; color: var(--dark); }

/* Footer */
footer {
  background: var(--dark);
  color: white;
  padding: 30px 0;
  text-align: center;
}
footer a { color: #94a3b8; text-decoration: none; }
footer a:hover { color: white; }

/* WhatsApp Float */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 60px;
  height: 60px;
  background: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 5px 25px rgba(37,211,102,0.5);
  z-index: 999;
  text-decoration: none;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Forms */
.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-label { font-weight: 600; margin-bottom: 5px; display: block; }
.form-check-input {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}
.form-check-label {
  cursor: pointer;
}
.form-select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

/* Alerts */
.alert { padding: 15px 20px; border-radius: 10px; margin-bottom: 20px; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info { background: #e0f2fe; color: #075985; border-left: 4px solid var(--info); }
.alert-warning { background: #fed7aa; color: #92400e; border-left: 4px solid var(--accent); }

/* Grid */
.row { display: flex; flex-wrap: wrap; gap: 25px; justify-content: center; }
.col-md-3 { flex: 0 0 calc(25% - 25px); min-width: 250px; }
.col-md-4 { flex: 0 0 calc(33.333% - 25px); min-width: 300px; }
.col-md-6 { flex: 0 0 calc(50% - 25px); min-width: 400px; }
.col-md-8 { flex: 0 0 calc(66.666% - 25px); min-width: 500px; }
.col-md-12 { flex: 0 0 100%; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Text */
.text-center { text-align: center; }
.text-muted { color: #64748b; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.fs-1 { font-size: 2.5rem; }
.fs-2 { font-size: 2rem; }
.fs-3 { font-size: 1.75rem; }
.fs-4 { font-size: 1.5rem; }

/* Margins */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 50px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mb-5 { margin-bottom: 50px; }
.me-1 { margin-right: 5px; }
.me-2 { margin-right: 15px; }
.me-3 { margin-right: 20px; }
.ms-1 { margin-left: 5px; }
.ms-2 { margin-left: 15px; }
.p-2 { padding: 15px; }
.p-3 { padding: 20px; }
.p-4 { padding: 30px; }

/* Flex utilities */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.gap-4 { gap: 20px; }

/* QR Scanner */
#qr-reader {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  border: 2px solid var(--primary);
  border-radius: 12px;
  overflow: hidden;
}
#qr-reader__scan_region {
  background: #f0f0f0;
}

/* Rating Stars */
.rating {
  display: inline-flex;
  gap: 5px;
}
.rating i {
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.2s;
}
.rating i.active, .rating i:hover {
  color: #f59e0b;
}
.stars-display i {
  color: #f59e0b;
}
.stars-display i.inactive {
  color: #cbd5e1;
}

/* Filter Sidebar */
.filter-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.filter-group {
  margin-bottom: 20px;
}
.filter-group h6 {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark);
}
.filter-group .form-check {
  margin-bottom: 8px;
}

/* CuePay specific */
.cuepay-section {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  border: none;
  font-size: 20px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 992px) {
  .col-md-3 { flex: 0 0 calc(50% - 25px); }
  .col-md-4 { flex: 0 0 calc(50% - 25px); }
  .col-md-6 { flex: 0 0 100%; }
  .col-md-8 { flex: 0 0 100%; }
  .hero h1 { font-size: 2rem; }
  .allersafe-hero h1 { font-size: 2rem; }
}

@media (max-width: 768px) {
  .col-md-3, .col-md-4 { flex: 0 0 100%; }
  .hero { padding: 60px 0 40px; }
  .allersafe-hero { padding: 60px 0 40px; }
  .section { padding: 40px 0; }
  .whatsapp-float { width: 50px; height: 50px; font-size: 25px; bottom: 20px; left: 20px; }
  .navbar .dropdown-menu {
    background: white;
    border: none;
    box-shadow: none;
  }
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(37,99,235,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Table styles */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.table th {
  background: var(--light);
  font-weight: 600;
}
.table-hover tr:hover {
  background: rgba(37,99,235,0.05);
}

/* Shadow utilities */
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.shadow { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

/* Background utilities */
.bg-light { background: var(--light); }
.bg-dark { background: var(--dark); color: white; }
.bg-primary { background: var(--primary); color: white; }
.bg-gradient { background: var(--gradient); color: white; }
.bg-allersafe { background: var(--allersafe-gradient); color: white; }

/* Border radius */
.rounded { border-radius: 10px; }
.rounded-lg { border-radius: 15px; }
.rounded-circle { border-radius: 50%; }

/* Width utilities */
.w-100 { width: 100%; }
.w-50 { width: 50%; }

/* Position utilities */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.fixed-top { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; }

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.5s ease-out;
}