/* =============================================================================
   CATEGORY PAGE - Professional Enterprise-Grade Styles
   ============================================================================= */

/* =============================================================================
   PAGE HEADER
   ============================================================================= */

.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin: 0;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* =============================================================================
   PAGE CONTENT
   ============================================================================= */

.page-content {
  padding: 3rem 0;
  min-height: 60vh;
}

/* =============================================================================
   CATEGORY PRODUCT GRID
   ============================================================================= */

.category-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* =============================================================================
   CATEGORY PRODUCT CARD - Enterprise Grade Design
   ============================================================================= */

.category-product-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.category-product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.05) 0%,
    rgba(118, 75, 162, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.category-product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: rgba(102, 126, 234, 0.2);
}

.category-product-card:hover::before {
  opacity: 1;
}

.category-product-card:hover .category-product-thumb img {
  transform: scale(1.1);
}

.category-product-card:hover .category-product-overlay {
  opacity: 1;
}

/* =============================================================================
   PRODUCT THUMBNAIL
   ============================================================================= */

.category-product-thumb {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-product-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  font-size: 1.1rem;
  font-weight: 500;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.8) 0%,
    rgba(118, 75, 162, 0.8) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.category-product-overlay .quick-view-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #667eea;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.category-product-overlay .quick-view-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* =============================================================================
   PRODUCT INFO
   ============================================================================= */

.category-product-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 3;
}

.category-product-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-product-price::before {
  content: "$";
  font-size: 1.2rem;
  opacity: 0.8;
}

/* =============================================================================
   STOCK STATUS
   ============================================================================= */

.category-product-stock {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-product-in-stock {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.category-product-out-of-stock {
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* =============================================================================
   ADD TO CART BUTTON - Professional Design
   ============================================================================= */

.category-add-to-cart-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category-add-to-cart-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.5s ease;
}

.category-add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.category-add-to-cart-btn:hover::before {
  left: 100%;
}

.category-add-to-cart-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category-add-to-cart-btn:disabled {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.category-add-to-cart-btn:disabled:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.category-add-to-cart-btn .cart-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.category-add-to-cart-btn:hover .cart-icon {
  transform: scale(1.1);
}

.category-add-to-cart-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.category-add-to-cart-btn.loading .cart-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================================
   NO DATA STATE
   ============================================================================= */

.category-no-data {
  text-align: center;
  padding: 4rem 2rem;
  color: #6c757d;
}

.category-no-data-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.category-no-data h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #495057;
}

.category-no-data p {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.8;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1250px) {
  .container {
    padding: 0 15px;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 3rem 0 2rem;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .page-header p {
    font-size: 1.1rem;
  }

  .container {
    padding: 0 15px;
  }

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

  .category-product-thumb {
    height: 220px;
  }

  .category-product-info {
    padding: 1.25rem;
  }

  .category-product-info h3 {
    font-size: 1.2rem;
  }

  .category-product-price {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 2rem;
  }

  .container {
    padding: 0 5px;
  }

  .category-product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .category-product-thumb {
    height: 200px;
  }

  .category-product-info {
    padding: 1rem;
  }

  .category-add-to-cart-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.category-product-card.loading {
  pointer-events: none;
  opacity: 0.7;
}

.category-product-card.loading .category-product-thumb {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

.category-product-card:focus-within {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.category-add-to-cart-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
  .category-add-to-cart-btn,
  .category-product-overlay {
    display: none !important;
  }

  .category-product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .category-product-thumb {
    height: 150px;
  }
}
