/* Main Customer Frontend Styles */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --success-color: #10b981;
  --info-color: #06b6d4;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;

  --border-color: #e5e7eb;
  --border-light: #f3f4f6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --container-max-width: 1200px;
  --header-height: 140px;
  --mobile-nav-height: 60px;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  padding-bottom: var(--mobile-nav-height);
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.125rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: 0.5rem;
}

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

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

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

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

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

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* Header Styles */
.header {
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar {
  background-color: var(--bg-tertiary);
  padding: 0.5rem 0;
  font-size: 0.75rem;
}

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

.top-bar-left,
.top-bar-right {
  display: flex;
  gap: 1rem;
}

.top-bar a {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.main-header {
  padding: 1rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.search-bar {
  flex: 1;
  max-width: 500px;
}

.search-form {
  display: flex;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.search-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
}

.search-form input:focus {
  outline: none;
}

.search-btn {
  padding: 0.75rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-btn:hover {
  background-color: var(--primary-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.2s;
}

.header-action:hover {
  color: var(--primary-color);
}

.header-action i {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.action-text {
  font-size: 0.75rem;
  font-weight: 500;
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--danger-color);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 1rem;
  min-width: 1.25rem;
  text-align: center;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Navigation */
.main-nav {
  background-color: var(--primary-color);
  color: white;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 1rem 1.5rem;
  color: white;
  font-weight: 500;
  transition: background-color 0.2s;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
  background-color: var(--primary-dark);
  color: white;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.dropdown-menu a:hover {
  background-color: var(--bg-secondary);
  color: var(--primary-color);
}

.divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.5rem 0;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 0;
}

.hero-content .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-text p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
}

/* Sections */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header .section-title {
  margin: 0;
  text-align: left;
}

.view-all {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Categories Section */
.categories-section {
  padding: 4rem 0;
  background-color: var(--bg-primary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
}

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

.category-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

/* Products Section */
.featured-products,
.recent-products {
  padding: 4rem 0;
}

.featured-products {
  background-color: var(--bg-primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

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

.product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.product-card:hover .product-actions {
  opacity: 1;
}

.sale-badge,
.featured-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: white;
}

.sale-badge {
  background-color: var(--danger-color);
}

.featured-badge {
  background-color: var(--accent-color);
}

.product-info {
  padding: 1.25rem;
}

.product-vendor {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.product-title {
  margin-bottom: 0.75rem;
}

.product-title a {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.product-title a:hover {
  color: var(--primary-color);
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.current-price,
.sale-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-color);
}

.regular-price {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.add-to-cart {
  font-size: 0.875rem;
}

/* Newsletter Section */
.newsletter {
  background-color: var(--bg-tertiary);
  padding: 3rem 0;
}

.newsletter-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.newsletter-text h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  min-width: 400px;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Products Page */
.products-page {
  padding: 2rem 0;
  background-color: var(--bg-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.separator {
  color: var(--text-muted);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.page-title h1 {
  margin-bottom: 0.5rem;
}

.page-title p {
  color: var(--text-secondary);
  margin: 0;
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  font-size: 0.875rem;
}

.products-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

/* Sidebar Filters */
.products-sidebar {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.filter-section {
  margin-bottom: 2rem;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.category-filter {
  list-style: none;
}

.category-filter li {
  margin-bottom: 0.5rem;
}

.category-filter a {
  display: block;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.category-filter a:hover,
.category-filter a.active {
  color: var(--primary-color);
  font-weight: 500;
}

.price-filter {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-inputs input {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  padding: 0.375rem 0.75rem;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  transition: all 0.2s;
}

.filter-tag:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination-btn {
  padding: 0.75rem 1rem;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.pagination-btn:hover,
.pagination-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 0;
  z-index: 100;
  display: none;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: color 0.2s;
  position: relative;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--primary-color);
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-content .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .newsletter-content {
    flex-direction: column;
    text-align: center;
  }

  .newsletter-form {
    min-width: auto;
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 120px;
  }

  .container {
    padding: 0 0.75rem;
  }

  /* Header Mobile */
  .top-bar {
    display: none;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .logo {
    order: 1;
  }

  .mobile-menu-toggle {
    display: block;
    order: 2;
  }

  .search-bar {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .header-actions {
    order: 4;
    gap: 0.5rem;
  }

  .header-action {
    padding: 0.25rem;
  }

  .action-text {
    display: none;
  }

  /* Navigation Mobile */
  .main-nav {
    display: none;
  }

  .main-nav.mobile-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu {
    flex-direction: column;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background-color: var(--primary-dark);
    border-radius: 0;
  }

  .dropdown-menu a {
    color: rgba(255, 255, 255, 0.9);
    padding-left: 2rem;
  }

  /* Hero Mobile */
  .hero {
    padding: 2rem 0;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  /* Products Mobile */
  .products-layout {
    grid-template-columns: 1fr;
  }

  .products-sidebar {
    position: static;
    order: 2;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Mobile Bottom Nav */
  .mobile-bottom-nav {
    display: block;
  }

  body {
    padding-bottom: var(--mobile-nav-height);
  }

  /* Newsletter Mobile */
  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.75rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .section-title {
    font-size: 1.5rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}

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

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.p-0 {
  padding: 0;
}
.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}
.p-4 {
  padding: 2rem;
}

.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

.text-primary {
  color: var(--primary-color);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-muted {
  color: var(--text-muted);
}
.text-success {
  color: var(--success-color);
}
.text-danger {
  color: var(--danger-color);
}
.text-warning {
  color: var(--warning-color);
}

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

.border {
  border: 1px solid var(--border-color);
}
.border-0 {
  border: none;
}
.rounded {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
