:root {
  --primary: #FF5C00;
  --primary-hover: #E65100;
  --secondary: #2D3748;
  --bg-color: #F8F9FA;
  --card-bg: #FFFFFF;
  --text-main: #212529;
  --text-muted: #6C757D;
  --border-color: #E9ECEF;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  /* Better shadow */
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  /* Hover pop */
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-family: 'Montserrat', sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-bar {
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
  display: flex;
  border-radius: 99px;
  overflow: hidden;
  border: 2px solid var(--primary);
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 0.75rem 1.5rem;
  outline: none;
  font-size: 1rem;
}

.search-bar button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-bar button:hover {
  background: var(--primary-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Product Cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fff;
  padding: 1rem;
  box-sizing: border-box;
}

.product-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.product-store {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* -----------------------------
   MOBILE RESPONSIVENESS
------------------------------ */

/* Tablets and small laptops */
@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem 0;
  }

  /* Force search bar to drop to a new line and take full width */
  .search-bar {
    order: 3;
    flex: 0 0 100%;
    margin: 0;
    width: 100%;
  }

  /* Right-align user account actions */
  .user-actions {
    margin-left: auto;
  }

  /* Smaller grid columns for mobile product catalog */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
  }

  /* Shrink hero fonts a little */
  h1 {
    font-size: 1.75rem !important;
  }

  .product-price {
    font-size: 1.25rem;
  }

  .product-image {
    height: 160px;
  }
}

/* Small smartphones (iPhone SE, etc.) */
@media (max-width: 480px) {
  .logo {
    font-size: 1.25rem;
  }

  .search-bar input {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .search-bar button {
    padding: 0 1rem;
    font-size: 0.9rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Override any hardcoded flex/inline min-widths from backend dashboards */
  div[style*="min-width: 350px"],
  div[style*="min-width: 300px"],
  div[style*="min-width: 200px"] {
    min-width: 100% !important;
  }

  /* Ensure flex rows wrap on very tiny screens (e.g. split forms, Price | Units) */
  div[style*="display: flex; gap: 1rem; margin-bottom:"] {
    flex-wrap: wrap !important;
  }
}
/* Bottom Nav for Mobile */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1001;
  border-top: 1px solid var(--border-color);
  padding: 0.5rem 0;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  gap: 0.2rem;
  transition: var(--transition);
}

.bottom-nav-item i {
  width: 20px;
  height: 20px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

/* Adjust padding for main content when bottom nav is present */
@media (max-width: 768px) {
  main {
    padding-bottom: 70px;
  }
}

/* Product List Improvements */
.product-list-item {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fafafa;
  transition: background 0.2s ease;
}

.product-list-item:hover {
  background: #f0f0f0;
}

.product-list-item-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  word-break: break-word;
  margin-bottom: 0.5rem;
}

.product-list-item-category {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--primary);
  color: white;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.product-list-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid #e0e0e0;
  margin-top: 0.75rem;
}

.product-list-item-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.product-list-item-price {
  text-align: right;
}

.product-list-item-price-value {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.1rem;
  display: block;
}

.product-list-item-price-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.product-list-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.product-list-badge {
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  font-weight: 600;
}

.product-list-badge-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.product-list-badge-eta {
  background: #e3f2fd;
  color: #1565c0;
}
