/**
 * ================================
 * BLUECART PRODUCTS - UNIFIED CSS
 * ================================
 * Single source of truth for all products page styling
 * 
 * IMPORTANT: Product cards inherit from master.css card system
 * This file contains only products-page-specific layouts and features
 * 
 * Version: 3.1.0 UNIFIED - Card conflicts removed
 */

/* ========================================
   PRODUCTS PAGE LAYOUT
   ======================================== */
.products-page {
  background: var(--slate-50);
  min-height: 100vh;
}

/* ========================================
   PREMIUM HERO SECTION - UNIFIED
   ======================================== */
.products-hero {
  background: var(--gradient-primary);
  padding: var(--spacing-20) 0 var(--spacing-16);
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  align-items: center;
  color: var(--text-light);
  animation: heroEntrance 1.2s ease-out forwards;
}

/* Hero Overlay Pattern */
.products-hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
              linear-gradient(-45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
              linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
              linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 30px 30px;
  background-position: 0 0, 0 15px, 15px -15px, -15px 0px;
  opacity: 0.3;
  z-index: 1;
}

/* Floating Icons Animation */
.products-hero .hero-floating-icon {
  position: absolute;
  font-size: 36px;
  opacity: 0.6;
  z-index: 1;
  animation: float 8s ease-in-out infinite;
  filter: drop-shadow(0 8px 25px rgba(255, 255, 255, 0.3));
  color: rgba(255, 255, 255, 0.8);
}

.products-hero .icon-a { top: 15%; left: 15%; animation-delay: 0s; }
.products-hero .icon-b { top: 25%; right: 10%; animation-delay: 1s; }
.products-hero .icon-c { bottom: 25%; left: 10%; animation-delay: 2s; }
.products-hero .icon-d { bottom: 15%; right: 15%; animation-delay: 3s; }

/* Hero Content */
.products-hero .container {
  position: relative;
  z-index: 2;
  max-width: var(--container-xl, 1200px);
  margin: 0 auto;
  padding: 0 var(--spacing-8);
}

.products-hero .hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-12) var(--spacing-4);
}

.products-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-light-secondary);
  padding: var(--spacing-3) var(--spacing-6);
  border-radius: var(--radius-2xl);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--spacing-6);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.breadcrumb {
  margin-bottom: var(--spacing-6);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-2);
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.breadcrumb a {
  color: white;
  text-decoration: none;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.breadcrumb a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-current {
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.products-hero .hero-title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-black, 900);
  color: white;
  margin-bottom: var(--spacing-6);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.products-hero .hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-light-secondary);
  margin-bottom: var(--spacing-10);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Hero Search Bar */
.products-hero .hero-search {
  max-width: 700px;
  margin: 0 auto;
}

.products-hero .search-wrapper {
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-2);
  box-shadow: var(--shadow-2xl);
  position: relative;
}

.products-hero #search-input {
  flex: 1;
  padding: var(--spacing-4) var(--spacing-5);
  border: none;
  background: transparent;
  font-size: var(--font-size-lg);
  color: var(--bluecart-primary-dark);
  outline: none;
}

.products-hero #search-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.products-hero #search-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.products-hero #search-btn svg {
  width: 24px;
  height: 24px;
}

.products-hero .search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

/* ========================================
   FILTERS SECTION - UNIFIED
   ======================================== */
.filters-section {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  margin-top: -60px;
  padding-top: var(--spacing-8);
  border-bottom: 1px solid var(--slate-200);
  position: relative;
  z-index: 20;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-4);
}

