.category-page {
  padding: 2rem 0;
  min-height: 50vh;

  .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;

    @media (max-width: 768px) {
      padding: 0 1rem;
    }
  }

  .category-header {
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;

    h1 {
      font-size: 2.5rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      color: #2c3e50;
      text-transform: capitalize;
      
      @media (max-width: 768px) {
        font-size: 2rem;
      }
    }

    p {
      font-size: 1rem;
      color: #6c757d;
      margin: 0.5rem 0;
    }

    &:after {
      content: '';
      display: block;
      width: 60px;
      height: 3px;
      background-color: #2c3e50;
      margin: 1rem auto;
    }
  }

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

    @media (max-width: 576px) {
      grid-template-columns: 1fr;
    }

    .product-card {
      background-color: #fff;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 10px rgba(0,0,0,0.05);
      transition: all 0.3s ease;
      height: 100%;
      display: flex;
      flex-direction: column;

      &:hover {
        box-shadow: 0 5px 25px rgba(0,0,0,0.1);
        transform: translateY(-5px);

        .product-image-container {
          .product-actions {
            opacity: 1;
            transform: translateY(0);
          }
        }
      }

      a {
        text-decoration: none;
        color: inherit;
        display: flex;
        flex-direction: column;
        height: 100%;
      }

      .product-image-container {
        position: relative;
        width: 100%;
        height: 280px;
        overflow: hidden;

        .product-image, .placeholder-image {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: transform 0.4s ease;
        }

        .placeholder-image {
          display: flex;
          align-items: center;
          justify-content: center;
          background-color: #f8f9fa;
          color: #6c757d;
          font-size: 0.9rem;
        }

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

        .discount-badge {
          position: absolute;
          top: 10px;
          right: 10px;
          background-color: #e74c3c;
          color: white;
          padding: 0.3rem 0.8rem;
          border-radius: 20px;
          font-size: 0.9rem;
          font-weight: 600;
          z-index: 2;
        }

        .product-actions {
          position: absolute;
          bottom: 0;
          left: 0;
          right: 0;
          background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
          padding: 2rem 1rem 1rem;
          display: flex;
          justify-content: space-between;
          gap: 0.5rem;
          opacity: 0;
          transform: translateY(20px);
          transition: all 0.3s ease;

          button {
            flex: 1;
            border: none;
            padding: 0.6rem 0.5rem;
            font-size: 0.85rem;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;

            &.view-product-btn {
              background-color: rgba(255, 255, 255, 0.9);
              color: #2c3e50;

              &:hover {
                background-color: #fff;
              }
            }

            &.add-to-cart-btn {
              background-color: #2c3e50;
              color: white;

              &:hover {
                background-color: #1a2530;
              }
            }
          }
        }
      }

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

        .product-name {
          font-size: 1.1rem;
          font-weight: 600;
          margin-bottom: 0.8rem;
          color: #2c3e50;
          line-height: 1.4;
        }

        .product-price {
          margin-top: auto;

          .price-row {
            display: flex;
            align-items: center;
            gap: 0.8rem;
          }

          .discount-price {
            font-size: 1.2rem;
            font-weight: 700;
            color: #e74c3c;
          }

          .original-price {
            font-size: 0.9rem;
            color: #6c757d;
            text-decoration: line-through;
          }

          .regular-price {
            font-size: 1.2rem;
            font-weight: 700;
            color: #2c3e50;
          }
        }

        .out-of-stock-badge {
          display: inline-block;
          margin-top: 0.8rem;
          padding: 0.3rem 0.8rem;
          background-color: #f8f9fa;
          color: #6c757d;
          border-radius: 4px;
          font-size: 0.85rem;
          font-weight: 600;
        }
      }
    }
  }

  .no-products {
    text-align: center;
    padding: 3rem 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    
    p {
      font-size: 1.1rem;
      color: #6c757d;
      margin-bottom: 1.5rem;
    }
    
    .back-link {
      display: inline-block;
      padding: 0.8rem 1.5rem;
      background-color: #2c3e50;
      color: white;
      text-decoration: none;
      border-radius: 4px;
      font-weight: 600;
      transition: background-color 0.2s;
      
      &:hover {
        background-color: #1a2530;
      }
    }
  }

  &.loading, &.error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    
    .loading-spinner {
      text-align: center;
      padding: 2rem;
      font-size: 1.2rem;
      color: #6c757d;
      
      &:before {
        content: '';
        display: block;
        width: 40px;
        height: 40px;
        margin: 0 auto 1rem;
        border: 3px solid rgba(0,0,0,0.1);
        border-radius: 50%;
        border-top-color: #2c3e50;
        animation: spin 1s ease infinite;
      }
    }
    
    .error-message {
      background-color: #fff5f5;
      color: #c53030;
      padding: 1rem 1.5rem;
      border-radius: 8px;
      margin-bottom: 1.5rem;
      font-weight: 500;
    }
  }
}