.results-info {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.filters-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.filter-group label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Filter Controls Styling */
.filter-select {
  padding: var(--spacing-3) var(--spacing-6) var(--spacing-3) var(--spacing-4);
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  min-width: 160px;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23475569' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-3) center;
  background-size: var(--spacing-4);
}

.filter-select:hover {
  border-color: var(--bluecart-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background-color: var(--slate-50);
}

.filter-select:focus {
  outline: none;
  border-color: var(--bluecart-primary);
  box-shadow: 0 0 0 3px var(--bluecart-primary-alpha, rgba(46, 134, 193, 0.12));
  background-color: var(--bg-primary);
}

/* View Toggle Buttons */
.view-toggle {
  width: 48px;
  height: 48px;
  border: 2px solid var(--slate-300);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.view-toggle:hover {
  border-color: var(--bluecart-primary);
  color: var(--bluecart-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background-color: var(--slate-50);
}

.view-toggle.active {
  background: var(--gradient-primary);
  color: var(--text-light);
  border-color: var(--bluecart-primary);
  box-shadow: var(--shadow-lg);
}

.view-toggle svg {
  width: 20px;
  height: 20px;
}

/* Custom Brand Filter Dropdown */
.searchable-select-wrapper {
  position: relative;
}

.searchable-select {
  position: relative;
  min-width: 160px;
}

.searchable-select-display {
  padding: var(--spacing-3) var(--spacing-4);
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-2);
  transition: all 0.2s ease;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.searchable-select-display:hover {
  border-color: var(--bluecart-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background-color: var(--slate-50);
}

.searchable-select-display[aria-expanded="true"] {
  border-color: var(--bluecart-primary);
  box-shadow: 0 0 0 3px var(--bluecart-primary-alpha, rgba(46, 134, 193, 0.12));
  background-color: var(--bg-primary);
}

.dropdown-arrow {
  width: var(--spacing-4);
  height: var(--spacing-4);
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.searchable-select-display[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
  color: var(--bluecart-primary);
}

.searchable-select-dropdown {
  position: absolute;
  top: calc(100% + var(--spacing-1));
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 2px solid var(--bluecart-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-base, 1000);
  display: none;
  overflow: hidden;
}

.searchable-select-dropdown[aria-expanded="true"] {
  display: block;
  animation: dropdownSlideIn 0.15s ease-out;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-search {
  padding: var(--spacing-3);
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.dropdown-search input {
  width: 100%;
  padding: var(--spacing-2) var(--spacing-3);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  background: var(--bg-primary);
  transition: all 0.2s ease;
}

.dropdown-search input:focus {
  outline: none;
  border-color: var(--bluecart-primary);
  box-shadow: 0 0 0 2px var(--bluecart-primary-alpha, rgba(46, 134, 193, 0.12));
}

.dropdown-options {
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-primary);
}

.dropdown-option {
  padding: var(--spacing-3) var(--spacing-4);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.15s ease;
  border-bottom: 1px solid var(--slate-100);
  color: var(--text-primary);
}

.dropdown-option:hover {
  background: var(--slate-50);
  color: var(--bluecart-primary);
}

.dropdown-option[aria-selected="true"] {
  background: var(--bluecart-primary);
  color: var(--text-light);
  font-weight: 600;
}

.dropdown-option:last-child {
  border-bottom: none;
}

/* ========================================
   PRODUCTS DASHBOARD - UNIFIED
   ======================================== */
.products-dashboard {
  background: linear-gradient(180deg, 
    rgba(248, 250, 252, 0.8) 0%, 
    rgba(255, 255, 255, 0.95) 100%);
  padding: var(--spacing-8) 0;
  min-height: 60vh;
  position: relative;
}

.products-dashboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, 
    rgba(46, 134, 193, 0.05) 0%, 
    transparent 100%);
  pointer-events: none;
}

/* ========================================
   PRODUCTS GRID - UNIFIED LAYOUT
   ======================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-6);
  margin-bottom: var(--spacing-8);
}

.products-grid.list-view {
  grid-template-columns: 1fr;
  gap: var(--spacing-4);
}

/* ========================================
   PRODUCT CARDS - USING MASTER.CSS SYSTEM
   Cards inherit from master.css - no redefinition needed
   ======================================== */
   
/* NOTE: Product card base styles defined in master.css
   Only products-specific modifications below */

/* Products page specific - works with unified component via cascade */
.products-grid .product-card .product-image {
  width: 100%;
  aspect-ratio: 1 / 1;      /* keep consistent square shape */
  max-height: 280px;        /* desktop cap */
  overflow: visible;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-3);
  background: var(--bg-secondary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.products-grid .product-card .product-img {
  width: 100%;
  height: auto;
  object-fit: contain;      /* show full image, no cropping */
  object-position: center;
  transition: transform 0.3s ease;
}

.products-grid .product-card:hover .product-img {
  transform: scale(1.05);
}

.product-card .product-emoji {
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* Product Badges */
.product-badge {
  position: absolute;
  top: var(--spacing-3);
  left: var(--spacing-3);
  background: var(--gradient-primary);
  color: white;
  padding: var(--spacing-1) var(--spacing-3);
  border-radius: 9999px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.product-badge.sale {
  background: linear-gradient(135deg, var(--bluecart-danger) 0%, #ff6b6b 100%);
}

.product-badge.new {
  background: linear-gradient(135deg, var(--bluecart-success) 0%, #51cf66 100%);
}

.product-badge.featured {
  background: linear-gradient(135deg, var(--bluecart-warning) 0%, #ffd43b 100%);
  color: var(--slate-800);
}

/* Quick Action Overlay */
.product-actions-overlay {
  position: absolute;
  top: var(--spacing-4);
  right: var(--spacing-4);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  opacity: 0;
  transform: translateX(15px);
  transition: all 0.3s ease;
  z-index: 5;
  pointer-events: none;
}

.product-card:hover .product-actions-overlay {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.quick-action-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-btn:hover {
  background: white;
  border-color: var(--bluecart-primary);
  color: var(--bluecart-primary);
  transform: scale(1.1);
}

.quick-action-btn svg {
  width: 18px;
  height: 18px;
}

.favorite-btn:hover {
  color: var(--bluecart-danger);
  border-color: var(--bluecart-danger);
}

.product-card .favorite-btn.favorited {
  color: var(--bluecart-danger);
  background: rgba(231, 76, 60, 0.1);
  border-color: var(--bluecart-danger);
}

.compare-btn:hover {
  color: var(--bluecart-secondary);
  border-color: var(--bluecart-secondary);
}

/* Product Info Section */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.product-brand {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.product-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: var(--spacing-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.625;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  margin: var(--spacing-1) 0;
}

.stars {
  display: flex;
  gap: 1px;
}

.star {
  color: var(--bluecart-warning);
  font-size: var(--font-size-sm);
}

.star.empty {
  color: var(--slate-300);
}

.rating-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.product-price-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--spacing-1) 0;
}

.product-price {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--bluecart-primary);
}

.product-price-original {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: var(--spacing-2);
}

.product-discount {
  background: rgba(231, 76, 60, 0.1);
  color: var(--bluecart-danger);
  padding: var(--spacing-1) var(--spacing-2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* Product Actions - Bottom Section */
.product-actions {
  display: flex;
  gap: var(--spacing-2);
  margin-top: auto;
  padding-top: var(--spacing-1);
  flex-direction: row;
}

.add-to-cart-btn {
  flex: 1;
  padding: var(--spacing-3) var(--spacing-4);
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(46, 134, 193, 0.3);
}

.add-to-cart-btn:active {
  transform: translateY(0);
}

.add-to-cart-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.quick-view-btn {
  min-width: 44px;
  width: 44px;
  height: 44px;
  background: white;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.quick-view-btn:hover {
  background: var(--slate-50);
  border-color: var(--bluecart-primary);
  color: var(--bluecart-primary);
}

.quick-view-btn svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   LIST VIEW LAYOUT
   ======================================== */
.products-grid.list-view .product-card {
  flex-direction: row;
  height: auto;
  min-height: 200px;
}

.products-grid.list-view .product-image {
  width: 250px;
  height: 200px;
  flex-shrink: 0;
}

.products-grid.list-view .product-info {
  flex: 1;
  padding: var(--spacing-6);
}

.products-grid.list-view .product-actions {
  margin-top: auto;
  align-self: flex-end;
}

.products-grid.list-view .product-actions-overlay {
  position: static;
  flex-direction: row;
  opacity: 1;
  transform: none;
  margin-bottom: var(--spacing-4);
}

/* ========================================
   LOAD MORE BUTTON - UNIFIED
   ======================================== */
.load-more-container {
  display: flex;
  justify-content: center;
  margin: var(--spacing-8) 0;
}

.load-more-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-2xl);
  padding: var(--spacing-5) var(--spacing-8);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black, 900);
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-2xl);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.load-more-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(46, 134, 193, 0.4);
}

.load-more-btn:hover::before {
  left: 100%;
}

.load-more-btn .btn-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.load-more-btn:hover .btn-icon {
  transform: translateY(2px);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.load-more-btn:disabled:hover::before {
  left: -100%;
}

/* ========================================
   LOADING STATES - UNIFIED
   ======================================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-16) var(--spacing-8);
  text-align: center;
}

.loading-state .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--slate-200);
  border-top: 4px solid var(--bluecart-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-4);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Product Skeleton Loading */
.products-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-6);
}

.product-skeleton {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  animation: skeleton-pulse 1.5s ease-in-out infinite alternate;
}

.skeleton-image {
  width: 100%;
  height: 280px;
  background: var(--slate-200);
}

.skeleton-content {
  padding: var(--spacing-5);
}

.skeleton-line {
  height: 16px;
  background: var(--slate-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-3);
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

.skeleton-price {
  height: 20px;
  width: 40%;
  background: var(--slate-200);
  border-radius: var(--radius-md);
  margin: var(--spacing-4) 0;
}

.skeleton-buttons {
  display: flex;
  gap: var(--spacing-2);
  margin-top: var(--spacing-4);
}

.skeleton-button {
  height: 44px;
  background: var(--slate-200);
  border-radius: var(--radius-lg);
}

.skeleton-button.primary { flex: 1; }
.skeleton-button.secondary { width: 44px; }

@keyframes skeleton-pulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ========================================
   ERROR & EMPTY STATES - UNIFIED
   ======================================== */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-16) var(--spacing-8);
  text-align: center;
  color: var(--bluecart-danger);
}

.error-state h3 {
  margin-bottom: var(--spacing-4);
  color: var(--bluecart-danger);
}

.error-state button {
  background: var(--bluecart-primary);
  color: white;
  border: none;
  padding: var(--spacing-3) var(--spacing-6);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: var(--spacing-4);
}

.error-state button:hover {
  background: var(--bluecart-primary-dark);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-16) var(--spacing-8);
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: var(--spacing-4);
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: var(--spacing-2);
  color: var(--text-secondary);
}

/* ========================================
   NOTIFICATION SYSTEM - UNIFIED
   ======================================== */
#notification-container {
  position: fixed;
  top: var(--spacing-4);
  right: var(--spacing-4);
  z-index: var(--z-toast, 3000);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  max-width: 400px;
}

.notification {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-3);
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease;
  border-left: 4px solid var(--bluecart-primary);
  animation: slideInRight 0.3s ease-out;
}

.notification.success {
  border-left-color: var(--bluecart-success);
}

.notification.error {
  border-left-color: var(--bluecart-danger);
}

.notification.warning {
  border-left-color: var(--bluecart-warning);
}

.notification-close {
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.notification-close:hover {
  color: var(--text-primary);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   ANIMATIONS - UNIFIED
   ======================================== */
@keyframes heroEntrance {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for product cards */
.product-card {
  animation: slideUp 0.6s ease-out forwards;
  animation-delay: calc(var(--card-index, 0) * 0.05s);
  opacity: 0;
}

/* ========================================
   RESPONSIVE DESIGN - UNIFIED
   ======================================== */
@media (max-width: 768px) {
  .products-hero {
    padding: var(--spacing-16) 0 var(--spacing-12);
    min-height: 350px;
  }

  .products-hero .hero-title {
    font-size: var(--font-size-4xl);
  }

  .products-hero .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  .products-dashboard,
  .filters-section {
    margin-top: -30px;
  }
  
  .filters-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-3);
  }
  
  .filters-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-3);
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-1);
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-4);
  }
  
  .products-grid.list-view .product-card {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }
  
  .products-grid.list-view .product-image {
    width: 100%;
    max-height: 240px;
    aspect-ratio: 1 / 1;
  }
  
  .product-image {
    max-height: 240px;      /* mobile-friendly */
    aspect-ratio: 1 / 1;
  }
  
  .product-actions-overlay {
    opacity: 1;
    transform: translateX(0);
    position: static;
    flex-direction: row;
    justify-content: flex-end;
    margin-bottom: var(--spacing-3);
  }
  
  .load-more-btn {
    padding: var(--spacing-4) var(--spacing-6);
    font-size: var(--font-size-base);
  }
}

@media (max-width: 480px) {
  .products-hero {
    padding: var(--spacing-12) 0 var(--spacing-8);
  }

  .products-hero .hero-title {
    font-size: var(--font-size-3xl);
  }

  .products-hero .hero-subtitle {
    font-size: var(--font-size-base);
  }

  .products-hero #search-input {
    font-size: var(--font-size-base);
  }

  .products-hero #search-btn {
    width: 40px;
    height: 40px;
  }

  .products-hero #search-btn svg {
    width: 20px;
    height: 20px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-4);
  }
  
  .filters-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .product-actions {
    flex-direction: column;
    gap: var(--spacing-3);
  }
  
  .quick-view-btn {
    width: 100%;
    height: 44px;
  }
  
  .load-more-btn {
    padding: var(--spacing-3) var(--spacing-6);
    font-size: var(--font-size-sm);
  }

  .notification {
    left: var(--spacing-4);
    right: var(--spacing-4);
    min-width: auto;
  }
}

/* ========================================
   ACCESSIBILITY & REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-image,
  .add-to-cart-btn,
  .quick-view-btn,
  .load-more-btn,
  .hero-floating-icon {
    animation: none !important;
    transition: none !important;
  }
  
  .hero-floating-icon {
    opacity: 0.05;
  }
}

/* Focus states for accessibility */
.add-to-cart-btn:focus-visible,
.quick-view-btn:focus-visible,
.quick-action-btn:focus-visible,
.load-more-btn:focus-visible {
  outline: 2px solid var(--bluecart-primary);
  outline-offset: 2px;
}

.product-card:focus-visible {
  outline: 2px solid var(--bluecart-primary);
  outline-offset: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .product-card {
    border-width: 2px;
  }
  
  .add-to-cart-btn,
  .quick-view-btn,
  .load-more-btn {
    border-width: 2px;
  }
  
  .product-badge {
    border: 2px solid currentColor;
  }
}