// Categories list page styles
.categories-list-page {
  padding: 3rem 0;
  min-height: 50vh;

  .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;

    @media (max-width: 768px) {
      padding: 0 1rem;
    }
  }

  .page-header {
    text-align: center;
    margin-bottom: 3rem;

    h1 {
      font-size: 2.8rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      color: #2c3e50;
      
      @media (max-width: 768px) {
        font-size: 2.2rem;
      }
    }

    p {
      font-size: 1.1rem;
      color: #6c757d;
      margin: 0;
    }

    &:after {
      content: '';
      display: block;
      width: 80px;
      height: 3px;
      background-color: #2c3e50;
      margin: 1.5rem auto;
    }
  }

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

    @media (max-width: 576px) {
      grid-template-columns: 1fr;
    }

    .category-card {
      background-color: #fff;
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 3px 15px rgba(0,0,0,0.07);
      text-decoration: none;
      color: inherit;
      transition: all 0.3s ease;
      height: 100%;
      position: relative;
      
      &:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        
        .category-content {
          .view-products {
            .arrow {
              transform: translateX(5px);
            }
          }
        }
      }
      
      .category-content {
        padding: 2.5rem 1.8rem;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        height: 100%;
        display: flex;
        flex-direction: column;
        
        h2 {
          font-size: 1.6rem;
          font-weight: 700;
          margin-bottom: 1rem;
          color: #2c3e50;
        }
        
        .product-count {
          font-size: 1rem;
          color: #6c757d;
          margin-bottom: 2rem;
          padding: 0.3rem 0.8rem;
          background-color: rgba(255, 255, 255, 0.5);
          border-radius: 20px;
          display: inline-block;
        }
        
        .view-products {
          margin-top: auto;
          color: #2c3e50;
          font-weight: 600;
          display: flex;
          align-items: center;
          gap: 0.5rem;
          
          .arrow {
            transition: transform 0.3s ease;
          }
        }
      }
    }
  }
  
  .no-categories {
    text-align: center;
    padding: 3rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    
    p {
      font-size: 1.1rem;
      color: #6c757d;
      margin: 0;
    }
  }

  &.loading, &.error {
    display: flex;
    align-items: center;
    justify-content: center;
    
    .loading-spinner {
      text-align: center;
      padding: 2rem;
      font-size: 1.2rem;
      color: #6c757d;
      
      &:before {
        content: '';
        display: block;
        width: 40px;
        height: 40px;
        margin: 0 auto 1rem;
        border: 3px solid rgba(0,0,0,0.1);
        border-radius: 50%;
        border-top-color: #2c3e50;
        animation: spin 1s ease infinite;
      }
    }
    
    .error-message {
      background-color: #fff5f5;
      color: #c53030;
      padding: 1rem 1.5rem;
      border-radius: 8px;
      font-weight: 500;
    }
  }
}

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